Skip to content

Commit

Permalink
Add scrapertest package in a separate module (#11988)
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu authored Jan 2, 2025
1 parent cafe9fd commit c84f1bd
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .chloggen/add-scrapertest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: scrapertest

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add scrapertest package in a separate module

# One or more tracking issues or pull requests related to the change
issues: [11988]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [api]
1 change: 1 addition & 0 deletions scraper/scrapertest/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../Makefile.Common
47 changes: 47 additions & 0 deletions scraper/scrapertest/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
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.33.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
google.golang.org/grpc v1.69.2 // indirect
google.golang.org/protobuf v1.36.1 // indirect
)

replace go.opentelemetry.io/collector/component/componenttest => ../../component/componenttest

replace go.opentelemetry.io/collector/component => ../../component

replace go.opentelemetry.io/collector/pipeline => ../../pipeline

replace go.opentelemetry.io/collector/pdata => ../../pdata

replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry

replace go.opentelemetry.io/collector/scraper => ../
89 changes: 89 additions & 0 deletions scraper/scrapertest/go.sum

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

23 changes: 23 additions & 0 deletions scraper/scrapertest/settings.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package scrapertest // import "go.opentelemetry.io/collector/scraper/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(),
}
}
1 change: 1 addition & 0 deletions versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ module-sets:
- go.opentelemetry.io/collector/receiver/receivertest
- go.opentelemetry.io/collector/receiver/xreceiver
- go.opentelemetry.io/collector/scraper
- go.opentelemetry.io/collector/scraper/scrapertest
- go.opentelemetry.io/collector/semconv
- go.opentelemetry.io/collector/service
- go.opentelemetry.io/collector/filter
Expand Down

0 comments on commit c84f1bd

Please sign in to comment.