diff --git a/.chloggen/rm-dep-receiver-scrapererror.yaml b/.chloggen/rm-dep-receiver-scrapererror.yaml new file mode 100644 index 00000000000..24b610f5c14 --- /dev/null +++ b/.chloggen/rm-dep-receiver-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: deprecation + +# 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: Move receiver/scrapererror package to scraper/scrapererror and deprecate original receiver/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: + +# 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/receiver/scrapererror/aliases.go b/receiver/scrapererror/aliases.go new file mode 100644 index 00000000000..c260d26e8b6 --- /dev/null +++ b/receiver/scrapererror/aliases.go @@ -0,0 +1,24 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Package scrapererror provides aliases for package scraper/scrapererror. +// Deprecated: [v0.115.0] Use `scraper/scrapererror` instead. +package scrapererror // import "go.opentelemetry.io/collector/receiver/scrapererror" + +import "go.opentelemetry.io/collector/scraper/scrapererror" + +type ( + ScrapeErrors = scrapererror.ScrapeErrors + PartialScrapeError = scrapererror.PartialScrapeError +) + +var ( + AddPartial = (*ScrapeErrors).AddPartial + Add = (*ScrapeErrors).Add + Combine = (*ScrapeErrors).Combine +) + +var ( + NewPartialScrapeError = scrapererror.NewPartialScrapeError + IsPartialScrapeError = scrapererror.IsPartialScrapeError +) diff --git a/receiver/scraperhelper/obs_metrics.go b/receiver/scraperhelper/obs_metrics.go index 3f7fac385a4..7523ecd6c09 100644 --- a/receiver/scraperhelper/obs_metrics.go +++ b/receiver/scraperhelper/obs_metrics.go @@ -16,9 +16,9 @@ import ( "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/receiver/internal" - "go.opentelemetry.io/collector/receiver/scrapererror" "go.opentelemetry.io/collector/receiver/scraperhelper/internal/metadata" "go.opentelemetry.io/collector/scraper" + "go.opentelemetry.io/collector/scraper/scrapererror" ) const ( diff --git a/receiver/scraperhelper/obs_metrics_test.go b/receiver/scraperhelper/obs_metrics_test.go index da1be18100b..074007a28e2 100644 --- a/receiver/scraperhelper/obs_metrics_test.go +++ b/receiver/scraperhelper/obs_metrics_test.go @@ -17,8 +17,8 @@ import ( "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/testdata" - "go.opentelemetry.io/collector/receiver/scrapererror" "go.opentelemetry.io/collector/scraper" + "go.opentelemetry.io/collector/scraper/scrapererror" ) var ( diff --git a/receiver/scraperhelper/scrapercontroller.go b/receiver/scraperhelper/scrapercontroller.go index 1facf467229..4236792b270 100644 --- a/receiver/scraperhelper/scrapercontroller.go +++ b/receiver/scraperhelper/scrapercontroller.go @@ -16,8 +16,8 @@ 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/scraper" + "go.opentelemetry.io/collector/scraper/scrapererror" ) // ScraperControllerOption apply changes to internal options. diff --git a/receiver/scraperhelper/scrapercontroller_test.go b/receiver/scraperhelper/scrapercontroller_test.go index 4115eb2ff6d..24285912143 100644 --- a/receiver/scraperhelper/scrapercontroller_test.go +++ b/receiver/scraperhelper/scrapercontroller_test.go @@ -21,8 +21,8 @@ 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/scraper" + "go.opentelemetry.io/collector/scraper/scrapererror" ) type testInitialize struct { diff --git a/scraper/go.mod b/scraper/go.mod index c63cce76712..dbd7b6380e1 100644 --- a/scraper/go.mod +++ b/scraper/go.mod @@ -9,6 +9,7 @@ require ( go.opentelemetry.io/collector/pdata v1.20.0 go.opentelemetry.io/collector/pipeline v0.114.0 go.uber.org/goleak v1.3.0 + go.uber.org/multierr v1.11.0 ) require ( @@ -27,7 +28,6 @@ require ( 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.28.0 // indirect golang.org/x/sys v0.27.0 // indirect diff --git a/receiver/scrapererror/doc.go b/scraper/scrapererror/doc.go similarity index 63% rename from receiver/scrapererror/doc.go rename to scraper/scrapererror/doc.go index c893f0f8e89..59f9560d70b 100644 --- a/receiver/scrapererror/doc.go +++ b/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/scraper/scrapererror" diff --git a/receiver/scrapererror/package_test.go b/scraper/scrapererror/package_test.go similarity index 100% rename from receiver/scrapererror/package_test.go rename to scraper/scrapererror/package_test.go diff --git a/receiver/scrapererror/partialscrapeerror.go b/scraper/scrapererror/partialscrapeerror.go similarity index 89% rename from receiver/scrapererror/partialscrapeerror.go rename to scraper/scrapererror/partialscrapeerror.go index cb4c03bab80..21dfce899fb 100644 --- a/receiver/scrapererror/partialscrapeerror.go +++ b/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/scraper/scrapererror" import "errors" diff --git a/receiver/scrapererror/partialscrapeerror_test.go b/scraper/scrapererror/partialscrapeerror_test.go similarity index 100% rename from receiver/scrapererror/partialscrapeerror_test.go rename to scraper/scrapererror/partialscrapeerror_test.go diff --git a/receiver/scrapererror/scrapeerror.go b/scraper/scrapererror/scrapeerror.go similarity index 92% rename from receiver/scrapererror/scrapeerror.go rename to scraper/scrapererror/scrapeerror.go index 9c1b4b08a20..a73fb6aa069 100644 --- a/receiver/scrapererror/scrapeerror.go +++ b/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/scraper/scrapererror" import ( "go.uber.org/multierr" diff --git a/receiver/scrapererror/scrapeerror_test.go b/scraper/scrapererror/scrapeerror_test.go similarity index 100% rename from receiver/scrapererror/scrapeerror_test.go rename to scraper/scrapererror/scrapeerror_test.go