Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create receiver/scraper module and migrate helper/error modules #11595

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .chloggen/migrate-scrapererror.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: 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]
25 changes: 25 additions & 0 deletions .chloggen/migrate-scraperhelper.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: 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]
25 changes: 25 additions & 0 deletions .chloggen/receiver-scraper-module.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: 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]
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions cmd/builder/internal/builder/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ var (
"/receiver/otlpreceiver",
"/receiver/receiverprofiles",
"/receiver/receivertest",
"/receiver/scraper",
"/pdata",
"/pdata/testdata",
"/pdata/pprofile",
Expand Down
1 change: 1 addition & 0 deletions cmd/builder/test/core.builder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions cmd/mdatagen/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions cmd/otelcorecol/builder-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions cmd/otelcorecol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions exporter/debugexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions exporter/exporterhelper/exporterhelperprofiles/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions exporter/exporterprofiles/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions exporter/exportertest/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions exporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions exporter/nopexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions exporter/otlpexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions exporter/otlphttpexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions internal/e2e/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions otelcol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions otelcol/otelcoltest/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions receiver/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions receiver/nopreceiver/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions receiver/otlpreceiver/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions receiver/receiverprofiles/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions receiver/receivertest/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions receiver/scraper/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../Makefile.Common
5 changes: 5 additions & 0 deletions receiver/scraper/doc.go
Original file line number Diff line number Diff line change
@@ -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"
67 changes: 67 additions & 0 deletions receiver/scraper/go.mod
Original file line number Diff line number Diff line change
@@ -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
Loading
Loading