diff --git a/.chloggen/migrate-scrapererror.yaml b/.chloggen/migrate-scrapererror.yaml new file mode 100644 index 00000000000..846c131f466 --- /dev/null +++ b/.chloggen/migrate-scrapererror.yaml @@ -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: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: receiver/scrapererror + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: The `scrapererror` package inside `receiver` has been moved to `receiver/scraper/scrapererror` package + +# One or more tracking issues or pull requests related to the change +issues: [11003] + +# (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: contrib and other packages importing receiver/scrapererror should be updated to import receiver/scraper/scrapererror + +# 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] diff --git a/.chloggen/migrate-scraperhelper.yaml b/.chloggen/migrate-scraperhelper.yaml new file mode 100644 index 00000000000..df577d925d5 --- /dev/null +++ b/.chloggen/migrate-scraperhelper.yaml @@ -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: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: receiver/scraperhelper + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: The `scraperhelper` package inside `receiver` has been moved to `receiver/scraper/scraperhelper` package + +# One or more tracking issues or pull requests related to the change +issues: [11003] + +# (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: contrib and other packages importing receiver/scraperhelper should be updated to import receiver/scraper/scraperhelper + +# 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] diff --git a/.chloggen/receiver-scraper-module.yaml b/.chloggen/receiver-scraper-module.yaml new file mode 100644 index 00000000000..219670ea214 --- /dev/null +++ b/.chloggen/receiver-scraper-module.yaml @@ -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: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: receiver/scraper + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: The `scraper` module has been created inside `receiver` package to hold scraper related components + +# One or more tracking issues or pull requests related to the change +issues: [11003] + +# (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: contrib and other packages importing receiver and using scraper related components should be updated to import receiver/scraper + +# 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] diff --git a/Makefile b/Makefile index 3a1f350220b..19d9996b368 100644 --- a/Makefile +++ b/Makefile @@ -327,6 +327,7 @@ check-contrib: -replace go.opentelemetry.io/collector/receiver/otlpreceiver=$(CURDIR)/receiver/otlpreceiver \ -replace go.opentelemetry.io/collector/receiver/receiverprofiles=$(CURDIR)/receiver/receiverprofiles \ -replace go.opentelemetry.io/collector/receiver/receivertest=$(CURDIR)/receiver/receivertest \ + -replace go.opentelemetry.io/collector/receiver/scraper=$(CURDIR)/receiver/scraper \ -replace go.opentelemetry.io/collector/semconv=$(CURDIR)/semconv \ -replace go.opentelemetry.io/collector/service=$(CURDIR)/service" @$(MAKE) -C $(CONTRIB_PATH) gotidy @@ -400,6 +401,7 @@ restore-contrib: -dropreplace go.opentelemetry.io/collector/receiver \ -dropreplace go.opentelemetry.io/collector/receiver/nopreceiver \ -dropreplace go.opentelemetry.io/collector/receiver/otlpreceiver \ + -dropreplace go.opentelemetry.io/collector/receiver/scraper \ -dropreplace go.opentelemetry.io/collector/semconv \ -dropreplace go.opentelemetry.io/collector/service" @$(MAKE) -C $(CONTRIB_PATH) -j2 gotidy diff --git a/cmd/builder/internal/builder/main_test.go b/cmd/builder/internal/builder/main_test.go index a362d2dcf99..ba99e8cc49a 100644 --- a/cmd/builder/internal/builder/main_test.go +++ b/cmd/builder/internal/builder/main_test.go @@ -97,6 +97,7 @@ var ( "/receiver/otlpreceiver", "/receiver/receiverprofiles", "/receiver/receivertest", + "/receiver/scraper", "/pdata", "/pdata/testdata", "/pdata/pprofile", diff --git a/cmd/builder/test/core.builder.yaml b/cmd/builder/test/core.builder.yaml index 227750fdc82..b85b3ded886 100644 --- a/cmd/builder/test/core.builder.yaml +++ b/cmd/builder/test/core.builder.yaml @@ -69,5 +69,6 @@ replaces: - go.opentelemetry.io/collector/receiver/otlpreceiver => ${WORKSPACE_DIR}/receiver/otlpreceiver - go.opentelemetry.io/collector/receiver/receiverprofiles => ${WORKSPACE_DIR}/receiver/receiverprofiles - go.opentelemetry.io/collector/receiver/receivertest => ${WORKSPACE_DIR}/receiver/receivertest + - go.opentelemetry.io/collector/receiver/scraper => ${WORKSPACE_DIR}/receiver/scraper - go.opentelemetry.io/collector/semconv => ${WORKSPACE_DIR}/semconv - go.opentelemetry.io/collector/service => ${WORKSPACE_DIR}/service diff --git a/cmd/mdatagen/go.mod b/cmd/mdatagen/go.mod index 3c72f2ac314..bcb7ad56681 100644 --- a/cmd/mdatagen/go.mod +++ b/cmd/mdatagen/go.mod @@ -86,6 +86,8 @@ replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/con replace go.opentelemetry.io/collector/receiver/receivertest => ../../receiver/receivertest +replace go.opentelemetry.io/collector/receiver/scraper => ../../receiver/scraper + retract ( v0.76.2 v0.76.1 diff --git a/cmd/otelcorecol/builder-config.yaml b/cmd/otelcorecol/builder-config.yaml index c13835c196f..617d98275e0 100644 --- a/cmd/otelcorecol/builder-config.yaml +++ b/cmd/otelcorecol/builder-config.yaml @@ -100,5 +100,6 @@ replaces: - go.opentelemetry.io/collector/receiver/otlpreceiver => ../../receiver/otlpreceiver - go.opentelemetry.io/collector/receiver/receiverprofiles => ../../receiver/receiverprofiles - go.opentelemetry.io/collector/receiver/receivertest => ../../receiver/receivertest + - go.opentelemetry.io/collector/receiver/scraper => ../../receiver/scraper - go.opentelemetry.io/collector/semconv => ../../semconv - go.opentelemetry.io/collector/service => ../../service diff --git a/cmd/otelcorecol/go.mod b/cmd/otelcorecol/go.mod index 1bffa80864b..6b527f7ac82 100644 --- a/cmd/otelcorecol/go.mod +++ b/cmd/otelcorecol/go.mod @@ -283,6 +283,8 @@ replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../../receive replace go.opentelemetry.io/collector/receiver/receivertest => ../../receiver/receivertest +replace go.opentelemetry.io/collector/receiver/scraper => ../../receiver/scraper + replace go.opentelemetry.io/collector/semconv => ../../semconv replace go.opentelemetry.io/collector/service => ../../service diff --git a/exporter/debugexporter/go.mod b/exporter/debugexporter/go.mod index eebad9d123b..2e9f54fd184 100644 --- a/exporter/debugexporter/go.mod +++ b/exporter/debugexporter/go.mod @@ -81,6 +81,8 @@ replace go.opentelemetry.io/collector/receiver => ../../receiver replace go.opentelemetry.io/collector/receiver/receivertest => ../../receiver/receivertest +replace go.opentelemetry.io/collector/receiver/scraper => ../../receiver/scraper + replace go.opentelemetry.io/collector/extension => ../../extension replace go.opentelemetry.io/collector/extension/experimental/storage => ../../extension/experimental/storage diff --git a/exporter/exporterhelper/exporterhelperprofiles/go.mod b/exporter/exporterhelper/exporterhelperprofiles/go.mod index 794ab5e359a..7b79f939076 100644 --- a/exporter/exporterhelper/exporterhelperprofiles/go.mod +++ b/exporter/exporterhelper/exporterhelperprofiles/go.mod @@ -76,6 +76,8 @@ replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../../../rece replace go.opentelemetry.io/collector/receiver/receivertest => ../../../receiver/receivertest +replace go.opentelemetry.io/collector/receiver/scraper => ../../../receiver/scraper + replace go.opentelemetry.io/collector/extension => ../../../extension replace go.opentelemetry.io/collector/pdata => ../../../pdata diff --git a/exporter/exporterprofiles/go.mod b/exporter/exporterprofiles/go.mod index 3c0bebd693b..988b2296b97 100644 --- a/exporter/exporterprofiles/go.mod +++ b/exporter/exporterprofiles/go.mod @@ -71,3 +71,5 @@ replace go.opentelemetry.io/collector/exporter/exportertest => ../exportertest replace go.opentelemetry.io/collector/consumer/consumererror => ../../consumer/consumererror replace go.opentelemetry.io/collector/receiver/receivertest => ../../receiver/receivertest + +replace go.opentelemetry.io/collector/receiver/scraper => ../../receiver/scraper diff --git a/exporter/exportertest/go.mod b/exporter/exportertest/go.mod index 93703be0948..8db3a2ec065 100644 --- a/exporter/exportertest/go.mod +++ b/exporter/exportertest/go.mod @@ -64,6 +64,8 @@ replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../../receive replace go.opentelemetry.io/collector/receiver/receivertest => ../../receiver/receivertest +replace go.opentelemetry.io/collector/receiver/scraper => ../../receiver/scraper + replace go.opentelemetry.io/collector/extension => ../../extension replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry diff --git a/exporter/go.mod b/exporter/go.mod index 4c544306645..b2dbb321de9 100644 --- a/exporter/go.mod +++ b/exporter/go.mod @@ -84,6 +84,8 @@ replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../receiver/r replace go.opentelemetry.io/collector/receiver/receivertest => ../receiver/receivertest +replace go.opentelemetry.io/collector/receiver/scraper => ../receiver/scraper + replace go.opentelemetry.io/collector/exporter/exporterprofiles => ./exporterprofiles replace go.opentelemetry.io/collector/exporter/exportertest => ./exportertest diff --git a/exporter/nopexporter/go.mod b/exporter/nopexporter/go.mod index 6f437ab0039..0e4187bfc99 100644 --- a/exporter/nopexporter/go.mod +++ b/exporter/nopexporter/go.mod @@ -87,6 +87,8 @@ replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../../receive replace go.opentelemetry.io/collector/receiver/receivertest => ../../receiver/receivertest +replace go.opentelemetry.io/collector/receiver/scraper => ../../receiver/scraper + replace go.opentelemetry.io/collector/exporter/exporterprofiles => ../exporterprofiles replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/exporter/otlpexporter/go.mod b/exporter/otlpexporter/go.mod index 05eb041d319..cef90f887ee 100644 --- a/exporter/otlpexporter/go.mod +++ b/exporter/otlpexporter/go.mod @@ -128,6 +128,8 @@ replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../../receive replace go.opentelemetry.io/collector/receiver/receivertest => ../../receiver/receivertest +replace go.opentelemetry.io/collector/receiver/scraper => ../../receiver/scraper + replace go.opentelemetry.io/collector/exporter/exporterprofiles => ../exporterprofiles replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/exporter/otlphttpexporter/go.mod b/exporter/otlphttpexporter/go.mod index 6489f26490e..6b4e81e5e6b 100644 --- a/exporter/otlphttpexporter/go.mod +++ b/exporter/otlphttpexporter/go.mod @@ -128,6 +128,8 @@ replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../../receive replace go.opentelemetry.io/collector/receiver/receivertest => ../../receiver/receivertest +replace go.opentelemetry.io/collector/receiver/scraper => ../../receiver/scraper + replace go.opentelemetry.io/collector/pipeline/pipelineprofiles => ../../pipeline/pipelineprofiles replace go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles => ../../consumer/consumererror/consumererrorprofiles diff --git a/internal/e2e/go.mod b/internal/e2e/go.mod index c04cf69dce2..8bf01d03b24 100644 --- a/internal/e2e/go.mod +++ b/internal/e2e/go.mod @@ -212,6 +212,8 @@ replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../../receive replace go.opentelemetry.io/collector/receiver/receivertest => ../../receiver/receivertest +replace go.opentelemetry.io/collector/receiver/scraper => ../../receiver/scraper + replace go.opentelemetry.io/collector/processor/processorprofiles => ../../processor/processorprofiles replace go.opentelemetry.io/collector/connector/connectorprofiles => ../../connector/connectorprofiles diff --git a/otelcol/go.mod b/otelcol/go.mod index 290430da9f0..0090234a33f 100644 --- a/otelcol/go.mod +++ b/otelcol/go.mod @@ -179,6 +179,8 @@ replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../receiver/r replace go.opentelemetry.io/collector/receiver/receivertest => ../receiver/receivertest +replace go.opentelemetry.io/collector/receiver/scraper => ../receiver/scraper + replace go.opentelemetry.io/collector/processor/processorprofiles => ../processor/processorprofiles replace go.opentelemetry.io/collector/connector/connectorprofiles => ../connector/connectorprofiles diff --git a/otelcol/otelcoltest/go.mod b/otelcol/otelcoltest/go.mod index d5cc098985b..7767d5166eb 100644 --- a/otelcol/otelcoltest/go.mod +++ b/otelcol/otelcoltest/go.mod @@ -174,6 +174,8 @@ replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../../receive replace go.opentelemetry.io/collector/receiver/receivertest => ../../receiver/receivertest +replace go.opentelemetry.io/collector/receiver/scraper => ../../receiver/scraper + replace go.opentelemetry.io/collector/processor/processorprofiles => ../../processor/processorprofiles replace go.opentelemetry.io/collector/connector/connectorprofiles => ../../connector/connectorprofiles diff --git a/receiver/go.mod b/receiver/go.mod index fb181a5f4e0..23447688705 100644 --- a/receiver/go.mod +++ b/receiver/go.mod @@ -8,17 +8,14 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.113.0 go.opentelemetry.io/collector/consumer v0.113.0 go.opentelemetry.io/collector/consumer/consumertest v0.113.0 - go.opentelemetry.io/collector/pdata v1.19.0 go.opentelemetry.io/collector/pipeline v0.113.0 go.opentelemetry.io/collector/receiver/receivertest v0.113.0 + go.opentelemetry.io/collector/receiver/scraper v0.113.0 go.opentelemetry.io/otel v1.31.0 go.opentelemetry.io/otel/metric v1.31.0 - go.opentelemetry.io/otel/sdk v1.31.0 go.opentelemetry.io/otel/sdk/metric v1.31.0 go.opentelemetry.io/otel/trace v1.31.0 go.uber.org/goleak v1.3.0 - go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.27.0 ) require ( @@ -33,8 +30,12 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect go.opentelemetry.io/collector/consumer/consumererror v0.113.0 // indirect go.opentelemetry.io/collector/consumer/consumerprofiles v0.113.0 // indirect + go.opentelemetry.io/collector/pdata v1.19.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.113.0 // indirect go.opentelemetry.io/collector/receiver/receiverprofiles v0.113.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.28.0 // indirect golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect @@ -64,6 +65,8 @@ replace go.opentelemetry.io/collector/receiver/receiverprofiles => ./receiverpro replace go.opentelemetry.io/collector/receiver/receivertest => ./receivertest +replace go.opentelemetry.io/collector/receiver/scraper => ./scraper + retract v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module replace go.opentelemetry.io/collector/pipeline => ../pipeline diff --git a/receiver/nopreceiver/go.mod b/receiver/nopreceiver/go.mod index 84694d2f466..139c2d12664 100644 --- a/receiver/nopreceiver/go.mod +++ b/receiver/nopreceiver/go.mod @@ -76,6 +76,8 @@ replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../receiverpr replace go.opentelemetry.io/collector/receiver/receivertest => ../receivertest +replace go.opentelemetry.io/collector/receiver/scraper => ../scraper + replace go.opentelemetry.io/collector/pipeline => ../../pipeline replace go.opentelemetry.io/collector/consumer/consumererror => ../../consumer/consumererror diff --git a/receiver/otlpreceiver/go.mod b/receiver/otlpreceiver/go.mod index 72d881a28a1..a1eb564db1c 100644 --- a/receiver/otlpreceiver/go.mod +++ b/receiver/otlpreceiver/go.mod @@ -126,6 +126,8 @@ replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../receiverpr replace go.opentelemetry.io/collector/receiver/receivertest => ../receivertest +replace go.opentelemetry.io/collector/receiver/scraper => ../scraper + replace go.opentelemetry.io/collector/pipeline => ../../pipeline replace go.opentelemetry.io/collector/consumer/consumererror => ../../consumer/consumererror diff --git a/receiver/receiverprofiles/go.mod b/receiver/receiverprofiles/go.mod index 41172de13a5..17b809026b1 100644 --- a/receiver/receiverprofiles/go.mod +++ b/receiver/receiverprofiles/go.mod @@ -59,3 +59,5 @@ replace go.opentelemetry.io/collector/pipeline => ../../pipeline replace go.opentelemetry.io/collector/consumer/consumererror => ../../consumer/consumererror replace go.opentelemetry.io/collector/receiver/receivertest => ../receivertest + +replace go.opentelemetry.io/collector/receiver/scraper => ../scraper diff --git a/receiver/receivertest/go.mod b/receiver/receivertest/go.mod index 6bceb4eb375..9b912be4a52 100644 --- a/receiver/receivertest/go.mod +++ b/receiver/receivertest/go.mod @@ -56,6 +56,8 @@ replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/con replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../receiverprofiles +replace go.opentelemetry.io/collector/receiver/scraper => ../scraper + replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles replace go.opentelemetry.io/collector/consumer/consumererror => ../../consumer/consumererror diff --git a/receiver/scraper/Makefile b/receiver/scraper/Makefile new file mode 100644 index 00000000000..ded7a36092d --- /dev/null +++ b/receiver/scraper/Makefile @@ -0,0 +1 @@ +include ../../Makefile.Common diff --git a/receiver/scraper/doc.go b/receiver/scraper/doc.go new file mode 100644 index 00000000000..8082a493077 --- /dev/null +++ b/receiver/scraper/doc.go @@ -0,0 +1,5 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Package scraper provides utilities and custom error types for scrapers. +package scraper // import "go.opentelemetry.io/collector/receiver/scraper" diff --git a/receiver/scraper/go.mod b/receiver/scraper/go.mod new file mode 100644 index 00000000000..ec7753c0b1e --- /dev/null +++ b/receiver/scraper/go.mod @@ -0,0 +1,67 @@ +module go.opentelemetry.io/collector/receiver/scraper + +go 1.22.0 + +require ( + github.com/stretchr/testify v1.9.0 + go.opentelemetry.io/collector/component v0.113.0 + go.opentelemetry.io/collector/config/configtelemetry v0.113.0 + go.opentelemetry.io/collector/consumer v0.113.0 + go.opentelemetry.io/collector/consumer/consumertest v0.113.0 + go.opentelemetry.io/collector/pdata v1.19.0 + go.opentelemetry.io/collector/pipeline v0.113.0 + go.opentelemetry.io/collector/receiver v0.113.0 + go.opentelemetry.io/collector/receiver/receivertest v0.113.0 + go.opentelemetry.io/otel v1.31.0 + go.opentelemetry.io/otel/metric v1.31.0 + go.opentelemetry.io/otel/sdk v1.31.0 + go.opentelemetry.io/otel/sdk/metric v1.31.0 + go.opentelemetry.io/otel/trace v1.31.0 + go.uber.org/goleak v1.3.0 + go.uber.org/multierr v1.11.0 + go.uber.org/zap v1.27.0 +) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + 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/google/uuid v1.6.0 // 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 + github.com/pmezard/go-difflib v1.0.0 // indirect + go.opentelemetry.io/collector/consumer/consumererror v0.113.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.113.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.113.0 // indirect + go.opentelemetry.io/collector/receiver/receiverprofiles v0.113.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/text v0.17.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect + google.golang.org/grpc v1.67.1 // indirect + google.golang.org/protobuf v1.35.1 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) + +replace ( + go.opentelemetry.io/collector/component => ../../component + go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry + go.opentelemetry.io/collector/consumer => ../../consumer + go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest + go.opentelemetry.io/collector/pdata => ../../pdata + go.opentelemetry.io/collector/pipeline => ../../pipeline + go.opentelemetry.io/collector/receiver => .. + go.opentelemetry.io/collector/receiver/receivertest => ../receivertest +) + +replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata + +replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../receiverprofiles + +replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles + +replace go.opentelemetry.io/collector/consumer/consumererror => ../../consumer/consumererror + +replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile diff --git a/receiver/scraper/go.sum b/receiver/scraper/go.sum new file mode 100644 index 00000000000..ac86a8a0265 --- /dev/null +++ b/receiver/scraper/go.sum @@ -0,0 +1,96 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= +google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= +google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/receiver/scrapererror/doc.go b/receiver/scraper/scrapererror/doc.go similarity index 87% rename from receiver/scrapererror/doc.go rename to receiver/scraper/scrapererror/doc.go index c893f0f8e89..96a11c7569a 100644 --- a/receiver/scrapererror/doc.go +++ b/receiver/scraper/scrapererror/doc.go @@ -2,4 +2,4 @@ // SPDX-License-Identifier: Apache-2.0 // Package scrapererror provides custom error types for scrapers. -package scrapererror // import "go.opentelemetry.io/collector/receiver/scrapererror" +package scrapererror // import "go.opentelemetry.io/collector/receiver/scraper/scrapererror" diff --git a/receiver/scrapererror/package_test.go b/receiver/scraper/scrapererror/package_test.go similarity index 100% rename from receiver/scrapererror/package_test.go rename to receiver/scraper/scrapererror/package_test.go diff --git a/receiver/scrapererror/partialscrapeerror.go b/receiver/scraper/scrapererror/partialscrapeerror.go similarity index 96% rename from receiver/scrapererror/partialscrapeerror.go rename to receiver/scraper/scrapererror/partialscrapeerror.go index cb4c03bab80..1b1ef13afb2 100644 --- a/receiver/scrapererror/partialscrapeerror.go +++ b/receiver/scraper/scrapererror/partialscrapeerror.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package scrapererror // import "go.opentelemetry.io/collector/receiver/scrapererror" +package scrapererror // import "go.opentelemetry.io/collector/receiver/scraper/scrapererror" import "errors" diff --git a/receiver/scrapererror/partialscrapeerror_test.go b/receiver/scraper/scrapererror/partialscrapeerror_test.go similarity index 100% rename from receiver/scrapererror/partialscrapeerror_test.go rename to receiver/scraper/scrapererror/partialscrapeerror_test.go diff --git a/receiver/scrapererror/scrapeerror.go b/receiver/scraper/scrapererror/scrapeerror.go similarity index 97% rename from receiver/scrapererror/scrapeerror.go rename to receiver/scraper/scrapererror/scrapeerror.go index 9c1b4b08a20..ac8eaaed86f 100644 --- a/receiver/scrapererror/scrapeerror.go +++ b/receiver/scraper/scrapererror/scrapeerror.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package scrapererror // import "go.opentelemetry.io/collector/receiver/scrapererror" +package scrapererror // import "go.opentelemetry.io/collector/receiver/scraper/scrapererror" import ( "go.uber.org/multierr" diff --git a/receiver/scrapererror/scrapeerror_test.go b/receiver/scraper/scrapererror/scrapeerror_test.go similarity index 100% rename from receiver/scrapererror/scrapeerror_test.go rename to receiver/scraper/scrapererror/scrapeerror_test.go diff --git a/receiver/scraperhelper/config.go b/receiver/scraper/scraperhelper/config.go similarity index 98% rename from receiver/scraperhelper/config.go rename to receiver/scraper/scraperhelper/config.go index 84b7cd2073e..0efdf679006 100644 --- a/receiver/scraperhelper/config.go +++ b/receiver/scraper/scraperhelper/config.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package scraperhelper // import "go.opentelemetry.io/collector/receiver/scraperhelper" +package scraperhelper // import "go.opentelemetry.io/collector/receiver/scraper/scraperhelper" import ( "errors" diff --git a/receiver/scraperhelper/config_test.go b/receiver/scraper/scraperhelper/config_test.go similarity index 100% rename from receiver/scraperhelper/config_test.go rename to receiver/scraper/scraperhelper/config_test.go diff --git a/receiver/scraperhelper/doc.go b/receiver/scraper/scraperhelper/doc.go similarity index 88% rename from receiver/scraperhelper/doc.go rename to receiver/scraper/scraperhelper/doc.go index a1e5cb26f1d..03ef439433e 100644 --- a/receiver/scraperhelper/doc.go +++ b/receiver/scraper/scraperhelper/doc.go @@ -4,4 +4,4 @@ //go:generate mdatagen metadata.yaml // Package scraperhelper provides utilities for scrapers. -package scraperhelper // import "go.opentelemetry.io/collector/receiver/scraperhelper" +package scraperhelper // import "go.opentelemetry.io/collector/receiver/scraper/scraperhelper" diff --git a/receiver/scraperhelper/documentation.md b/receiver/scraper/scraperhelper/documentation.md similarity index 100% rename from receiver/scraperhelper/documentation.md rename to receiver/scraper/scraperhelper/documentation.md diff --git a/receiver/scraperhelper/generated_component_telemetry_test.go b/receiver/scraper/scraperhelper/generated_component_telemetry_test.go similarity index 100% rename from receiver/scraperhelper/generated_component_telemetry_test.go rename to receiver/scraper/scraperhelper/generated_component_telemetry_test.go diff --git a/receiver/scraperhelper/generated_package_test.go b/receiver/scraper/scraperhelper/generated_package_test.go similarity index 100% rename from receiver/scraperhelper/generated_package_test.go rename to receiver/scraper/scraperhelper/generated_package_test.go diff --git a/receiver/scraperhelper/internal/metadata/generated_telemetry.go b/receiver/scraper/scraperhelper/internal/metadata/generated_telemetry.go similarity index 95% rename from receiver/scraperhelper/internal/metadata/generated_telemetry.go rename to receiver/scraper/scraperhelper/internal/metadata/generated_telemetry.go index 5bcbf186364..78afae9e9bb 100644 --- a/receiver/scraperhelper/internal/metadata/generated_telemetry.go +++ b/receiver/scraper/scraperhelper/internal/metadata/generated_telemetry.go @@ -14,15 +14,15 @@ import ( // Deprecated: [v0.108.0] use LeveledMeter instead. func Meter(settings component.TelemetrySettings) metric.Meter { - return settings.MeterProvider.Meter("go.opentelemetry.io/collector/receiver/scraperhelper") + return settings.MeterProvider.Meter("go.opentelemetry.io/collector/receiver/scraper/scraperhelper") } func LeveledMeter(settings component.TelemetrySettings, level configtelemetry.Level) metric.Meter { - return settings.LeveledMeterProvider(level).Meter("go.opentelemetry.io/collector/receiver/scraperhelper") + return settings.LeveledMeterProvider(level).Meter("go.opentelemetry.io/collector/receiver/scraper/scraperhelper") } func Tracer(settings component.TelemetrySettings) trace.Tracer { - return settings.TracerProvider.Tracer("go.opentelemetry.io/collector/receiver/scraperhelper") + return settings.TracerProvider.Tracer("go.opentelemetry.io/collector/receiver/scraper/scraperhelper") } // TelemetryBuilder provides an interface for components to report telemetry diff --git a/receiver/scraperhelper/internal/metadata/generated_telemetry_test.go b/receiver/scraper/scraperhelper/internal/metadata/generated_telemetry_test.go similarity index 97% rename from receiver/scraperhelper/internal/metadata/generated_telemetry_test.go rename to receiver/scraper/scraperhelper/internal/metadata/generated_telemetry_test.go index 333154c8b1a..e6fb63e32b6 100644 --- a/receiver/scraperhelper/internal/metadata/generated_telemetry_test.go +++ b/receiver/scraper/scraperhelper/internal/metadata/generated_telemetry_test.go @@ -54,14 +54,14 @@ func TestProviders(t *testing.T) { meter := Meter(set) if m, ok := meter.(mockMeter); ok { - require.Equal(t, "go.opentelemetry.io/collector/receiver/scraperhelper", m.name) + require.Equal(t, "go.opentelemetry.io/collector/receiver/scraper/scraperhelper", m.name) } else { require.Fail(t, "returned Meter not mockMeter") } tracer := Tracer(set) if m, ok := tracer.(mockTracer); ok { - require.Equal(t, "go.opentelemetry.io/collector/receiver/scraperhelper", m.name) + require.Equal(t, "go.opentelemetry.io/collector/receiver/scraper/scraperhelper", m.name) } else { require.Fail(t, "returned Meter not mockTracer") } diff --git a/receiver/scraperhelper/metadata.yaml b/receiver/scraper/scraperhelper/metadata.yaml similarity index 100% rename from receiver/scraperhelper/metadata.yaml rename to receiver/scraper/scraperhelper/metadata.yaml diff --git a/receiver/scraperhelper/obsreport.go b/receiver/scraper/scraperhelper/obsreport.go similarity index 94% rename from receiver/scraperhelper/obsreport.go rename to receiver/scraper/scraperhelper/obsreport.go index 2b96eecbe8a..8442da147c1 100644 --- a/receiver/scraperhelper/obsreport.go +++ b/receiver/scraper/scraperhelper/obsreport.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package scraperhelper // import "go.opentelemetry.io/collector/receiver/scraperhelper" +package scraperhelper // import "go.opentelemetry.io/collector/receiver/scraper/scraperhelper" import ( "context" @@ -16,8 +16,8 @@ import ( "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/internal" - "go.opentelemetry.io/collector/receiver/scrapererror" - "go.opentelemetry.io/collector/receiver/scraperhelper/internal/metadata" + "go.opentelemetry.io/collector/receiver/scraper/scrapererror" + "go.opentelemetry.io/collector/receiver/scraper/scraperhelper/internal/metadata" ) // obsReport is a helper to add observability to a scraper. diff --git a/receiver/scraperhelper/obsreport_test.go b/receiver/scraper/scraperhelper/obsreport_test.go similarity index 98% rename from receiver/scraperhelper/obsreport_test.go rename to receiver/scraper/scraperhelper/obsreport_test.go index 2240ce2eff6..46a9d9545eb 100644 --- a/receiver/scraperhelper/obsreport_test.go +++ b/receiver/scraper/scraperhelper/obsreport_test.go @@ -17,7 +17,7 @@ import ( "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/internal" - "go.opentelemetry.io/collector/receiver/scrapererror" + "go.opentelemetry.io/collector/receiver/scraper/scrapererror" ) var ( diff --git a/receiver/scraperhelper/scraper.go b/receiver/scraper/scraperhelper/scraper.go similarity index 98% rename from receiver/scraperhelper/scraper.go rename to receiver/scraper/scraperhelper/scraper.go index aa335af87f6..eb94ede2d1e 100644 --- a/receiver/scraperhelper/scraper.go +++ b/receiver/scraper/scraperhelper/scraper.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package scraperhelper // import "go.opentelemetry.io/collector/receiver/scraperhelper" +package scraperhelper // import "go.opentelemetry.io/collector/receiver/scraper/scraperhelper" import ( "context" diff --git a/receiver/scraperhelper/scrapercontroller.go b/receiver/scraper/scraperhelper/scrapercontroller.go similarity index 98% rename from receiver/scraperhelper/scrapercontroller.go rename to receiver/scraper/scraperhelper/scrapercontroller.go index ecd3e4ff01f..a8e76ee6b45 100644 --- a/receiver/scraperhelper/scrapercontroller.go +++ b/receiver/scraper/scraperhelper/scrapercontroller.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package scraperhelper // import "go.opentelemetry.io/collector/receiver/scraperhelper" +package scraperhelper // import "go.opentelemetry.io/collector/receiver/scraper/scraperhelper" import ( "context" @@ -16,7 +16,7 @@ import ( "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receiverhelper" - "go.opentelemetry.io/collector/receiver/scrapererror" + "go.opentelemetry.io/collector/receiver/scraper/scrapererror" ) // ScraperControllerOption apply changes to internal options. diff --git a/receiver/scraperhelper/scrapercontroller_test.go b/receiver/scraper/scraperhelper/scrapercontroller_test.go similarity index 99% rename from receiver/scraperhelper/scrapercontroller_test.go rename to receiver/scraper/scraperhelper/scrapercontroller_test.go index 7d9fc8101e2..a276c0476d3 100644 --- a/receiver/scraperhelper/scrapercontroller_test.go +++ b/receiver/scraper/scraperhelper/scrapercontroller_test.go @@ -21,7 +21,7 @@ import ( "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - "go.opentelemetry.io/collector/receiver/scrapererror" + "go.opentelemetry.io/collector/receiver/scraper/scrapererror" ) type testInitialize struct { diff --git a/receiver/scrapererror/aliases.go b/receiver/scrapererror/aliases.go new file mode 100644 index 00000000000..079e1fb019b --- /dev/null +++ b/receiver/scrapererror/aliases.go @@ -0,0 +1,21 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Package scrapererror provides aliases only for go.opentelemetry.io/receiver/scraper/scrapererror +// It will be deleted in a future version. +package scrapererror // import "go.opentelemetry.io/collector/receiver/scrapererror" + +import "go.opentelemetry.io/collector/receiver/scraper/scrapererror" + +type ( + ScrapeErrors = scrapererror.ScrapeErrors + PartialScrapeError = scrapererror.PartialScrapeError +) + +var ( + AddPartial = (*ScrapeErrors).AddPartial + Add = (*ScrapeErrors).Add + Combine = (*ScrapeErrors).Combine + NewPartialScrapeError = scrapererror.NewPartialScrapeError + IsPartialScrapeError = scrapererror.IsPartialScrapeError +) diff --git a/receiver/scraperhelper/aliases.go b/receiver/scraperhelper/aliases.go new file mode 100644 index 00000000000..2f700cd671c --- /dev/null +++ b/receiver/scraperhelper/aliases.go @@ -0,0 +1,28 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Package scraperhelper provides aliases only for go.opentelemetry.io/receiver/scraper/scraperhelper +// It will be deleted in a future version. +package scraperhelper // import "go.opentelemetry.io/collector/receiver/scraperhelper" + +import "go.opentelemetry.io/collector/receiver/scraper/scraperhelper" + +type ( + ControllerConfig = scraperhelper.ControllerConfig + ScrapeFunc = scraperhelper.ScrapeFunc + Scraper = scraperhelper.Scraper + ScraperOption = scraperhelper.ScraperOption + ScraperControllerOption = scraperhelper.ScraperControllerOption +) + +var ( + NewDefaultControllerConfig = scraperhelper.NewDefaultControllerConfig + Validate = (*ControllerConfig).Validate + Scrape = (ScrapeFunc).Scrape + WithStart = scraperhelper.WithStart + WithShutdown = scraperhelper.WithShutdown + NewScraper = scraperhelper.NewScraper + AddScraper = scraperhelper.AddScraper + WithTickerChannel = scraperhelper.WithTickerChannel + NewScraperControllerReceiver = scraperhelper.NewScraperControllerReceiver +) diff --git a/service/go.mod b/service/go.mod index cb593cb4949..232ec1ee03d 100644 --- a/service/go.mod +++ b/service/go.mod @@ -193,6 +193,8 @@ replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../receiver/r replace go.opentelemetry.io/collector/receiver/receivertest => ../receiver/receivertest +replace go.opentelemetry.io/collector/receiver/scraper => ../receiver/scraper + replace go.opentelemetry.io/collector/processor/processorprofiles => ../processor/processorprofiles replace go.opentelemetry.io/collector/exporter/exporterprofiles => ../exporter/exporterprofiles diff --git a/versions.yaml b/versions.yaml index ece13add002..473902e9252 100644 --- a/versions.yaml +++ b/versions.yaml @@ -76,6 +76,7 @@ module-sets: - go.opentelemetry.io/collector/receiver/otlpreceiver - go.opentelemetry.io/collector/receiver/receiverprofiles - go.opentelemetry.io/collector/receiver/receivertest + - go.opentelemetry.io/collector/receiver/scraper - go.opentelemetry.io/collector/semconv - go.opentelemetry.io/collector/service - go.opentelemetry.io/collector/filter