Skip to content

Commit

Permalink
Add scrapertest package in a separate module
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
  • Loading branch information
bogdandrutu committed Dec 27, 2024
1 parent ffcef93 commit be1a4fa
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 0 deletions.
35 changes: 35 additions & 0 deletions scraper/scrapertest/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module go.opentelemetry.io/collector/scraper/scrapertest

go 1.22.0

require (
github.com/google/uuid v1.6.0
go.opentelemetry.io/collector/component v0.116.0
go.opentelemetry.io/collector/component/componenttest v0.116.0
go.opentelemetry.io/collector/scraper v0.116.0
)

require (
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.116.0 // indirect
go.opentelemetry.io/collector/pdata v1.22.0 // indirect
go.opentelemetry.io/collector/pipeline v0.116.0 // indirect
go.opentelemetry.io/otel v1.32.0 // indirect
go.opentelemetry.io/otel/metric v1.32.0 // indirect
go.opentelemetry.io/otel/sdk v1.32.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect
go.opentelemetry.io/otel/trace v1.32.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/text v0.18.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/grpc v1.68.1 // indirect
google.golang.org/protobuf v1.35.2 // indirect
)
101 changes: 101 additions & 0 deletions scraper/scrapertest/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions scraper/scrapertest/settings.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package scrapertest

import (
"github.com/google/uuid"

"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/scraper"
)

var defaultComponentType = component.MustNewType("nop")

// NewNopSettings returns a new nop scraper.Settings.
func NewNopSettings() scraper.Settings {
return scraper.Settings{
ID: component.NewIDWithName(defaultComponentType, uuid.NewString()),
TelemetrySettings: componenttest.NewNopTelemetrySettings(),
BuildInfo: component.NewDefaultBuildInfo(),
}
}

0 comments on commit be1a4fa

Please sign in to comment.