From a4028e741c7cba921d1edda861748b3bc89adfa0 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Thu, 26 Dec 2024 13:19:06 -0800 Subject: [PATCH] Move scraperhelper under scraper in a separate module Signed-off-by: Bogdan Drutu --- .chloggen/mv-scraper-helper.yaml | 25 +++++ cmd/builder/internal/builder/main_test.go | 7 +- cmd/builder/test/core.builder.yaml | 1 + cmd/mdatagen/go.mod | 4 +- cmd/mdatagen/go.sum | 4 +- cmd/otelcorecol/builder-config.yaml | 1 + cmd/otelcorecol/go.mod | 2 + exporter/debugexporter/go.mod | 4 +- exporter/debugexporter/go.sum | 4 +- .../exporterhelper/xexporterhelper/go.mod | 4 +- .../exporterhelper/xexporterhelper/go.sum | 4 +- exporter/exportertest/go.mod | 4 +- exporter/exportertest/go.sum | 4 +- exporter/go.mod | 4 +- exporter/go.sum | 4 +- exporter/nopexporter/go.mod | 4 +- exporter/nopexporter/go.sum | 4 +- exporter/otlpexporter/go.mod | 4 +- exporter/otlpexporter/go.sum | 4 +- exporter/otlphttpexporter/go.mod | 4 +- exporter/otlphttpexporter/go.sum | 4 +- exporter/xexporter/go.mod | 4 +- exporter/xexporter/go.sum | 4 +- internal/e2e/go.mod | 2 + otelcol/go.mod | 2 + otelcol/otelcoltest/go.mod | 2 + receiver/go.mod | 16 +-- receiver/go.sum | 4 +- receiver/nopreceiver/go.mod | 4 +- receiver/nopreceiver/go.sum | 4 +- receiver/otlpreceiver/go.mod | 4 +- receiver/otlpreceiver/go.sum | 4 +- .../receiverhelper/internal/obsmetrics.go | 37 +++++++ receiver/receiverhelper/obsreport.go | 2 +- receiver/receiverhelper/obsreport_test.go | 2 +- receiver/receivertest/go.mod | 4 +- receiver/receivertest/go.sum | 4 +- receiver/scraperhelper/alias.go | 27 +++++ receiver/xreceiver/go.mod | 4 +- receiver/xreceiver/go.sum | 4 +- scraper/scraperhelper/Makefile | 1 + {receiver => scraper}/scraperhelper/config.go | 2 +- .../scraperhelper/config_test.go | 0 {receiver => scraper}/scraperhelper/doc.go | 2 +- .../scraperhelper/documentation.md | 0 .../generated_component_telemetry_test.go | 0 .../scraperhelper/generated_package_test.go | 0 scraper/scraperhelper/go.mod | 79 +++++++++++++++ scraper/scraperhelper/go.sum | 98 +++++++++++++++++++ .../internal/metadata/generated_telemetry.go | 4 +- .../metadata/generated_telemetry_test.go | 4 +- .../scraperhelper/metadata.yaml | 0 .../scraperhelper/obs_metrics.go | 17 ++-- .../scraperhelper/obs_metrics_test.go | 0 .../scraperhelper/scrapercontroller.go | 2 +- .../scraperhelper/scrapercontroller_test.go | 0 service/go.mod | 2 + versions.yaml | 1 + 58 files changed, 380 insertions(+), 66 deletions(-) create mode 100644 .chloggen/mv-scraper-helper.yaml create mode 100644 receiver/receiverhelper/internal/obsmetrics.go create mode 100644 receiver/scraperhelper/alias.go create mode 100644 scraper/scraperhelper/Makefile rename {receiver => scraper}/scraperhelper/config.go (94%) rename {receiver => scraper}/scraperhelper/config_test.go (100%) rename {receiver => scraper}/scraperhelper/doc.go (66%) rename {receiver => scraper}/scraperhelper/documentation.md (100%) rename {receiver => scraper}/scraperhelper/generated_component_telemetry_test.go (100%) rename {receiver => scraper}/scraperhelper/generated_package_test.go (100%) create mode 100644 scraper/scraperhelper/go.mod create mode 100644 scraper/scraperhelper/go.sum rename {receiver => scraper}/scraperhelper/internal/metadata/generated_telemetry.go (97%) rename {receiver => scraper}/scraperhelper/internal/metadata/generated_telemetry_test.go (91%) rename {receiver => scraper}/scraperhelper/metadata.yaml (100%) rename {receiver => scraper}/scraperhelper/obs_metrics.go (80%) rename {receiver => scraper}/scraperhelper/obs_metrics_test.go (100%) rename {receiver => scraper}/scraperhelper/scrapercontroller.go (98%) rename {receiver => scraper}/scraperhelper/scrapercontroller_test.go (100%) diff --git a/.chloggen/mv-scraper-helper.yaml b/.chloggen/mv-scraper-helper.yaml new file mode 100644 index 00000000000..729191220d4 --- /dev/null +++ b/.chloggen/mv-scraper-helper.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: scraperhelper + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Move scraperhelper under scraper and in a separate module. + +# 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/cmd/builder/internal/builder/main_test.go b/cmd/builder/internal/builder/main_test.go index 8220e48df85..6b43e7a7663 100644 --- a/cmd/builder/internal/builder/main_test.go +++ b/cmd/builder/internal/builder/main_test.go @@ -86,6 +86,9 @@ var replaceModules = []string{ "/internal/fanoutconsumer", "/internal/sharedcomponent", "/otelcol", + "/pdata", + "/pdata/testdata", + "/pdata/pprofile", "/pipeline", "/pipeline/xpipeline", "/processor", @@ -98,9 +101,7 @@ var replaceModules = []string{ "/receiver/otlpreceiver", "/receiver/receivertest", "/receiver/xreceiver", - "/pdata", - "/pdata/testdata", - "/pdata/pprofile", + "/scraper/scraperhelper", "/scraper", "/semconv", "/service", diff --git a/cmd/builder/test/core.builder.yaml b/cmd/builder/test/core.builder.yaml index 39c89d687b7..4edaaee729d 100644 --- a/cmd/builder/test/core.builder.yaml +++ b/cmd/builder/test/core.builder.yaml @@ -72,5 +72,6 @@ replaces: - go.opentelemetry.io/collector/receiver/xreceiver => ${WORKSPACE_DIR}/receiver/xreceiver - go.opentelemetry.io/collector/receiver/receivertest => ${WORKSPACE_DIR}/receiver/receivertest - go.opentelemetry.io/collector/scraper => ${WORKSPACE_DIR}/scraper + - go.opentelemetry.io/collector/scraper/scraperhelper => ${WORKSPACE_DIR}/scraper/scraperhelper - 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 3196625f13d..c24893368d9 100644 --- a/cmd/mdatagen/go.mod +++ b/cmd/mdatagen/go.mod @@ -59,7 +59,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.33.0 // indirect golang.org/x/sys v0.28.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect google.golang.org/protobuf v1.36.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -116,3 +116,5 @@ replace go.opentelemetry.io/collector/processor => ../../processor replace go.opentelemetry.io/collector/consumer/consumererror => ../../consumer/consumererror replace go.opentelemetry.io/collector/scraper => ../../scraper + +replace go.opentelemetry.io/collector/scraper/scraperhelper => ../../scraper/scraperhelper diff --git a/cmd/mdatagen/go.sum b/cmd/mdatagen/go.sum index 1f2268d9e99..20d8c00b9ec 100644 --- a/cmd/mdatagen/go.sum +++ b/cmd/mdatagen/go.sum @@ -105,8 +105,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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-20241015192408-796eee8c2d53 h1:X58yt85/IXCx0Y3ZwN6sEIKZzQtDEYaBWrDvErdXrRE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= diff --git a/cmd/otelcorecol/builder-config.yaml b/cmd/otelcorecol/builder-config.yaml index 02ce3a8c934..d8bcdce1db9 100644 --- a/cmd/otelcorecol/builder-config.yaml +++ b/cmd/otelcorecol/builder-config.yaml @@ -103,5 +103,6 @@ replaces: - go.opentelemetry.io/collector/receiver/receivertest => ../../receiver/receivertest - go.opentelemetry.io/collector/receiver/xreceiver => ../../receiver/xreceiver - go.opentelemetry.io/collector/scraper => ../../scraper + - go.opentelemetry.io/collector/scraper/scraperhelper => ../../scraper/scraperhelper - 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 0ec5f4fab62..5495300dcad 100644 --- a/cmd/otelcorecol/go.mod +++ b/cmd/otelcorecol/go.mod @@ -290,6 +290,8 @@ replace go.opentelemetry.io/collector/receiver/xreceiver => ../../receiver/xrece replace go.opentelemetry.io/collector/scraper => ../../scraper +replace go.opentelemetry.io/collector/scraper/scraperhelper => ../../scraper/scraperhelper + 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 7c9c21fd090..99a011d4cbf 100644 --- a/exporter/debugexporter/go.mod +++ b/exporter/debugexporter/go.mod @@ -60,7 +60,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.33.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/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect google.golang.org/protobuf v1.36.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -119,3 +119,5 @@ replace go.opentelemetry.io/collector/extension/extensiontest => ../../extension replace go.opentelemetry.io/collector/scraper => ../../scraper replace go.opentelemetry.io/collector/featuregate => ../../featuregate + +replace go.opentelemetry.io/collector/scraper/scraperhelper => ../../scraper/scraperhelper diff --git a/exporter/debugexporter/go.sum b/exporter/debugexporter/go.sum index 390bec10dc4..d2ad1a8c99f 100644 --- a/exporter/debugexporter/go.sum +++ b/exporter/debugexporter/go.sum @@ -101,8 +101,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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-20241015192408-796eee8c2d53 h1:X58yt85/IXCx0Y3ZwN6sEIKZzQtDEYaBWrDvErdXrRE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= diff --git a/exporter/exporterhelper/xexporterhelper/go.mod b/exporter/exporterhelper/xexporterhelper/go.mod index 2101aaa6b1f..ed7e997feda 100644 --- a/exporter/exporterhelper/xexporterhelper/go.mod +++ b/exporter/exporterhelper/xexporterhelper/go.mod @@ -51,7 +51,7 @@ require ( 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/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect google.golang.org/protobuf v1.36.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -106,3 +106,5 @@ replace go.opentelemetry.io/collector/extension/extensiontest => ../../../extens replace go.opentelemetry.io/collector/scraper => ../../../scraper replace go.opentelemetry.io/collector/featuregate => ../../../featuregate + +replace go.opentelemetry.io/collector/scraper/scraperhelper => ../../../scraper/scraperhelper diff --git a/exporter/exporterhelper/xexporterhelper/go.sum b/exporter/exporterhelper/xexporterhelper/go.sum index 96171eca8b5..2156ac16908 100644 --- a/exporter/exporterhelper/xexporterhelper/go.sum +++ b/exporter/exporterhelper/xexporterhelper/go.sum @@ -89,8 +89,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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-20241015192408-796eee8c2d53 h1:X58yt85/IXCx0Y3ZwN6sEIKZzQtDEYaBWrDvErdXrRE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= diff --git a/exporter/exportertest/go.mod b/exporter/exportertest/go.mod index 72bc7863a0b..b7e4c480fa1 100644 --- a/exporter/exportertest/go.mod +++ b/exporter/exportertest/go.mod @@ -48,7 +48,7 @@ require ( 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/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/protobuf v1.36.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -96,3 +96,5 @@ replace go.opentelemetry.io/collector/extension/extensiontest => ../../extension replace go.opentelemetry.io/collector/scraper => ../../scraper replace go.opentelemetry.io/collector/featuregate => ../../featuregate + +replace go.opentelemetry.io/collector/scraper/scraperhelper => ../../scraper/scraperhelper diff --git a/exporter/exportertest/go.sum b/exporter/exportertest/go.sum index 96171eca8b5..2156ac16908 100644 --- a/exporter/exportertest/go.sum +++ b/exporter/exportertest/go.sum @@ -89,8 +89,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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-20241015192408-796eee8c2d53 h1:X58yt85/IXCx0Y3ZwN6sEIKZzQtDEYaBWrDvErdXrRE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= diff --git a/exporter/go.mod b/exporter/go.mod index 7b23c80fd1c..1a42ceacbc6 100644 --- a/exporter/go.mod +++ b/exporter/go.mod @@ -50,7 +50,7 @@ require ( 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/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect google.golang.org/protobuf v1.36.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -101,3 +101,5 @@ replace go.opentelemetry.io/collector/extension/extensiontest => ../extension/ex replace go.opentelemetry.io/collector/scraper => ../scraper replace go.opentelemetry.io/collector/featuregate => ../featuregate + +replace go.opentelemetry.io/collector/scraper/scraperhelper => ../scraper/scraperhelper diff --git a/exporter/go.sum b/exporter/go.sum index 96171eca8b5..2156ac16908 100644 --- a/exporter/go.sum +++ b/exporter/go.sum @@ -89,8 +89,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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-20241015192408-796eee8c2d53 h1:X58yt85/IXCx0Y3ZwN6sEIKZzQtDEYaBWrDvErdXrRE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= diff --git a/exporter/nopexporter/go.mod b/exporter/nopexporter/go.mod index 5cd50fd96f9..f0b406028e1 100644 --- a/exporter/nopexporter/go.mod +++ b/exporter/nopexporter/go.mod @@ -50,7 +50,7 @@ require ( 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/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect google.golang.org/protobuf v1.36.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -103,3 +103,5 @@ replace go.opentelemetry.io/collector/extension/extensiontest => ../../extension replace go.opentelemetry.io/collector/scraper => ../../scraper replace go.opentelemetry.io/collector/featuregate => ../../featuregate + +replace go.opentelemetry.io/collector/scraper/scraperhelper => ../../scraper/scraperhelper diff --git a/exporter/nopexporter/go.sum b/exporter/nopexporter/go.sum index 390bec10dc4..d2ad1a8c99f 100644 --- a/exporter/nopexporter/go.sum +++ b/exporter/nopexporter/go.sum @@ -101,8 +101,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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-20241015192408-796eee8c2d53 h1:X58yt85/IXCx0Y3ZwN6sEIKZzQtDEYaBWrDvErdXrRE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= diff --git a/exporter/otlpexporter/go.mod b/exporter/otlpexporter/go.mod index 1e09775c971..cb83f78ca69 100644 --- a/exporter/otlpexporter/go.mod +++ b/exporter/otlpexporter/go.mod @@ -25,7 +25,7 @@ require ( go.opentelemetry.io/collector/pdata/testdata v0.116.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 - google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 + google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 google.golang.org/grpc v1.69.2 google.golang.org/protobuf v1.36.1 ) @@ -158,3 +158,5 @@ replace go.opentelemetry.io/collector/extension/auth/authtest => ../../extension replace go.opentelemetry.io/collector/scraper => ../../scraper replace go.opentelemetry.io/collector/featuregate => ../../featuregate + +replace go.opentelemetry.io/collector/scraper/scraperhelper => ../../scraper/scraperhelper diff --git a/exporter/otlpexporter/go.sum b/exporter/otlpexporter/go.sum index 3e6bf93a265..de3451e2cc1 100644 --- a/exporter/otlpexporter/go.sum +++ b/exporter/otlpexporter/go.sum @@ -111,8 +111,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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-20241015192408-796eee8c2d53 h1:X58yt85/IXCx0Y3ZwN6sEIKZzQtDEYaBWrDvErdXrRE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= diff --git a/exporter/otlphttpexporter/go.mod b/exporter/otlphttpexporter/go.mod index 0a4830a8740..70597d989fe 100644 --- a/exporter/otlphttpexporter/go.mod +++ b/exporter/otlphttpexporter/go.mod @@ -23,7 +23,7 @@ require ( go.opentelemetry.io/collector/pdata/pprofile v0.116.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 - google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 + google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 google.golang.org/grpc v1.69.2 google.golang.org/protobuf v1.36.1 ) @@ -156,3 +156,5 @@ replace go.opentelemetry.io/collector/extension/auth/authtest => ../../extension replace go.opentelemetry.io/collector/scraper => ../../scraper replace go.opentelemetry.io/collector/featuregate => ../../featuregate + +replace go.opentelemetry.io/collector/scraper/scraperhelper => ../../scraper/scraperhelper diff --git a/exporter/otlphttpexporter/go.sum b/exporter/otlphttpexporter/go.sum index e691f89e95d..5a364b1679f 100644 --- a/exporter/otlphttpexporter/go.sum +++ b/exporter/otlphttpexporter/go.sum @@ -115,8 +115,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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-20241015192408-796eee8c2d53 h1:X58yt85/IXCx0Y3ZwN6sEIKZzQtDEYaBWrDvErdXrRE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= diff --git a/exporter/xexporter/go.mod b/exporter/xexporter/go.mod index 0609a8465d6..5587aa0d6fb 100644 --- a/exporter/xexporter/go.mod +++ b/exporter/xexporter/go.mod @@ -30,7 +30,7 @@ require ( 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/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect google.golang.org/protobuf v1.36.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -79,3 +79,5 @@ replace go.opentelemetry.io/collector/extension/extensiontest => ../../extension replace go.opentelemetry.io/collector/scraper => ../../scraper replace go.opentelemetry.io/collector/featuregate => ../../featuregate + +replace go.opentelemetry.io/collector/scraper/scraperhelper => ../../scraper/scraperhelper diff --git a/exporter/xexporter/go.sum b/exporter/xexporter/go.sum index b3cdcf610ed..42e734421b2 100644 --- a/exporter/xexporter/go.sum +++ b/exporter/xexporter/go.sum @@ -84,8 +84,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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-20241015192408-796eee8c2d53 h1:X58yt85/IXCx0Y3ZwN6sEIKZzQtDEYaBWrDvErdXrRE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= diff --git a/internal/e2e/go.mod b/internal/e2e/go.mod index 210e37a2736..f11d664a496 100644 --- a/internal/e2e/go.mod +++ b/internal/e2e/go.mod @@ -242,3 +242,5 @@ replace go.opentelemetry.io/collector/extension/extensiontest => ../../extension replace go.opentelemetry.io/collector/extension/auth/authtest => ../../extension/auth/authtest replace go.opentelemetry.io/collector/scraper => ../../scraper + +replace go.opentelemetry.io/collector/scraper/scraperhelper => ../../scraper/scraperhelper diff --git a/otelcol/go.mod b/otelcol/go.mod index 73819429cdf..15c6e8495ff 100644 --- a/otelcol/go.mod +++ b/otelcol/go.mod @@ -204,3 +204,5 @@ replace go.opentelemetry.io/collector/extension/extensiontest => ../extension/ex replace go.opentelemetry.io/collector/extension/auth/authtest => ../extension/auth/authtest replace go.opentelemetry.io/collector/scraper => ../scraper + +replace go.opentelemetry.io/collector/scraper/scraperhelper => ../scraper/scraperhelper diff --git a/otelcol/otelcoltest/go.mod b/otelcol/otelcoltest/go.mod index 1b51d17f2ce..6179800a73b 100644 --- a/otelcol/otelcoltest/go.mod +++ b/otelcol/otelcoltest/go.mod @@ -219,3 +219,5 @@ replace go.opentelemetry.io/collector/extension/extensiontest => ../../extension replace go.opentelemetry.io/collector/extension/auth/authtest => ../../extension/auth/authtest replace go.opentelemetry.io/collector/scraper => ../../scraper + +replace go.opentelemetry.io/collector/scraper/scraperhelper => ../../scraper/scraperhelper diff --git a/receiver/go.mod b/receiver/go.mod index 503556ea865..ff842808002 100644 --- a/receiver/go.mod +++ b/receiver/go.mod @@ -9,19 +9,14 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.116.0 go.opentelemetry.io/collector/consumer v1.22.0 go.opentelemetry.io/collector/consumer/consumertest v0.116.0 - go.opentelemetry.io/collector/pdata v1.22.0 - go.opentelemetry.io/collector/pdata/testdata v0.116.0 go.opentelemetry.io/collector/pipeline v0.116.0 go.opentelemetry.io/collector/receiver/receivertest v0.116.0 - go.opentelemetry.io/collector/scraper v0.116.0 + go.opentelemetry.io/collector/scraper/scraperhelper v0.116.0 go.opentelemetry.io/otel v1.32.0 go.opentelemetry.io/otel/metric v1.32.0 - go.opentelemetry.io/otel/sdk v1.32.0 go.opentelemetry.io/otel/sdk/metric v1.32.0 go.opentelemetry.io/otel/trace v1.32.0 go.uber.org/goleak v1.3.0 - go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.27.0 ) require ( @@ -36,12 +31,17 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect go.opentelemetry.io/collector/consumer/consumererror v0.116.0 // indirect go.opentelemetry.io/collector/consumer/xconsumer v0.116.0 // indirect + go.opentelemetry.io/collector/pdata v1.22.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.116.0 // indirect go.opentelemetry.io/collector/receiver/xreceiver v0.116.0 // indirect + go.opentelemetry.io/collector/scraper v0.116.0 // indirect + go.opentelemetry.io/otel/sdk 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/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect google.golang.org/protobuf v1.36.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -76,3 +76,5 @@ replace go.opentelemetry.io/collector/pipeline => ../pipeline replace go.opentelemetry.io/collector/consumer/consumererror => ../consumer/consumererror replace go.opentelemetry.io/collector/scraper => ../scraper + +replace go.opentelemetry.io/collector/scraper/scraperhelper => ../scraper/scraperhelper diff --git a/receiver/go.sum b/receiver/go.sum index 5000e1a0947..6b60193626f 100644 --- a/receiver/go.sum +++ b/receiver/go.sum @@ -85,8 +85,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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-20241015192408-796eee8c2d53 h1:X58yt85/IXCx0Y3ZwN6sEIKZzQtDEYaBWrDvErdXrRE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= diff --git a/receiver/nopreceiver/go.mod b/receiver/nopreceiver/go.mod index 0bd0b1dc23c..65a392c5c89 100644 --- a/receiver/nopreceiver/go.mod +++ b/receiver/nopreceiver/go.mod @@ -47,7 +47,7 @@ require ( 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/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect google.golang.org/protobuf v1.36.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -84,3 +84,5 @@ replace go.opentelemetry.io/collector/pipeline => ../../pipeline replace go.opentelemetry.io/collector/consumer/consumererror => ../../consumer/consumererror replace go.opentelemetry.io/collector/scraper => ../../scraper + +replace go.opentelemetry.io/collector/scraper/scraperhelper => ../../scraper/scraperhelper diff --git a/receiver/nopreceiver/go.sum b/receiver/nopreceiver/go.sum index c8c0d4000c0..a39fba75124 100644 --- a/receiver/nopreceiver/go.sum +++ b/receiver/nopreceiver/go.sum @@ -97,8 +97,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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-20241015192408-796eee8c2d53 h1:X58yt85/IXCx0Y3ZwN6sEIKZzQtDEYaBWrDvErdXrRE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= diff --git a/receiver/otlpreceiver/go.mod b/receiver/otlpreceiver/go.mod index 35e7030a6af..9df629f2da0 100644 --- a/receiver/otlpreceiver/go.mod +++ b/receiver/otlpreceiver/go.mod @@ -29,7 +29,7 @@ require ( go.opentelemetry.io/collector/receiver/xreceiver v0.116.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 - google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 + google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 google.golang.org/grpc v1.69.2 google.golang.org/protobuf v1.36.1 ) @@ -140,3 +140,5 @@ retract ( replace go.opentelemetry.io/collector/extension/auth/authtest => ../../extension/auth/authtest replace go.opentelemetry.io/collector/scraper => ../../scraper + +replace go.opentelemetry.io/collector/scraper/scraperhelper => ../../scraper/scraperhelper diff --git a/receiver/otlpreceiver/go.sum b/receiver/otlpreceiver/go.sum index be0ac448bf8..57bddc41780 100644 --- a/receiver/otlpreceiver/go.sum +++ b/receiver/otlpreceiver/go.sum @@ -115,8 +115,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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-20241015192408-796eee8c2d53 h1:X58yt85/IXCx0Y3ZwN6sEIKZzQtDEYaBWrDvErdXrRE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= diff --git a/receiver/receiverhelper/internal/obsmetrics.go b/receiver/receiverhelper/internal/obsmetrics.go new file mode 100644 index 00000000000..3b90592b6b6 --- /dev/null +++ b/receiver/receiverhelper/internal/obsmetrics.go @@ -0,0 +1,37 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package internal // import "go.opentelemetry.io/collector/receiver/receiverhelper/internal" + +const ( + // SpanNameSep is duplicate between receiver and exporter. + SpanNameSep = "/" + + // ReceiverKey used to identify receivers in metrics and traces. + ReceiverKey = "receiver" + // TransportKey used to identify the transport used to received the data. + TransportKey = "transport" + // FormatKey used to identify the format of the data received. + FormatKey = "format" + + // AcceptedSpansKey used to identify spans accepted by the Collector. + AcceptedSpansKey = "accepted_spans" + // RefusedSpansKey used to identify spans refused (ie.: not ingested) by the Collector. + RefusedSpansKey = "refused_spans" + + // AcceptedMetricPointsKey used to identify metric points accepted by the Collector. + AcceptedMetricPointsKey = "accepted_metric_points" + // RefusedMetricPointsKey used to identify metric points refused (ie.: not ingested) by the + // Collector. + RefusedMetricPointsKey = "refused_metric_points" + + // AcceptedLogRecordsKey used to identify log records accepted by the Collector. + AcceptedLogRecordsKey = "accepted_log_records" + // RefusedLogRecordsKey used to identify log records refused (ie.: not ingested) by the + // Collector. + RefusedLogRecordsKey = "refused_log_records" + + ReceiveTraceDataOperationSuffix = SpanNameSep + "TraceDataReceived" + ReceiverMetricsOperationSuffix = SpanNameSep + "MetricsReceived" + ReceiverLogsOperationSuffix = SpanNameSep + "LogsReceived" +) diff --git a/receiver/receiverhelper/obsreport.go b/receiver/receiverhelper/obsreport.go index b30208deb36..e14af8a153b 100644 --- a/receiver/receiverhelper/obsreport.go +++ b/receiver/receiverhelper/obsreport.go @@ -16,7 +16,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/receiver" - "go.opentelemetry.io/collector/receiver/internal" + "go.opentelemetry.io/collector/receiver/receiverhelper/internal" "go.opentelemetry.io/collector/receiver/receiverhelper/internal/metadata" ) diff --git a/receiver/receiverhelper/obsreport_test.go b/receiver/receiverhelper/obsreport_test.go index 455fd16a8e9..b6ae6da7b68 100644 --- a/receiver/receiverhelper/obsreport_test.go +++ b/receiver/receiverhelper/obsreport_test.go @@ -16,7 +16,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/receiver" - "go.opentelemetry.io/collector/receiver/internal" + "go.opentelemetry.io/collector/receiver/receiverhelper/internal" ) const ( diff --git a/receiver/receivertest/go.mod b/receiver/receivertest/go.mod index 8ea5fc947ec..d0171663e55 100644 --- a/receiver/receivertest/go.mod +++ b/receiver/receivertest/go.mod @@ -39,7 +39,7 @@ require ( 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/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect google.golang.org/protobuf v1.36.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -72,3 +72,5 @@ replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest replace go.opentelemetry.io/collector/scraper => ../../scraper + +replace go.opentelemetry.io/collector/scraper/scraperhelper => ../../scraper/scraperhelper diff --git a/receiver/receivertest/go.sum b/receiver/receivertest/go.sum index 5000e1a0947..6b60193626f 100644 --- a/receiver/receivertest/go.sum +++ b/receiver/receivertest/go.sum @@ -85,8 +85,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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-20241015192408-796eee8c2d53 h1:X58yt85/IXCx0Y3ZwN6sEIKZzQtDEYaBWrDvErdXrRE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= diff --git a/receiver/scraperhelper/alias.go b/receiver/scraperhelper/alias.go new file mode 100644 index 00000000000..21357f6c8cf --- /dev/null +++ b/receiver/scraperhelper/alias.go @@ -0,0 +1,27 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Deprecated: [v0.117.0] import "go.opentelemetry.io/collector/scraper/scraperhelper" +package scraperhelper // import "go.opentelemetry.io/collector/receiver/scraperhelper" + +import ( + nsch "go.opentelemetry.io/collector/scraper/scraperhelper" +) + +// Deprecated: [v0.117.0] import "go.opentelemetry.io/collector/scraper/scraperhelper" +type ControllerConfig = nsch.ControllerConfig + +// Deprecated: [v0.117.0] import "go.opentelemetry.io/collector/scraper/scraperhelper" +var NewDefaultControllerConfig = nsch.NewDefaultControllerConfig + +// Deprecated: [v0.117.0] import "go.opentelemetry.io/collector/scraper/scraperhelper" +type ScraperControllerOption = nsch.ScraperControllerOption + +// Deprecated: [v0.117.0] import "go.opentelemetry.io/collector/scraper/scraperhelper" +var AddScraper = nsch.AddScraper + +// Deprecated: [v0.117.0] import "go.opentelemetry.io/collector/scraper/scraperhelper" +var WithTickerChannel = nsch.WithTickerChannel + +// Deprecated: [v0.117.0] import "go.opentelemetry.io/collector/scraper/scraperhelper" +var NewScraperControllerReceiver = nsch.NewScraperControllerReceiver diff --git a/receiver/xreceiver/go.mod b/receiver/xreceiver/go.mod index f829023945a..1661c152c6d 100644 --- a/receiver/xreceiver/go.mod +++ b/receiver/xreceiver/go.mod @@ -30,7 +30,7 @@ require ( 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/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect google.golang.org/protobuf v1.36.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -63,3 +63,5 @@ replace go.opentelemetry.io/collector/consumer/consumererror => ../../consumer/c replace go.opentelemetry.io/collector/receiver/receivertest => ../receivertest replace go.opentelemetry.io/collector/scraper => ../../scraper + +replace go.opentelemetry.io/collector/scraper/scraperhelper => ../../scraper/scraperhelper diff --git a/receiver/xreceiver/go.sum b/receiver/xreceiver/go.sum index b3cdcf610ed..42e734421b2 100644 --- a/receiver/xreceiver/go.sum +++ b/receiver/xreceiver/go.sum @@ -84,8 +84,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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-20241015192408-796eee8c2d53 h1:X58yt85/IXCx0Y3ZwN6sEIKZzQtDEYaBWrDvErdXrRE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= diff --git a/scraper/scraperhelper/Makefile b/scraper/scraperhelper/Makefile new file mode 100644 index 00000000000..ded7a36092d --- /dev/null +++ b/scraper/scraperhelper/Makefile @@ -0,0 +1 @@ +include ../../Makefile.Common diff --git a/receiver/scraperhelper/config.go b/scraper/scraperhelper/config.go similarity index 94% rename from receiver/scraperhelper/config.go rename to scraper/scraperhelper/config.go index 31f181aa908..4c70742bea2 100644 --- a/receiver/scraperhelper/config.go +++ b/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/scraper/scraperhelper" import ( "errors" diff --git a/receiver/scraperhelper/config_test.go b/scraper/scraperhelper/config_test.go similarity index 100% rename from receiver/scraperhelper/config_test.go rename to scraper/scraperhelper/config_test.go diff --git a/receiver/scraperhelper/doc.go b/scraper/scraperhelper/doc.go similarity index 66% rename from receiver/scraperhelper/doc.go rename to scraper/scraperhelper/doc.go index a1e5cb26f1d..c28478392c8 100644 --- a/receiver/scraperhelper/doc.go +++ b/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/scraper/scraperhelper" diff --git a/receiver/scraperhelper/documentation.md b/scraper/scraperhelper/documentation.md similarity index 100% rename from receiver/scraperhelper/documentation.md rename to scraper/scraperhelper/documentation.md diff --git a/receiver/scraperhelper/generated_component_telemetry_test.go b/scraper/scraperhelper/generated_component_telemetry_test.go similarity index 100% rename from receiver/scraperhelper/generated_component_telemetry_test.go rename to scraper/scraperhelper/generated_component_telemetry_test.go diff --git a/receiver/scraperhelper/generated_package_test.go b/scraper/scraperhelper/generated_package_test.go similarity index 100% rename from receiver/scraperhelper/generated_package_test.go rename to scraper/scraperhelper/generated_package_test.go diff --git a/scraper/scraperhelper/go.mod b/scraper/scraperhelper/go.mod new file mode 100644 index 00000000000..b1424f89b96 --- /dev/null +++ b/scraper/scraperhelper/go.mod @@ -0,0 +1,79 @@ +module go.opentelemetry.io/collector/scraper/scraperhelper + +go 1.22.0 + +require ( + github.com/stretchr/testify v1.10.0 + go.opentelemetry.io/collector/component v0.116.0 + go.opentelemetry.io/collector/component/componenttest v0.116.0 + go.opentelemetry.io/collector/config/configtelemetry v0.116.0 + go.opentelemetry.io/collector/consumer v1.22.0 + go.opentelemetry.io/collector/consumer/consumertest v0.116.0 + go.opentelemetry.io/collector/pdata v1.22.0 + go.opentelemetry.io/collector/pdata/testdata v0.116.0 + go.opentelemetry.io/collector/pipeline v0.116.0 + go.opentelemetry.io/collector/receiver v0.116.0 + go.opentelemetry.io/collector/receiver/receivertest v0.116.0 + go.opentelemetry.io/collector/scraper v0.116.0 + go.opentelemetry.io/otel v1.32.0 + go.opentelemetry.io/otel/metric v1.32.0 + go.opentelemetry.io/otel/sdk v1.32.0 + go.opentelemetry.io/otel/sdk/metric v1.32.0 + go.opentelemetry.io/otel/trace v1.32.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.116.0 // indirect + go.opentelemetry.io/collector/consumer/xconsumer v0.116.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.116.0 // indirect + go.opentelemetry.io/collector/receiver/xreceiver v0.116.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-20241104194629-dd2ea8efbc28 // indirect + google.golang.org/grpc v1.69.2 // indirect + google.golang.org/protobuf v1.36.1 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) + +replace go.opentelemetry.io/collector/scraper => ../ + +replace go.opentelemetry.io/collector/receiver => ../../receiver + +replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile + +replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry + +replace go.opentelemetry.io/collector/consumer/consumererror => ../../consumer/consumererror + +replace go.opentelemetry.io/collector/receiver/receivertest => ../../receiver/receivertest + +replace go.opentelemetry.io/collector/consumer => ../../consumer + +replace go.opentelemetry.io/collector/component => ../../component + +replace go.opentelemetry.io/collector/component/componenttest => ../../component/componenttest + +replace go.opentelemetry.io/collector/receiver/xreceiver => ../../receiver/xreceiver + +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer + +replace go.opentelemetry.io/collector/pipeline => ../../pipeline + +replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata + +replace go.opentelemetry.io/collector/pdata => ../../pdata + +replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest diff --git a/scraper/scraperhelper/go.sum b/scraper/scraperhelper/go.sum new file mode 100644 index 00000000000..6b60193626f --- /dev/null +++ b/scraper/scraperhelper/go.sum @@ -0,0 +1,98 @@ +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/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +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.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.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.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= +go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= +go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M= +go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8= +go.opentelemetry.io/otel/sdk v1.32.0 h1:RNxepc9vK59A8XsgZQouW8ue8Gkb4jpWtJm9ge5lEG4= +go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:LqgegDBjKMmb2GC6/PrTnteJG39I8/vJCAP9LlJXEjU= +go.opentelemetry.io/otel/sdk/metric v1.32.0 h1:rZvFnvmvawYb0alrYkjraqJq0Z4ZUJAiyYCU9snn1CU= +go.opentelemetry.io/otel/sdk/metric v1.32.0/go.mod h1:PWeZlq0zt9YkYAp3gjKZ0eicRYvOh1Gd+X99x6GHpCQ= +go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM= +go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8= +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.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +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-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= +google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= +google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= +google.golang.org/protobuf v1.36.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/scraperhelper/internal/metadata/generated_telemetry.go b/scraper/scraperhelper/internal/metadata/generated_telemetry.go similarity index 97% rename from receiver/scraperhelper/internal/metadata/generated_telemetry.go rename to scraper/scraperhelper/internal/metadata/generated_telemetry.go index 8e01bc1d74b..2ae72fee03b 100644 --- a/receiver/scraperhelper/internal/metadata/generated_telemetry.go +++ b/scraper/scraperhelper/internal/metadata/generated_telemetry.go @@ -14,11 +14,11 @@ import ( ) 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/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/scraper/scraperhelper") } // TelemetryBuilder provides an interface for components to report telemetry diff --git a/receiver/scraperhelper/internal/metadata/generated_telemetry_test.go b/scraper/scraperhelper/internal/metadata/generated_telemetry_test.go similarity index 91% rename from receiver/scraperhelper/internal/metadata/generated_telemetry_test.go rename to scraper/scraperhelper/internal/metadata/generated_telemetry_test.go index 5ae22abd62b..12bce797559 100644 --- a/receiver/scraperhelper/internal/metadata/generated_telemetry_test.go +++ b/scraper/scraperhelper/internal/metadata/generated_telemetry_test.go @@ -50,14 +50,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/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/scraper/scraperhelper", m.name) } else { require.Fail(t, "returned Meter not mockTracer") } diff --git a/receiver/scraperhelper/metadata.yaml b/scraper/scraperhelper/metadata.yaml similarity index 100% rename from receiver/scraperhelper/metadata.yaml rename to scraper/scraperhelper/metadata.yaml diff --git a/receiver/scraperhelper/obs_metrics.go b/scraper/scraperhelper/obs_metrics.go similarity index 80% rename from receiver/scraperhelper/obs_metrics.go rename to scraper/scraperhelper/obs_metrics.go index 7523ecd6c09..8723215da2a 100644 --- a/receiver/scraperhelper/obs_metrics.go +++ b/scraper/scraperhelper/obs_metrics.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/scraper/scraperhelper" import ( "context" @@ -15,10 +15,9 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pipeline" - "go.opentelemetry.io/collector/receiver/internal" - "go.opentelemetry.io/collector/receiver/scraperhelper/internal/metadata" "go.opentelemetry.io/collector/scraper" "go.opentelemetry.io/collector/scraper/scrapererror" + "go.opentelemetry.io/collector/scraper/scraperhelper/internal/metadata" ) const ( @@ -30,6 +29,12 @@ const ( // erroredMetricPointsKey used to identify metric points errored (i.e. // unable to be scraped) by the Collector. erroredMetricPointsKey = "errored_metric_points" + + spanNameSep = "/" + // receiverKey used to identify receivers in metrics and traces. + receiverKey = "receiver" + // FormatKey used to identify the format of the data received. + formatKey = "format" ) func newObsMetrics(delegate scraper.ScrapeMetricsFunc, receiverID component.ID, scraperID component.ID, telSettings component.TelemetrySettings) (scraper.ScrapeMetricsFunc, error) { @@ -39,9 +44,9 @@ func newObsMetrics(delegate scraper.ScrapeMetricsFunc, receiverID component.ID, } tracer := metadata.Tracer(telSettings) - spanName := scraperKey + internal.SpanNameSep + scraperID.String() + internal.SpanNameSep + "ScrapeMetrics" + spanName := scraperKey + spanNameSep + scraperID.String() + spanNameSep + "ScrapeMetrics" otelAttrs := metric.WithAttributeSet(attribute.NewSet( - attribute.String(internal.ReceiverKey, receiverID.String()), + attribute.String(receiverKey, receiverID.String()), attribute.String(scraperKey, scraperID.String()), )) @@ -69,7 +74,7 @@ func newObsMetrics(delegate scraper.ScrapeMetricsFunc, receiverID component.ID, // end span according to errors if span.IsRecording() { span.SetAttributes( - attribute.String(internal.FormatKey, pipeline.SignalMetrics.String()), + attribute.String(formatKey, pipeline.SignalMetrics.String()), attribute.Int64(scrapedMetricPointsKey, int64(numScrapedMetrics)), attribute.Int64(erroredMetricPointsKey, int64(numErroredMetrics)), ) diff --git a/receiver/scraperhelper/obs_metrics_test.go b/scraper/scraperhelper/obs_metrics_test.go similarity index 100% rename from receiver/scraperhelper/obs_metrics_test.go rename to scraper/scraperhelper/obs_metrics_test.go diff --git a/receiver/scraperhelper/scrapercontroller.go b/scraper/scraperhelper/scrapercontroller.go similarity index 98% rename from receiver/scraperhelper/scrapercontroller.go rename to scraper/scraperhelper/scrapercontroller.go index 78e5f2a3e58..b41ccb83efd 100644 --- a/receiver/scraperhelper/scrapercontroller.go +++ b/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/scraper/scraperhelper" import ( "context" diff --git a/receiver/scraperhelper/scrapercontroller_test.go b/scraper/scraperhelper/scrapercontroller_test.go similarity index 100% rename from receiver/scraperhelper/scrapercontroller_test.go rename to scraper/scraperhelper/scrapercontroller_test.go diff --git a/service/go.mod b/service/go.mod index e64e29caa31..bb70fa40870 100644 --- a/service/go.mod +++ b/service/go.mod @@ -213,3 +213,5 @@ replace go.opentelemetry.io/collector/extension/extensiontest => ../extension/ex replace go.opentelemetry.io/collector/extension/auth/authtest => ../extension/auth/authtest replace go.opentelemetry.io/collector/scraper => ../scraper + +replace go.opentelemetry.io/collector/scraper/scraperhelper => ../scraper/scraperhelper diff --git a/versions.yaml b/versions.yaml index 2af43173a73..1dfe44c7a90 100644 --- a/versions.yaml +++ b/versions.yaml @@ -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/scraperhelper - go.opentelemetry.io/collector/semconv - go.opentelemetry.io/collector/service - go.opentelemetry.io/collector/filter