diff --git a/.chloggen/codeboten_rm-generated-jsonschema-code.yaml b/.chloggen/codeboten_rm-generated-jsonschema-code.yaml new file mode 100755 index 00000000000..189e452c680 --- /dev/null +++ b/.chloggen/codeboten_rm-generated-jsonschema-code.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: telemetry + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: deprecate jsonschema generated types + +# One or more tracking issues or pull requests related to the change +issues: [15009] + +# (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] \ No newline at end of file diff --git a/Makefile b/Makefile index df15bd39f3a..1f6c48fb240 100644 --- a/Makefile +++ b/Makefile @@ -250,32 +250,6 @@ genpdata: $(GOCMD) run pdata/internal/cmd/pdatagen/main.go $(MAKE) fmt -# The source directory for configuration schema. -OPENTELEMETRY_JSONSCHEMA_SRC_DIR=service/internal/proctelemetry/opentelememetry-configuration - -# The SHA matching the current version of the configuration schema to use -OPENTELEMETRY_JSONSCHEMA_VERSION=main - -# Cleanup temporary directory -genjsonschema-cleanup: - rm -Rf ${OPENTELEMETRY_JSONSCHEMA_SRC_DIR} - -# Generate structs for configuration from configuration schema -genjsonschema: genjsonschema-cleanup $(GOJSONSCHEMA) - mkdir -p ${OPENTELEMETRY_JSONSCHEMA_SRC_DIR} - curl -sSL https://api.github.com/repos/open-telemetry/opentelemetry-configuration/tarball/${OPENTELEMETRY_JSONSCHEMA_VERSION} | tar xz --strip 1 -C ${OPENTELEMETRY_JSONSCHEMA_SRC_DIR} - $(GOJSONSCHEMA) \ - --package telemetry \ - --tags mapstructure \ - --output ./service/telemetry/generated_config.go \ - --schema-package=https://opentelemetry.io/otelconfig/opentelemetry_configuration.json=github.com/open-telemetry/opentelemetry-collector/schema \ - ${OPENTELEMETRY_JSONSCHEMA_SRC_DIR}/schema/opentelemetry_configuration.json - @echo Modify jsonschema generated files. - sed -f $(TOOLS_MOD_DIR)/jsonschema_patch.sed service/telemetry/generated_config.go > service/telemetry/generated_config_tmp.go - mv service/telemetry/generated_config_tmp.go service/telemetry/generated_config.go - $(MAKE) fmt - $(MAKE) genjsonschema-cleanup - # Generate semantic convention constants. Requires a clone of the opentelemetry-specification repo gensemconv: @[ "${SPECPATH}" ] || ( echo ">> env var SPECPATH is not set"; exit 1 ) diff --git a/cmd/otelcorecol/go.mod b/cmd/otelcorecol/go.mod index 7e17a432dd7..4869763d387 100644 --- a/cmd/otelcorecol/go.mod +++ b/cmd/otelcorecol/go.mod @@ -94,6 +94,7 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0-rcv0018 // indirect go.opentelemetry.io/collector/semconv v0.89.0 // indirect go.opentelemetry.io/collector/service v0.89.0 // indirect + go.opentelemetry.io/contrib/config v0.1.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.0 // indirect go.opentelemetry.io/contrib/propagators/b3 v1.21.0 // indirect diff --git a/cmd/otelcorecol/go.sum b/cmd/otelcorecol/go.sum index 0ec132e008a..582e3c3df01 100644 --- a/cmd/otelcorecol/go.sum +++ b/cmd/otelcorecol/go.sum @@ -316,6 +316,8 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib/config v0.1.0 h1:5N2zOlUsAy4khX3ftfMWQRRl9HoSPbZ+96muywRdaLs= +go.opentelemetry.io/contrib/config v0.1.0/go.mod h1:h1OB+0kulQiQH9U2pp2RYjWUV127hc47wtFutejyofg= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 h1:PzIubN4/sjByhDRHLviCjJuweBXWFZWhghjg7cS28+M= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0/go.mod h1:Ct6zzQEuGK3WpJs2n4dn+wfJYzd/+hNnxMRTWjGn30M= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.0 h1:1eHu3/pUSWaOgltNK3WJFaywKsTIr/PwvHyDmi0lQA0= diff --git a/config/configgrpc/go.mod b/config/configgrpc/go.mod index ed1e77030c2..a229f9b0e42 100644 --- a/config/configgrpc/go.mod +++ b/config/configgrpc/go.mod @@ -100,8 +100,6 @@ replace go.opentelemetry.io/collector/processor => ../../processor replace go.opentelemetry.io/collector/exporter => ../../exporter -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - replace go.opentelemetry.io/collector/receiver => ../../receiver replace go.opentelemetry.io/collector/connector => ../../connector @@ -112,8 +110,4 @@ replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/component => ../../component -replace go.opentelemetry.io/collector/semconv => ../../semconv - replace go.opentelemetry.io/collector/consumer => ../../consumer - -replace go.opentelemetry.io/collector/service => ../../service diff --git a/config/confighttp/go.mod b/config/confighttp/go.mod index b4be7dc1048..fed2bd82132 100644 --- a/config/confighttp/go.mod +++ b/config/confighttp/go.mod @@ -59,8 +59,6 @@ replace go.opentelemetry.io/collector/config/configauth => ../configauth replace go.opentelemetry.io/collector/config/configcompression => ../configcompression -replace go.opentelemetry.io/collector/config/confignet => ../confignet - replace go.opentelemetry.io/collector/config/configopaque => ../configopaque replace go.opentelemetry.io/collector/config/configtls => ../configtls @@ -79,8 +77,6 @@ replace go.opentelemetry.io/collector/processor => ../../processor replace go.opentelemetry.io/collector/exporter => ../../exporter -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - replace go.opentelemetry.io/collector/receiver => ../../receiver replace go.opentelemetry.io/collector/connector => ../../connector @@ -91,8 +87,4 @@ replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/component => ../../component -replace go.opentelemetry.io/collector/semconv => ../../semconv - replace go.opentelemetry.io/collector/consumer => ../../consumer - -replace go.opentelemetry.io/collector/service => ../../service diff --git a/connector/forwardconnector/go.mod b/connector/forwardconnector/go.mod index 5d2cadebdbe..f7f1bb4d504 100644 --- a/connector/forwardconnector/go.mod +++ b/connector/forwardconnector/go.mod @@ -59,10 +59,6 @@ replace go.opentelemetry.io/collector/processor => ../../processor replace go.opentelemetry.io/collector/receiver => ../../receiver -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - replace go.opentelemetry.io/collector/featuregate => ../../featuregate replace go.opentelemetry.io/collector/consumer => ../../consumer @@ -74,8 +70,4 @@ retract ( v0.69.0 // Release failed, use v0.69.1 ) -replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet - replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry - -replace go.opentelemetry.io/collector/service => ../../service diff --git a/connector/go.mod b/connector/go.mod index 31dc0ede06b..6663b4ede9b 100644 --- a/connector/go.mod +++ b/connector/go.mod @@ -54,8 +54,6 @@ replace go.opentelemetry.io/collector/consumer => ../consumer replace go.opentelemetry.io/collector/extension => ../extension -replace go.opentelemetry.io/collector/extension/zpagesextension => ../extension/zpagesextension - replace go.opentelemetry.io/collector/featuregate => ../featuregate replace go.opentelemetry.io/collector/pdata => ../pdata @@ -64,10 +62,4 @@ replace go.opentelemetry.io/collector/processor => ../processor replace go.opentelemetry.io/collector/receiver => ../receiver -replace go.opentelemetry.io/collector/semconv => ../semconv - replace go.opentelemetry.io/collector/exporter => ../exporter - -replace go.opentelemetry.io/collector/config/confignet => ../config/confignet - -replace go.opentelemetry.io/collector/service => ../service diff --git a/consumer/go.mod b/consumer/go.mod index f996369cd1f..96ce04cdd00 100644 --- a/consumer/go.mod +++ b/consumer/go.mod @@ -37,8 +37,6 @@ replace go.opentelemetry.io/collector/exporter => ../exporter replace go.opentelemetry.io/collector/extension => ../extension -replace go.opentelemetry.io/collector/extension/zpagesextension => ../extension/zpagesextension - replace go.opentelemetry.io/collector/featuregate => ../featuregate replace go.opentelemetry.io/collector/pdata => ../pdata @@ -47,8 +45,6 @@ replace go.opentelemetry.io/collector/processor => ../processor replace go.opentelemetry.io/collector/receiver => ../receiver -replace go.opentelemetry.io/collector/semconv => ../semconv - retract ( v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module, use v0.76.1 v0.69.0 // Release failed, use v0.69.1 @@ -56,8 +52,4 @@ retract ( replace go.opentelemetry.io/collector/connector => ../connector -replace go.opentelemetry.io/collector/config/confignet => ../config/confignet - replace go.opentelemetry.io/collector/config/configtelemetry => ../config/configtelemetry - -replace go.opentelemetry.io/collector/service => ../service diff --git a/exporter/debugexporter/go.mod b/exporter/debugexporter/go.mod index b19d27ee513..fa9fbfd7b3c 100644 --- a/exporter/debugexporter/go.mod +++ b/exporter/debugexporter/go.mod @@ -63,18 +63,10 @@ replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/receiver => ../../receiver -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - replace go.opentelemetry.io/collector/extension => ../../extension replace go.opentelemetry.io/collector/connector => ../../connector -replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet - replace go.opentelemetry.io/collector/processor => ../../processor replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry - -replace go.opentelemetry.io/collector/service => ../../service diff --git a/exporter/go.mod b/exporter/go.mod index 2f167310726..5963e44d700 100644 --- a/exporter/go.mod +++ b/exporter/go.mod @@ -74,8 +74,6 @@ replace go.opentelemetry.io/collector/consumer => ../consumer replace go.opentelemetry.io/collector/extension => ../extension -replace go.opentelemetry.io/collector/extension/zpagesextension => ../extension/zpagesextension - replace go.opentelemetry.io/collector/featuregate => ../featuregate replace go.opentelemetry.io/collector/pdata => ../pdata @@ -84,14 +82,8 @@ replace go.opentelemetry.io/collector/processor => ../processor replace go.opentelemetry.io/collector/receiver => ../receiver -replace go.opentelemetry.io/collector/semconv => ../semconv - retract v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module replace go.opentelemetry.io/collector/connector => ../connector -replace go.opentelemetry.io/collector/config/confignet => ../config/confignet - replace go.opentelemetry.io/collector/config/configtelemetry => ../config/configtelemetry - -replace go.opentelemetry.io/collector/service => ../service diff --git a/exporter/loggingexporter/go.mod b/exporter/loggingexporter/go.mod index a15511a0a01..1b7db6936b7 100644 --- a/exporter/loggingexporter/go.mod +++ b/exporter/loggingexporter/go.mod @@ -68,10 +68,6 @@ replace go.opentelemetry.io/collector/processor => ../../processor replace go.opentelemetry.io/collector/receiver => ../../receiver -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - retract ( v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module, use v0.76.1 v0.69.0 // Release failed, use v0.69.1 @@ -79,8 +75,4 @@ retract ( replace go.opentelemetry.io/collector/connector => ../../connector -replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet - replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry - -replace go.opentelemetry.io/collector/service => ../../service diff --git a/exporter/otlpexporter/go.mod b/exporter/otlpexporter/go.mod index a41842365ee..ef39d9de171 100644 --- a/exporter/otlpexporter/go.mod +++ b/exporter/otlpexporter/go.mod @@ -55,12 +55,13 @@ require ( go.opentelemetry.io/collector/extension/auth v0.89.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0-rcv0018 // indirect go.opentelemetry.io/collector/receiver v0.89.0 // indirect - go.opentelemetry.io/collector/service v0.89.0 // indirect + go.opentelemetry.io/contrib/config v0.1.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.0 // indirect go.opentelemetry.io/otel v1.20.0 // indirect go.opentelemetry.io/otel/metric v1.20.0 // indirect go.opentelemetry.io/otel/sdk v1.20.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.20.0 // indirect go.opentelemetry.io/otel/trace v1.20.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect @@ -104,12 +105,6 @@ replace go.opentelemetry.io/collector/processor => ../../processor replace go.opentelemetry.io/collector/receiver => ../../receiver -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/service => ../../service - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - replace go.opentelemetry.io/collector/consumer => ../../consumer retract ( @@ -124,3 +119,5 @@ replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/con replace go.opentelemetry.io/collector/config/confighttp => ../../config/confighttp replace go.opentelemetry.io/collector/receiver/otlpreceiver => ../../receiver/otlpreceiver + +replace go.opentelemetry.io/collector/semconv => ../../semconv diff --git a/exporter/otlpexporter/go.sum b/exporter/otlpexporter/go.sum index a38b4765dbe..7149944244c 100644 --- a/exporter/otlpexporter/go.sum +++ b/exporter/otlpexporter/go.sum @@ -116,6 +116,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib/config v0.1.0 h1:5N2zOlUsAy4khX3ftfMWQRRl9HoSPbZ+96muywRdaLs= +go.opentelemetry.io/contrib/config v0.1.0/go.mod h1:h1OB+0kulQiQH9U2pp2RYjWUV127hc47wtFutejyofg= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 h1:PzIubN4/sjByhDRHLviCjJuweBXWFZWhghjg7cS28+M= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0/go.mod h1:Ct6zzQEuGK3WpJs2n4dn+wfJYzd/+hNnxMRTWjGn30M= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.0 h1:1eHu3/pUSWaOgltNK3WJFaywKsTIr/PwvHyDmi0lQA0= @@ -128,6 +130,7 @@ go.opentelemetry.io/otel/metric v1.20.0/go.mod h1:90DRw3nfK4D7Sm/75yQ00gTJxtkBxX go.opentelemetry.io/otel/sdk v1.20.0 h1:5Jf6imeFZlZtKv9Qbo6qt2ZkmWtdWx/wzcCbNUlAWGM= go.opentelemetry.io/otel/sdk v1.20.0/go.mod h1:rmkSx1cZCm/tn16iWDn1GQbLtsW/LvsdEEFzCSRM6V0= go.opentelemetry.io/otel/sdk/metric v1.20.0 h1:5eD40l/H2CqdKmbSV7iht2KMK0faAIL2pVYzJOWobGk= +go.opentelemetry.io/otel/sdk/metric v1.20.0/go.mod h1:AGvpC+YF/jblITiafMTYgvRBUiwi9hZf0EYE2E5XlS8= go.opentelemetry.io/otel/trace v1.20.0 h1:+yxVAPZPbQhbC3OfAkeIVTky6iTFpcr4SiY9om7mXSQ= go.opentelemetry.io/otel/trace v1.20.0/go.mod h1:HJSK7F/hA5RlzpZ0zKDCHCDHm556LCDtKaAo6JmBFUU= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= diff --git a/exporter/otlphttpexporter/go.mod b/exporter/otlphttpexporter/go.mod index 90064b8a4ba..ac8de278a0f 100644 --- a/exporter/otlphttpexporter/go.mod +++ b/exporter/otlphttpexporter/go.mod @@ -56,12 +56,13 @@ require ( go.opentelemetry.io/collector/extension v0.89.0 // indirect go.opentelemetry.io/collector/extension/auth v0.89.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0-rcv0018 // indirect - go.opentelemetry.io/collector/service v0.89.0 // indirect + go.opentelemetry.io/contrib/config v0.1.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.0 // indirect go.opentelemetry.io/otel v1.20.0 // indirect go.opentelemetry.io/otel/metric v1.20.0 // indirect go.opentelemetry.io/otel/sdk v1.20.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.20.0 // indirect go.opentelemetry.io/otel/trace v1.20.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect @@ -114,10 +115,6 @@ replace go.opentelemetry.io/collector/receiver/otlpreceiver => ../../receiver/ot replace go.opentelemetry.io/collector/semconv => ../../semconv -replace go.opentelemetry.io/collector/service => ../../service - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - replace go.opentelemetry.io/collector/consumer => ../../consumer retract ( diff --git a/exporter/otlphttpexporter/go.sum b/exporter/otlphttpexporter/go.sum index a38b4765dbe..7149944244c 100644 --- a/exporter/otlphttpexporter/go.sum +++ b/exporter/otlphttpexporter/go.sum @@ -116,6 +116,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib/config v0.1.0 h1:5N2zOlUsAy4khX3ftfMWQRRl9HoSPbZ+96muywRdaLs= +go.opentelemetry.io/contrib/config v0.1.0/go.mod h1:h1OB+0kulQiQH9U2pp2RYjWUV127hc47wtFutejyofg= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 h1:PzIubN4/sjByhDRHLviCjJuweBXWFZWhghjg7cS28+M= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0/go.mod h1:Ct6zzQEuGK3WpJs2n4dn+wfJYzd/+hNnxMRTWjGn30M= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.0 h1:1eHu3/pUSWaOgltNK3WJFaywKsTIr/PwvHyDmi0lQA0= @@ -128,6 +130,7 @@ go.opentelemetry.io/otel/metric v1.20.0/go.mod h1:90DRw3nfK4D7Sm/75yQ00gTJxtkBxX go.opentelemetry.io/otel/sdk v1.20.0 h1:5Jf6imeFZlZtKv9Qbo6qt2ZkmWtdWx/wzcCbNUlAWGM= go.opentelemetry.io/otel/sdk v1.20.0/go.mod h1:rmkSx1cZCm/tn16iWDn1GQbLtsW/LvsdEEFzCSRM6V0= go.opentelemetry.io/otel/sdk/metric v1.20.0 h1:5eD40l/H2CqdKmbSV7iht2KMK0faAIL2pVYzJOWobGk= +go.opentelemetry.io/otel/sdk/metric v1.20.0/go.mod h1:AGvpC+YF/jblITiafMTYgvRBUiwi9hZf0EYE2E5XlS8= go.opentelemetry.io/otel/trace v1.20.0 h1:+yxVAPZPbQhbC3OfAkeIVTky6iTFpcr4SiY9om7mXSQ= go.opentelemetry.io/otel/trace v1.20.0/go.mod h1:HJSK7F/hA5RlzpZ0zKDCHCDHm556LCDtKaAo6JmBFUU= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= diff --git a/extension/ballastextension/go.mod b/extension/ballastextension/go.mod index 5e3869ede54..3490ba5dc67 100644 --- a/extension/ballastextension/go.mod +++ b/extension/ballastextension/go.mod @@ -62,10 +62,6 @@ replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/receiver => ../../receiver -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../zpagesextension - replace go.opentelemetry.io/collector/consumer => ../../consumer retract ( @@ -77,8 +73,4 @@ replace go.opentelemetry.io/collector/processor => ../../processor replace go.opentelemetry.io/collector/connector => ../../connector -replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet - replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry - -replace go.opentelemetry.io/collector/service => ../../service diff --git a/extension/zpagesextension/go.mod b/extension/zpagesextension/go.mod index 8acd0bfae94..058875b1a3a 100644 --- a/extension/zpagesextension/go.mod +++ b/extension/zpagesextension/go.mod @@ -29,13 +29,13 @@ require ( github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.89.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0-rcv0018 // indirect go.opentelemetry.io/collector/pdata v1.0.0-rcv0018 // indirect - go.opentelemetry.io/collector/service v0.89.0 // indirect + go.opentelemetry.io/contrib/config v0.1.0 // indirect go.opentelemetry.io/otel v1.20.0 // indirect go.opentelemetry.io/otel/metric v1.20.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.20.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.14.0 // indirect @@ -66,10 +66,6 @@ replace go.opentelemetry.io/collector/processor => ../../processor replace go.opentelemetry.io/collector/receiver => ../../receiver -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/service => ../../service - replace go.opentelemetry.io/collector/consumer => ../../consumer retract ( diff --git a/extension/zpagesextension/go.sum b/extension/zpagesextension/go.sum index 3c0a3d993c7..bfc4f806787 100644 --- a/extension/zpagesextension/go.sum +++ b/extension/zpagesextension/go.sum @@ -1,15 +1,5 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -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/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -17,31 +7,11 @@ 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/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -62,20 +32,13 @@ github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zx github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= 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/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= -go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib/config v0.1.0 h1:5N2zOlUsAy4khX3ftfMWQRRl9HoSPbZ+96muywRdaLs= +go.opentelemetry.io/contrib/config v0.1.0/go.mod h1:h1OB+0kulQiQH9U2pp2RYjWUV127hc47wtFutejyofg= go.opentelemetry.io/contrib/zpages v0.46.0 h1:6P4PorJOWf9dE3a2J7L3LedyDeuZsGPQESVLyDucznM= go.opentelemetry.io/contrib/zpages v0.46.0/go.mod h1:K7ziE9syrS1YVzpdZPFuApm/kM7LORVadiwnWz48sJY= go.opentelemetry.io/otel v1.20.0 h1:vsb/ggIY+hUjD/zCAQHpzTmndPqv/ml2ArbsbfBYTAc= @@ -84,6 +47,8 @@ go.opentelemetry.io/otel/metric v1.20.0 h1:ZlrO8Hu9+GAhnepmRGhSU7/VkpjrNowxRN9Gy go.opentelemetry.io/otel/metric v1.20.0/go.mod h1:90DRw3nfK4D7Sm/75yQ00gTJxtkBxX+wu6YaNymbpVM= go.opentelemetry.io/otel/sdk v1.20.0 h1:5Jf6imeFZlZtKv9Qbo6qt2ZkmWtdWx/wzcCbNUlAWGM= go.opentelemetry.io/otel/sdk v1.20.0/go.mod h1:rmkSx1cZCm/tn16iWDn1GQbLtsW/LvsdEEFzCSRM6V0= +go.opentelemetry.io/otel/sdk/metric v1.20.0 h1:5eD40l/H2CqdKmbSV7iht2KMK0faAIL2pVYzJOWobGk= +go.opentelemetry.io/otel/sdk/metric v1.20.0/go.mod h1:AGvpC+YF/jblITiafMTYgvRBUiwi9hZf0EYE2E5XlS8= go.opentelemetry.io/otel/trace v1.20.0 h1:+yxVAPZPbQhbC3OfAkeIVTky6iTFpcr4SiY9om7mXSQ= go.opentelemetry.io/otel/trace v1.20.0/go.mod h1:HJSK7F/hA5RlzpZ0zKDCHCDHm556LCDtKaAo6JmBFUU= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= @@ -94,30 +59,17 @@ go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= 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/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 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-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 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.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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= @@ -128,10 +80,6 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 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= @@ -139,37 +87,15 @@ 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/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= 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/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/go.mod b/go.mod index ab2d108b15b..ee3da0cd8b4 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0-rcv0018 go.opentelemetry.io/collector/processor v0.89.0 go.opentelemetry.io/collector/receiver v0.89.0 - go.opentelemetry.io/collector/service v0.89.0 + go.opentelemetry.io/contrib/config v0.1.0 go.opentelemetry.io/otel v1.20.0 go.opentelemetry.io/otel/exporters/prometheus v0.43.0 go.opentelemetry.io/otel/sdk v1.20.0 @@ -79,8 +79,6 @@ replace go.opentelemetry.io/collector/component => ./component replace go.opentelemetry.io/collector/confmap => ./confmap -replace go.opentelemetry.io/collector/config/confignet => ./config/confignet - replace go.opentelemetry.io/collector/config/configtelemetry => ./config/configtelemetry replace go.opentelemetry.io/collector/connector => ./connector @@ -93,18 +91,12 @@ replace go.opentelemetry.io/collector/extension => ./extension replace go.opentelemetry.io/collector/featuregate => ./featuregate -replace go.opentelemetry.io/collector/semconv => ./semconv - replace go.opentelemetry.io/collector/pdata => ./pdata replace go.opentelemetry.io/collector/processor => ./processor replace go.opentelemetry.io/collector/receiver => ./receiver -replace go.opentelemetry.io/collector/service => ./service - -replace go.opentelemetry.io/collector/extension/zpagesextension => ./extension/zpagesextension - retract ( v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module, use v0.76.1 v0.69.0 // Release failed, use v0.69.1 diff --git a/go.sum b/go.sum index 939528bacc8..a90cf1fb749 100644 --- a/go.sum +++ b/go.sum @@ -283,6 +283,8 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib/config v0.1.0 h1:5N2zOlUsAy4khX3ftfMWQRRl9HoSPbZ+96muywRdaLs= +go.opentelemetry.io/contrib/config v0.1.0/go.mod h1:h1OB+0kulQiQH9U2pp2RYjWUV127hc47wtFutejyofg= go.opentelemetry.io/otel v1.20.0 h1:vsb/ggIY+hUjD/zCAQHpzTmndPqv/ml2ArbsbfBYTAc= go.opentelemetry.io/otel v1.20.0/go.mod h1:oUIGj3D77RwJdM6PPZImDpSZGDvkD9fhesHny69JFrs= go.opentelemetry.io/otel/exporters/prometheus v0.43.0 h1:Skkl6akzvdWweXX6LLAY29tyFSO6hWZ26uDbVGTDXe8= diff --git a/internal/testutil/testutil.go b/internal/testutil/testutil.go index 427e51d2e19..b8d9923869c 100644 --- a/internal/testutil/testutil.go +++ b/internal/testutil/testutil.go @@ -13,8 +13,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - - "go.opentelemetry.io/collector/service/telemetry" + "go.opentelemetry.io/contrib/config" ) type portpair struct { @@ -57,7 +56,7 @@ func GetAvailableLocalAddress(t testing.TB) string { return endpoint } -func GetAvailableLocalAddressPrometheus(t testing.TB) *telemetry.Prometheus { +func GetAvailableLocalAddressPrometheus(t testing.TB) *config.Prometheus { address := GetAvailableLocalAddress(t) host, port, err := net.SplitHostPort(address) if err != nil { @@ -67,7 +66,7 @@ func GetAvailableLocalAddressPrometheus(t testing.TB) *telemetry.Prometheus { if err != nil { return nil } - return &telemetry.Prometheus{ + return &config.Prometheus{ Host: &host, Port: &portInt, } diff --git a/internal/tools/go.mod b/internal/tools/go.mod index bc6fd1297c4..d7c8131f242 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -4,7 +4,6 @@ go 1.20 require ( github.com/a8m/envsubst v1.4.2 - github.com/atombender/go-jsonschema v0.13.0 github.com/client9/misspell v0.3.4 github.com/golangci/golangci-lint v1.55.2 github.com/google/addlicense v1.1.1 @@ -143,7 +142,6 @@ require ( github.com/mbilski/exhaustivestruct v1.2.0 // indirect github.com/mgechev/revive v1.3.4 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // indirect github.com/moricho/tparallel v0.3.1 // indirect github.com/nakabonne/nestif v0.3.1 // indirect @@ -153,7 +151,6 @@ require ( github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/polyfloyd/go-errorlint v1.4.5 // indirect github.com/prometheus/client_golang v1.17.0 // indirect @@ -166,7 +163,6 @@ require ( github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect github.com/ryancurrah/gomodguard v1.3.0 // indirect github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect - github.com/sanity-io/litter v1.5.5 // indirect github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect github.com/sashamelentyev/interfacebloat v1.1.0 // indirect github.com/sashamelentyev/usestdlibvars v1.24.0 // indirect diff --git a/internal/tools/go.sum b/internal/tools/go.sum index 22c99c499b0..41ef981408e 100644 --- a/internal/tools/go.sum +++ b/internal/tools/go.sum @@ -96,8 +96,6 @@ github.com/ashanbrown/forbidigo v1.6.0 h1:D3aewfM37Yb3pxHujIPSpTf6oQk9sc9WZi8ger github.com/ashanbrown/forbidigo v1.6.0/go.mod h1:Y8j9jy9ZYAEHXdu723cUlraTqbzjKF1MUyfOKL+AjcU= github.com/ashanbrown/makezero v1.1.1 h1:iCQ87C0V0vSyO+M9E/FZYbu65auqH0lnsOkf5FcB28s= github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI= -github.com/atombender/go-jsonschema v0.13.0 h1:SpVRG/r9BKscjgNPyJtQ6OwNqP/QPIKqzj1p+WlNFVE= -github.com/atombender/go-jsonschema v0.13.0/go.mod h1:PCP4Hq2nvh6fzL6IcnXF9SvasRCqEO/xXuhwl3UoB8M= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -149,7 +147,6 @@ github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53E github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/daixiang0/gci v0.11.2 h1:Oji+oPsp3bQ6bNNgX30NBAVT18P4uBH4sRZnlOlTj7Y= github.com/daixiang0/gci v0.11.2/go.mod h1:xtHP9N7AHdNvtRNfcx9gwTDfw7FRJx4bZUsiEfiNNAI= -github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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= @@ -443,8 +440,6 @@ github.com/mikefarah/yq/v4 v4.40.1 h1:rc4aVCWlpS2Cs5GzX2g6Hp8nbk9UX6Ulr3vnkKMAUW github.com/mikefarah/yq/v4 v4.40.1/go.mod h1:i/9RH2cZEwmzz6My0QfUIXyBUgrwFbRayztYOHzpUF8= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= -github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 h1:BpfhmLKZf+SjVanKKhCgf3bg+511DmU9eDQTen7LLbY= github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -486,7 +481,6 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 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/polyfloyd/go-errorlint v1.4.5 h1:70YWmMy4FgRHehGNOUask3HtSFSOLKgmDn7ryNe7LqI= @@ -532,8 +526,6 @@ github.com/ryancurrah/gomodguard v1.3.0 h1:q15RT/pd6UggBXVBuLps8BXRvl5GPBcwVA7BJ github.com/ryancurrah/gomodguard v1.3.0/go.mod h1:ggBxb3luypPEzqVtq33ee7YSN35V28XeGnid8dnni50= github.com/ryanrolds/sqlclosecheck v0.5.1 h1:dibWW826u0P8jNLsLN+En7+RqWWTYrjCB9fJfSfdyCU= github.com/ryanrolds/sqlclosecheck v0.5.1/go.mod h1:2g3dUjoS6AL4huFdv6wn55WpLIDjY7ZgUR4J8HOO/XQ= -github.com/sanity-io/litter v1.5.5 h1:iE+sBxPBzoK6uaEP5Lt3fHNgpKcHXc/A2HGETy0uJQo= -github.com/sanity-io/litter v1.5.5/go.mod h1:9gzJgR2i4ZpjZHsKvUXIRQVk7P+yM3e+jAF7bU2UI5U= github.com/sanposhiho/wastedassign/v2 v2.0.7 h1:J+6nrY4VW+gC9xFzUc+XjPD3g3wF3je/NsJFwFK7Uxc= github.com/sanposhiho/wastedassign/v2 v2.0.7/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tMEOsumirXcOJqAw= @@ -587,7 +579,6 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v0.0.0-20161117074351-18a02ba4a312/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= diff --git a/internal/tools/tools.go b/internal/tools/tools.go index 1cc59069724..07b2eaf7c54 100644 --- a/internal/tools/tools.go +++ b/internal/tools/tools.go @@ -13,7 +13,6 @@ package tools // import "go.opentelemetry.io/collector/internal/tools" import ( _ "github.com/a8m/envsubst/cmd/envsubst" - _ "github.com/atombender/go-jsonschema/cmd/gojsonschema" _ "github.com/client9/misspell/cmd/misspell" _ "github.com/golangci/golangci-lint/cmd/golangci-lint" _ "github.com/google/addlicense" diff --git a/otelcol/go.mod b/otelcol/go.mod index add4e63749c..6aff8b05fe8 100644 --- a/otelcol/go.mod +++ b/otelcol/go.mod @@ -69,6 +69,7 @@ require ( go.opentelemetry.io/collector/consumer v0.89.0 // indirect go.opentelemetry.io/collector/pdata v1.0.0-rcv0018 // indirect go.opentelemetry.io/collector/semconv v0.89.0 // indirect + go.opentelemetry.io/contrib/config v0.1.0 // indirect go.opentelemetry.io/contrib/propagators/b3 v1.21.0 // indirect go.opentelemetry.io/otel v1.20.0 // indirect go.opentelemetry.io/otel/bridge/opencensus v0.43.0 // indirect diff --git a/otelcol/go.sum b/otelcol/go.sum index ea88c79a98a..da5b6170dfa 100644 --- a/otelcol/go.sum +++ b/otelcol/go.sum @@ -298,6 +298,8 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib/config v0.1.0 h1:5N2zOlUsAy4khX3ftfMWQRRl9HoSPbZ+96muywRdaLs= +go.opentelemetry.io/contrib/config v0.1.0/go.mod h1:h1OB+0kulQiQH9U2pp2RYjWUV127hc47wtFutejyofg= go.opentelemetry.io/contrib/propagators/b3 v1.21.0 h1:uGdgDPNzwQWRwCXJgw/7h29JaRqcq9B87Iv4hJDKAZw= go.opentelemetry.io/contrib/propagators/b3 v1.21.0/go.mod h1:D9GQXvVGT2pzyTfp1QBOnD1rzKEWzKjjwu5q2mslCUI= go.opentelemetry.io/contrib/zpages v0.46.0 h1:6P4PorJOWf9dE3a2J7L3LedyDeuZsGPQESVLyDucznM= diff --git a/processor/batchprocessor/go.mod b/processor/batchprocessor/go.mod index ddc01ae488d..2d34958bc76 100644 --- a/processor/batchprocessor/go.mod +++ b/processor/batchprocessor/go.mod @@ -80,10 +80,6 @@ replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/receiver => ../../receiver -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - replace go.opentelemetry.io/collector/consumer => ../../consumer retract ( @@ -93,8 +89,4 @@ retract ( replace go.opentelemetry.io/collector/connector => ../../connector -replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet - replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry - -replace go.opentelemetry.io/collector/service => ../../service diff --git a/processor/go.mod b/processor/go.mod index 6dddec84e84..60d67987913 100644 --- a/processor/go.mod +++ b/processor/go.mod @@ -73,20 +73,12 @@ replace go.opentelemetry.io/collector/exporter => ../exporter replace go.opentelemetry.io/collector/extension => ../extension -replace go.opentelemetry.io/collector/extension/zpagesextension => ../extension/zpagesextension - replace go.opentelemetry.io/collector/featuregate => ../featuregate replace go.opentelemetry.io/collector/pdata => ../pdata replace go.opentelemetry.io/collector/receiver => ../receiver -replace go.opentelemetry.io/collector/semconv => ../semconv - replace go.opentelemetry.io/collector/connector => ../connector -replace go.opentelemetry.io/collector/config/confignet => ../config/confignet - replace go.opentelemetry.io/collector/config/configtelemetry => ../config/configtelemetry - -replace go.opentelemetry.io/collector/service => ../service diff --git a/processor/memorylimiterprocessor/go.mod b/processor/memorylimiterprocessor/go.mod index 1f5512013be..240e8f3d3a0 100644 --- a/processor/memorylimiterprocessor/go.mod +++ b/processor/memorylimiterprocessor/go.mod @@ -69,10 +69,6 @@ replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/receiver => ../../receiver -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - replace go.opentelemetry.io/collector/consumer => ../../consumer retract ( @@ -82,8 +78,4 @@ retract ( replace go.opentelemetry.io/collector/connector => ../../connector -replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet - replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry - -replace go.opentelemetry.io/collector/service => ../../service diff --git a/receiver/go.mod b/receiver/go.mod index 24a4a24764f..6dc43884d34 100644 --- a/receiver/go.mod +++ b/receiver/go.mod @@ -73,22 +73,14 @@ replace go.opentelemetry.io/collector/exporter => ../exporter replace go.opentelemetry.io/collector/extension => ../extension -replace go.opentelemetry.io/collector/extension/zpagesextension => ../extension/zpagesextension - replace go.opentelemetry.io/collector/featuregate => ../featuregate replace go.opentelemetry.io/collector/pdata => ../pdata replace go.opentelemetry.io/collector/processor => ../processor -replace go.opentelemetry.io/collector/semconv => ../semconv - retract v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module replace go.opentelemetry.io/collector/connector => ../connector -replace go.opentelemetry.io/collector/config/confignet => ../config/confignet - replace go.opentelemetry.io/collector/config/configtelemetry => ../config/configtelemetry - -replace go.opentelemetry.io/collector/service => ../service diff --git a/receiver/otlpreceiver/go.mod b/receiver/otlpreceiver/go.mod index 49b5498bdc1..7ccd05e8f23 100644 --- a/receiver/otlpreceiver/go.mod +++ b/receiver/otlpreceiver/go.mod @@ -66,7 +66,7 @@ require ( go.opentelemetry.io/collector/extension v0.89.0 // indirect go.opentelemetry.io/collector/extension/auth v0.89.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0-rcv0018 // indirect - go.opentelemetry.io/collector/service v0.89.0 // indirect + go.opentelemetry.io/contrib/config v0.1.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.0 // indirect go.opentelemetry.io/otel v1.20.0 // indirect @@ -125,10 +125,6 @@ replace go.opentelemetry.io/collector/receiver => ../ replace go.opentelemetry.io/collector/semconv => ../../semconv -replace go.opentelemetry.io/collector/service => ../../service - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - replace go.opentelemetry.io/collector/consumer => ../../consumer retract ( diff --git a/receiver/otlpreceiver/go.sum b/receiver/otlpreceiver/go.sum index ba6e06da3e7..491583936a6 100644 --- a/receiver/otlpreceiver/go.sum +++ b/receiver/otlpreceiver/go.sum @@ -281,6 +281,8 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib/config v0.1.0 h1:5N2zOlUsAy4khX3ftfMWQRRl9HoSPbZ+96muywRdaLs= +go.opentelemetry.io/contrib/config v0.1.0/go.mod h1:h1OB+0kulQiQH9U2pp2RYjWUV127hc47wtFutejyofg= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 h1:PzIubN4/sjByhDRHLviCjJuweBXWFZWhghjg7cS28+M= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0/go.mod h1:Ct6zzQEuGK3WpJs2n4dn+wfJYzd/+hNnxMRTWjGn30M= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.0 h1:1eHu3/pUSWaOgltNK3WJFaywKsTIr/PwvHyDmi0lQA0= diff --git a/service/go.mod b/service/go.mod index 81a365b8ce0..7663f15821e 100644 --- a/service/go.mod +++ b/service/go.mod @@ -26,6 +26,7 @@ require ( go.opentelemetry.io/collector/processor v0.89.0 go.opentelemetry.io/collector/receiver v0.89.0 go.opentelemetry.io/collector/semconv v0.89.0 + go.opentelemetry.io/contrib/config v0.1.0 go.opentelemetry.io/contrib/propagators/b3 v1.21.0 go.opentelemetry.io/otel v1.20.0 go.opentelemetry.io/otel/bridge/opencensus v0.43.0 diff --git a/service/go.sum b/service/go.sum index ef8a80ad8ee..d9dafe56837 100644 --- a/service/go.sum +++ b/service/go.sum @@ -290,6 +290,8 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib/config v0.1.0 h1:5N2zOlUsAy4khX3ftfMWQRRl9HoSPbZ+96muywRdaLs= +go.opentelemetry.io/contrib/config v0.1.0/go.mod h1:h1OB+0kulQiQH9U2pp2RYjWUV127hc47wtFutejyofg= go.opentelemetry.io/contrib/propagators/b3 v1.21.0 h1:uGdgDPNzwQWRwCXJgw/7h29JaRqcq9B87Iv4hJDKAZw= go.opentelemetry.io/contrib/propagators/b3 v1.21.0/go.mod h1:D9GQXvVGT2pzyTfp1QBOnD1rzKEWzKjjwu5q2mslCUI= go.opentelemetry.io/contrib/zpages v0.46.0 h1:6P4PorJOWf9dE3a2J7L3LedyDeuZsGPQESVLyDucznM= diff --git a/service/internal/proctelemetry/config.go b/service/internal/proctelemetry/config.go index 4590b02d481..dad1ea9ef42 100644 --- a/service/internal/proctelemetry/config.go +++ b/service/internal/proctelemetry/config.go @@ -16,6 +16,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" + "go.opentelemetry.io/contrib/config" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/bridge/opencensus" "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc" @@ -32,7 +33,6 @@ import ( "go.opentelemetry.io/collector/processor/processorhelper" semconv "go.opentelemetry.io/collector/semconv/v1.18.0" - "go.opentelemetry.io/collector/service/telemetry" ) const ( @@ -66,7 +66,7 @@ var ( errNoValidSpanExporter = errors.New("no valid span exporter") ) -func InitMetricReader(ctx context.Context, reader telemetry.MetricReader, asyncErrorChannel chan error) (sdkmetric.Reader, *http.Server, error) { +func InitMetricReader(ctx context.Context, reader config.MetricReader, asyncErrorChannel chan error) (sdkmetric.Reader, *http.Server, error) { if reader.Pull != nil { return initPullExporter(reader.Pull.Exporter, asyncErrorChannel) } @@ -84,7 +84,7 @@ func InitMetricReader(ctx context.Context, reader telemetry.MetricReader, asyncE return nil, nil, fmt.Errorf("unsupported metric reader type %v", reader) } -func InitSpanProcessor(ctx context.Context, processor telemetry.SpanProcessor) (sdktrace.SpanProcessor, error) { +func InitSpanProcessor(ctx context.Context, processor config.SpanProcessor) (sdktrace.SpanProcessor, error) { if processor.Batch != nil { if processor.Batch.Exporter.Console != nil { exp, err := stdouttrace.New( @@ -95,16 +95,16 @@ func InitSpanProcessor(ctx context.Context, processor telemetry.SpanProcessor) ( } return initBatchSpanProcessor(processor.Batch, exp) } - if processor.Batch.Exporter.Otlp != nil { + if processor.Batch.Exporter.OTLP != nil { var err error var exp sdktrace.SpanExporter - switch processor.Batch.Exporter.Otlp.Protocol { + switch processor.Batch.Exporter.OTLP.Protocol { case protocolProtobufHTTP: - exp, err = initOTLPHTTPSpanExporter(ctx, processor.Batch.Exporter.Otlp) + exp, err = initOTLPHTTPSpanExporter(ctx, processor.Batch.Exporter.OTLP) case protocolProtobufGRPC: - exp, err = initOTLPgRPCSpanExporter(ctx, processor.Batch.Exporter.Otlp) + exp, err = initOTLPgRPCSpanExporter(ctx, processor.Batch.Exporter.OTLP) default: - return nil, fmt.Errorf("unsupported protocol %q", processor.Batch.Exporter.Otlp.Protocol) + return nil, fmt.Errorf("unsupported protocol %q", processor.Batch.Exporter.OTLP.Protocol) } if err != nil { return nil, err @@ -195,7 +195,7 @@ func cardinalityFilter(kvs ...attribute.KeyValue) attribute.Filter { } } -func initPrometheusExporter(prometheusConfig *telemetry.Prometheus, asyncErrorChannel chan error) (sdkmetric.Reader, *http.Server, error) { +func initPrometheusExporter(prometheusConfig *config.Prometheus, asyncErrorChannel chan error) (sdkmetric.Reader, *http.Server, error) { promRegistry := prometheus.NewRegistry() if prometheusConfig.Host == nil { return nil, nil, fmt.Errorf("host must be specified") @@ -218,14 +218,14 @@ func initPrometheusExporter(prometheusConfig *telemetry.Prometheus, asyncErrorCh return exporter, InitPrometheusServer(promRegistry, fmt.Sprintf("%s:%d", *prometheusConfig.Host, *prometheusConfig.Port), asyncErrorChannel), nil } -func initPullExporter(exporter telemetry.MetricExporter, asyncErrorChannel chan error) (sdkmetric.Reader, *http.Server, error) { +func initPullExporter(exporter config.MetricExporter, asyncErrorChannel chan error) (sdkmetric.Reader, *http.Server, error) { if exporter.Prometheus != nil { return initPrometheusExporter(exporter.Prometheus, asyncErrorChannel) } return nil, nil, errNoValidMetricExporter } -func initPeriodicExporter(ctx context.Context, exporter telemetry.MetricExporter, opts ...sdkmetric.PeriodicReaderOption) (sdkmetric.Reader, *http.Server, error) { +func initPeriodicExporter(ctx context.Context, exporter config.MetricExporter, opts ...sdkmetric.PeriodicReaderOption) (sdkmetric.Reader, *http.Server, error) { if exporter.Console != nil { enc := json.NewEncoder(os.Stdout) enc.SetIndent("", " ") @@ -238,16 +238,16 @@ func initPeriodicExporter(ctx context.Context, exporter telemetry.MetricExporter } return sdkmetric.NewPeriodicReader(exp, opts...), nil, nil } - if exporter.Otlp != nil { + if exporter.OTLP != nil { var err error var exp sdkmetric.Exporter - switch exporter.Otlp.Protocol { + switch exporter.OTLP.Protocol { case protocolProtobufHTTP: - exp, err = initOTLPHTTPExporter(ctx, exporter.Otlp) + exp, err = initOTLPHTTPExporter(ctx, exporter.OTLP) case protocolProtobufGRPC: - exp, err = initOTLPgRPCExporter(ctx, exporter.Otlp) + exp, err = initOTLPgRPCExporter(ctx, exporter.OTLP) default: - return nil, nil, fmt.Errorf("unsupported protocol %s", exporter.Otlp.Protocol) + return nil, nil, fmt.Errorf("unsupported protocol %s", exporter.OTLP.Protocol) } if err != nil { return nil, nil, err @@ -264,7 +264,7 @@ func normalizeEndpoint(endpoint string) string { return endpoint } -func initOTLPgRPCExporter(ctx context.Context, otlpConfig *telemetry.OtlpMetric) (sdkmetric.Exporter, error) { +func initOTLPgRPCExporter(ctx context.Context, otlpConfig *config.OTLPMetric) (sdkmetric.Exporter, error) { opts := []otlpmetricgrpc.Option{} if len(otlpConfig.Endpoint) > 0 { @@ -298,7 +298,7 @@ func initOTLPgRPCExporter(ctx context.Context, otlpConfig *telemetry.OtlpMetric) return otlpmetricgrpc.New(ctx, opts...) } -func initOTLPHTTPExporter(ctx context.Context, otlpConfig *telemetry.OtlpMetric) (sdkmetric.Exporter, error) { +func initOTLPHTTPExporter(ctx context.Context, otlpConfig *config.OTLPMetric) (sdkmetric.Exporter, error) { opts := []otlpmetrichttp.Option{} if len(otlpConfig.Endpoint) > 0 { @@ -335,7 +335,7 @@ func initOTLPHTTPExporter(ctx context.Context, otlpConfig *telemetry.OtlpMetric) return otlpmetrichttp.New(ctx, opts...) } -func initOTLPgRPCSpanExporter(ctx context.Context, otlpConfig *telemetry.Otlp) (sdktrace.SpanExporter, error) { +func initOTLPgRPCSpanExporter(ctx context.Context, otlpConfig *config.OTLP) (sdktrace.SpanExporter, error) { opts := []otlptracegrpc.Option{} if len(otlpConfig.Endpoint) > 0 { @@ -369,7 +369,7 @@ func initOTLPgRPCSpanExporter(ctx context.Context, otlpConfig *telemetry.Otlp) ( return otlptracegrpc.New(ctx, opts...) } -func initOTLPHTTPSpanExporter(ctx context.Context, otlpConfig *telemetry.Otlp) (sdktrace.SpanExporter, error) { +func initOTLPHTTPSpanExporter(ctx context.Context, otlpConfig *config.OTLP) (sdktrace.SpanExporter, error) { opts := []otlptracehttp.Option{} if len(otlpConfig.Endpoint) > 0 { @@ -406,7 +406,7 @@ func initOTLPHTTPSpanExporter(ctx context.Context, otlpConfig *telemetry.Otlp) ( return otlptracehttp.New(ctx, opts...) } -func initBatchSpanProcessor(bsp *telemetry.BatchSpanProcessor, exp sdktrace.SpanExporter) (sdktrace.SpanProcessor, error) { +func initBatchSpanProcessor(bsp *config.BatchSpanProcessor, exp sdktrace.SpanExporter) (sdktrace.SpanProcessor, error) { opts := []sdktrace.BatchSpanProcessorOption{} if bsp.ExportTimeout != nil { if *bsp.ExportTimeout < 0 { diff --git a/service/internal/proctelemetry/config_test.go b/service/internal/proctelemetry/config_test.go index cb09754e52c..7e36bdda35e 100644 --- a/service/internal/proctelemetry/config_test.go +++ b/service/internal/proctelemetry/config_test.go @@ -10,8 +10,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - - "go.opentelemetry.io/collector/service/telemetry" + "go.opentelemetry.io/contrib/config" ) func strPtr(s string) *string { @@ -25,7 +24,7 @@ func intPtr(i int) *int { func TestMetricReader(t *testing.T) { testCases := []struct { name string - reader telemetry.MetricReader + reader config.MetricReader args any err error }{ @@ -35,10 +34,10 @@ func TestMetricReader(t *testing.T) { }, { name: "pull prometheus invalid exporter", - reader: telemetry.MetricReader{ - Pull: &telemetry.PullMetricReader{ - Exporter: telemetry.MetricExporter{ - Otlp: &telemetry.OtlpMetric{}, + reader: config.MetricReader{ + Pull: &config.PullMetricReader{ + Exporter: config.MetricExporter{ + OTLP: &config.OTLPMetric{}, }, }, }, @@ -46,10 +45,10 @@ func TestMetricReader(t *testing.T) { }, { name: "pull/prometheus-invalid-config-no-host", - reader: telemetry.MetricReader{ - Pull: &telemetry.PullMetricReader{ - Exporter: telemetry.MetricExporter{ - Prometheus: &telemetry.Prometheus{}, + reader: config.MetricReader{ + Pull: &config.PullMetricReader{ + Exporter: config.MetricExporter{ + Prometheus: &config.Prometheus{}, }, }, }, @@ -57,10 +56,10 @@ func TestMetricReader(t *testing.T) { }, { name: "pull/prometheus-invalid-config-no-port", - reader: telemetry.MetricReader{ - Pull: &telemetry.PullMetricReader{ - Exporter: telemetry.MetricExporter{ - Prometheus: &telemetry.Prometheus{ + reader: config.MetricReader{ + Pull: &config.PullMetricReader{ + Exporter: config.MetricExporter{ + Prometheus: &config.Prometheus{ Host: strPtr("locahost"), }, }, @@ -70,10 +69,10 @@ func TestMetricReader(t *testing.T) { }, { name: "pull/prometheus-invalid-config-no-port", - reader: telemetry.MetricReader{ - Pull: &telemetry.PullMetricReader{ - Exporter: telemetry.MetricExporter{ - Prometheus: &telemetry.Prometheus{ + reader: config.MetricReader{ + Pull: &config.PullMetricReader{ + Exporter: config.MetricExporter{ + Prometheus: &config.Prometheus{ Host: strPtr("locahost"), Port: intPtr(8080), }, @@ -83,10 +82,10 @@ func TestMetricReader(t *testing.T) { }, { name: "periodic/invalid-exporter", - reader: telemetry.MetricReader{ - Periodic: &telemetry.PeriodicMetricReader{ - Exporter: telemetry.MetricExporter{ - Prometheus: &telemetry.Prometheus{ + reader: config.MetricReader{ + Periodic: &config.PeriodicMetricReader{ + Exporter: config.MetricExporter{ + Prometheus: &config.Prometheus{ Host: strPtr("locahost"), Port: intPtr(8080), }, @@ -97,39 +96,39 @@ func TestMetricReader(t *testing.T) { }, { name: "periodic/no-exporter", - reader: telemetry.MetricReader{ - Periodic: &telemetry.PeriodicMetricReader{}, + reader: config.MetricReader{ + Periodic: &config.PeriodicMetricReader{}, }, err: errNoValidMetricExporter, }, { name: "periodic/console-exporter", - reader: telemetry.MetricReader{ - Periodic: &telemetry.PeriodicMetricReader{ - Exporter: telemetry.MetricExporter{ - Console: telemetry.Console{}, + reader: config.MetricReader{ + Periodic: &config.PeriodicMetricReader{ + Exporter: config.MetricExporter{ + Console: config.Console{}, }, }, }, }, { name: "periodic/console-exporter-with-timeout-interval", - reader: telemetry.MetricReader{ - Periodic: &telemetry.PeriodicMetricReader{ + reader: config.MetricReader{ + Periodic: &config.PeriodicMetricReader{ Interval: intPtr(10), Timeout: intPtr(5), - Exporter: telemetry.MetricExporter{ - Console: telemetry.Console{}, + Exporter: config.MetricExporter{ + Console: config.Console{}, }, }, }, }, { name: "periodic/otlp-exporter-invalid-protocol", - reader: telemetry.MetricReader{ - Periodic: &telemetry.PeriodicMetricReader{ - Exporter: telemetry.MetricExporter{ - Otlp: &telemetry.OtlpMetric{ + reader: config.MetricReader{ + Periodic: &config.PeriodicMetricReader{ + Exporter: config.MetricExporter{ + OTLP: &config.OTLPMetric{ Protocol: *strPtr("http/invalid"), }, }, @@ -139,10 +138,10 @@ func TestMetricReader(t *testing.T) { }, { name: "periodic/otlp-grpc-exporter-no-endpoint", - reader: telemetry.MetricReader{ - Periodic: &telemetry.PeriodicMetricReader{ - Exporter: telemetry.MetricExporter{ - Otlp: &telemetry.OtlpMetric{ + reader: config.MetricReader{ + Periodic: &config.PeriodicMetricReader{ + Exporter: config.MetricExporter{ + OTLP: &config.OTLPMetric{ Protocol: "grpc/protobuf", Compression: strPtr("gzip"), Timeout: intPtr(1000), @@ -156,10 +155,10 @@ func TestMetricReader(t *testing.T) { }, { name: "periodic/otlp-grpc-exporter", - reader: telemetry.MetricReader{ - Periodic: &telemetry.PeriodicMetricReader{ - Exporter: telemetry.MetricExporter{ - Otlp: &telemetry.OtlpMetric{ + reader: config.MetricReader{ + Periodic: &config.PeriodicMetricReader{ + Exporter: config.MetricExporter{ + OTLP: &config.OTLPMetric{ Protocol: "grpc/protobuf", Endpoint: "http://localhost:4317", Compression: strPtr("none"), @@ -174,10 +173,10 @@ func TestMetricReader(t *testing.T) { }, { name: "periodic/otlp-grpc-exporter-no-scheme", - reader: telemetry.MetricReader{ - Periodic: &telemetry.PeriodicMetricReader{ - Exporter: telemetry.MetricExporter{ - Otlp: &telemetry.OtlpMetric{ + reader: config.MetricReader{ + Periodic: &config.PeriodicMetricReader{ + Exporter: config.MetricExporter{ + OTLP: &config.OTLPMetric{ Protocol: "grpc/protobuf", Endpoint: "localhost:4317", Compression: strPtr("gzip"), @@ -192,10 +191,10 @@ func TestMetricReader(t *testing.T) { }, { name: "periodic/otlp-grpc-invalid-endpoint", - reader: telemetry.MetricReader{ - Periodic: &telemetry.PeriodicMetricReader{ - Exporter: telemetry.MetricExporter{ - Otlp: &telemetry.OtlpMetric{ + reader: config.MetricReader{ + Periodic: &config.PeriodicMetricReader{ + Exporter: config.MetricExporter{ + OTLP: &config.OTLPMetric{ Protocol: "grpc/protobuf", Endpoint: " ", Compression: strPtr("gzip"), @@ -211,10 +210,10 @@ func TestMetricReader(t *testing.T) { }, { name: "periodic/otlp-grpc-invalid-compression", - reader: telemetry.MetricReader{ - Periodic: &telemetry.PeriodicMetricReader{ - Exporter: telemetry.MetricExporter{ - Otlp: &telemetry.OtlpMetric{ + reader: config.MetricReader{ + Periodic: &config.PeriodicMetricReader{ + Exporter: config.MetricExporter{ + OTLP: &config.OTLPMetric{ Protocol: "grpc/protobuf", Endpoint: "localhost:4317", Compression: strPtr("invalid"), @@ -230,10 +229,10 @@ func TestMetricReader(t *testing.T) { }, { name: "periodic/otlp-http-exporter", - reader: telemetry.MetricReader{ - Periodic: &telemetry.PeriodicMetricReader{ - Exporter: telemetry.MetricExporter{ - Otlp: &telemetry.OtlpMetric{ + reader: config.MetricReader{ + Periodic: &config.PeriodicMetricReader{ + Exporter: config.MetricExporter{ + OTLP: &config.OTLPMetric{ Protocol: "http/protobuf", Endpoint: "http://localhost:4318", Compression: strPtr("gzip"), @@ -248,10 +247,10 @@ func TestMetricReader(t *testing.T) { }, { name: "periodic/otlp-http-exporter-with-path", - reader: telemetry.MetricReader{ - Periodic: &telemetry.PeriodicMetricReader{ - Exporter: telemetry.MetricExporter{ - Otlp: &telemetry.OtlpMetric{ + reader: config.MetricReader{ + Periodic: &config.PeriodicMetricReader{ + Exporter: config.MetricExporter{ + OTLP: &config.OTLPMetric{ Protocol: "http/protobuf", Endpoint: "http://localhost:4318/path/123", Compression: strPtr("none"), @@ -266,10 +265,10 @@ func TestMetricReader(t *testing.T) { }, { name: "periodic/otlp-http-exporter-no-endpoint", - reader: telemetry.MetricReader{ - Periodic: &telemetry.PeriodicMetricReader{ - Exporter: telemetry.MetricExporter{ - Otlp: &telemetry.OtlpMetric{ + reader: config.MetricReader{ + Periodic: &config.PeriodicMetricReader{ + Exporter: config.MetricExporter{ + OTLP: &config.OTLPMetric{ Protocol: "http/protobuf", Compression: strPtr("gzip"), Timeout: intPtr(1000), @@ -283,10 +282,10 @@ func TestMetricReader(t *testing.T) { }, { name: "periodic/otlp-http-exporter-no-scheme", - reader: telemetry.MetricReader{ - Periodic: &telemetry.PeriodicMetricReader{ - Exporter: telemetry.MetricExporter{ - Otlp: &telemetry.OtlpMetric{ + reader: config.MetricReader{ + Periodic: &config.PeriodicMetricReader{ + Exporter: config.MetricExporter{ + OTLP: &config.OTLPMetric{ Protocol: "http/protobuf", Endpoint: "localhost:4318", Compression: strPtr("gzip"), @@ -301,10 +300,10 @@ func TestMetricReader(t *testing.T) { }, { name: "periodic/otlp-http-invalid-endpoint", - reader: telemetry.MetricReader{ - Periodic: &telemetry.PeriodicMetricReader{ - Exporter: telemetry.MetricExporter{ - Otlp: &telemetry.OtlpMetric{ + reader: config.MetricReader{ + Periodic: &config.PeriodicMetricReader{ + Exporter: config.MetricExporter{ + OTLP: &config.OTLPMetric{ Protocol: "http/protobuf", Endpoint: " ", Compression: strPtr("gzip"), @@ -320,10 +319,10 @@ func TestMetricReader(t *testing.T) { }, { name: "periodic/otlp-http-invalid-compression", - reader: telemetry.MetricReader{ - Periodic: &telemetry.PeriodicMetricReader{ - Exporter: telemetry.MetricExporter{ - Otlp: &telemetry.OtlpMetric{ + reader: config.MetricReader{ + Periodic: &config.PeriodicMetricReader{ + Exporter: config.MetricExporter{ + OTLP: &config.OTLPMetric{ Protocol: "http/protobuf", Endpoint: "localhost:4318", Compression: strPtr("invalid"), @@ -349,7 +348,7 @@ func TestMetricReader(t *testing.T) { func TestSpanProcessor(t *testing.T) { testCases := []struct { name string - processor telemetry.SpanProcessor + processor config.SpanProcessor args any err error }{ @@ -359,20 +358,20 @@ func TestSpanProcessor(t *testing.T) { }, { name: "batch processor invalid exporter", - processor: telemetry.SpanProcessor{ - Batch: &telemetry.BatchSpanProcessor{ - Exporter: telemetry.SpanExporter{}, + processor: config.SpanProcessor{ + Batch: &config.BatchSpanProcessor{ + Exporter: config.SpanExporter{}, }, }, err: errNoValidSpanExporter, }, { name: "batch processor invalid batch size console exporter", - processor: telemetry.SpanProcessor{ - Batch: &telemetry.BatchSpanProcessor{ + processor: config.SpanProcessor{ + Batch: &config.BatchSpanProcessor{ MaxExportBatchSize: intPtr(-1), - Exporter: telemetry.SpanExporter{ - Console: telemetry.Console{}, + Exporter: config.SpanExporter{ + Console: config.Console{}, }, }, }, @@ -380,11 +379,11 @@ func TestSpanProcessor(t *testing.T) { }, { name: "batch processor invalid export timeout console exporter", - processor: telemetry.SpanProcessor{ - Batch: &telemetry.BatchSpanProcessor{ + processor: config.SpanProcessor{ + Batch: &config.BatchSpanProcessor{ ExportTimeout: intPtr(-2), - Exporter: telemetry.SpanExporter{ - Console: telemetry.Console{}, + Exporter: config.SpanExporter{ + Console: config.Console{}, }, }, }, @@ -392,11 +391,11 @@ func TestSpanProcessor(t *testing.T) { }, { name: "batch processor invalid queue size console exporter", - processor: telemetry.SpanProcessor{ - Batch: &telemetry.BatchSpanProcessor{ + processor: config.SpanProcessor{ + Batch: &config.BatchSpanProcessor{ MaxQueueSize: intPtr(-3), - Exporter: telemetry.SpanExporter{ - Console: telemetry.Console{}, + Exporter: config.SpanExporter{ + Console: config.Console{}, }, }, }, @@ -404,11 +403,11 @@ func TestSpanProcessor(t *testing.T) { }, { name: "batch processor invalid schedule delay console exporter", - processor: telemetry.SpanProcessor{ - Batch: &telemetry.BatchSpanProcessor{ + processor: config.SpanProcessor{ + Batch: &config.BatchSpanProcessor{ ScheduleDelay: intPtr(-4), - Exporter: telemetry.SpanExporter{ - Console: telemetry.Console{}, + Exporter: config.SpanExporter{ + Console: config.Console{}, }, }, }, @@ -416,28 +415,28 @@ func TestSpanProcessor(t *testing.T) { }, { name: "batch processor console exporter", - processor: telemetry.SpanProcessor{ - Batch: &telemetry.BatchSpanProcessor{ + processor: config.SpanProcessor{ + Batch: &config.BatchSpanProcessor{ MaxExportBatchSize: intPtr(0), ExportTimeout: intPtr(0), MaxQueueSize: intPtr(0), ScheduleDelay: intPtr(0), - Exporter: telemetry.SpanExporter{ - Console: telemetry.Console{}, + Exporter: config.SpanExporter{ + Console: config.Console{}, }, }, }, }, { name: "batch/otlp-exporter-invalid-protocol", - processor: telemetry.SpanProcessor{ - Batch: &telemetry.BatchSpanProcessor{ + processor: config.SpanProcessor{ + Batch: &config.BatchSpanProcessor{ MaxExportBatchSize: intPtr(0), ExportTimeout: intPtr(0), MaxQueueSize: intPtr(0), ScheduleDelay: intPtr(0), - Exporter: telemetry.SpanExporter{ - Otlp: &telemetry.Otlp{ + Exporter: config.SpanExporter{ + OTLP: &config.OTLP{ Protocol: *strPtr("http/invalid"), }, }, @@ -447,14 +446,14 @@ func TestSpanProcessor(t *testing.T) { }, { name: "batch/otlp-grpc-exporter-no-endpoint", - processor: telemetry.SpanProcessor{ - Batch: &telemetry.BatchSpanProcessor{ + processor: config.SpanProcessor{ + Batch: &config.BatchSpanProcessor{ MaxExportBatchSize: intPtr(0), ExportTimeout: intPtr(0), MaxQueueSize: intPtr(0), ScheduleDelay: intPtr(0), - Exporter: telemetry.SpanExporter{ - Otlp: &telemetry.Otlp{ + Exporter: config.SpanExporter{ + OTLP: &config.OTLP{ Protocol: "grpc/protobuf", Compression: strPtr("gzip"), Timeout: intPtr(1000), @@ -468,14 +467,14 @@ func TestSpanProcessor(t *testing.T) { }, { name: "batch/otlp-grpc-exporter", - processor: telemetry.SpanProcessor{ - Batch: &telemetry.BatchSpanProcessor{ + processor: config.SpanProcessor{ + Batch: &config.BatchSpanProcessor{ MaxExportBatchSize: intPtr(0), ExportTimeout: intPtr(0), MaxQueueSize: intPtr(0), ScheduleDelay: intPtr(0), - Exporter: telemetry.SpanExporter{ - Otlp: &telemetry.Otlp{ + Exporter: config.SpanExporter{ + OTLP: &config.OTLP{ Protocol: "grpc/protobuf", Endpoint: "http://localhost:4317", Compression: strPtr("gzip"), @@ -490,14 +489,14 @@ func TestSpanProcessor(t *testing.T) { }, { name: "batch/otlp-grpc-exporter-no-scheme", - processor: telemetry.SpanProcessor{ - Batch: &telemetry.BatchSpanProcessor{ + processor: config.SpanProcessor{ + Batch: &config.BatchSpanProcessor{ MaxExportBatchSize: intPtr(0), ExportTimeout: intPtr(0), MaxQueueSize: intPtr(0), ScheduleDelay: intPtr(0), - Exporter: telemetry.SpanExporter{ - Otlp: &telemetry.Otlp{ + Exporter: config.SpanExporter{ + OTLP: &config.OTLP{ Protocol: "grpc/protobuf", Endpoint: "localhost:4317", Compression: strPtr("gzip"), @@ -512,14 +511,14 @@ func TestSpanProcessor(t *testing.T) { }, { name: "batch/otlp-grpc-invalid-endpoint", - processor: telemetry.SpanProcessor{ - Batch: &telemetry.BatchSpanProcessor{ + processor: config.SpanProcessor{ + Batch: &config.BatchSpanProcessor{ MaxExportBatchSize: intPtr(0), ExportTimeout: intPtr(0), MaxQueueSize: intPtr(0), ScheduleDelay: intPtr(0), - Exporter: telemetry.SpanExporter{ - Otlp: &telemetry.Otlp{ + Exporter: config.SpanExporter{ + OTLP: &config.OTLP{ Protocol: "grpc/protobuf", Endpoint: " ", Compression: strPtr("gzip"), @@ -535,14 +534,14 @@ func TestSpanProcessor(t *testing.T) { }, { name: "batch/otlp-grpc-invalid-compression", - processor: telemetry.SpanProcessor{ - Batch: &telemetry.BatchSpanProcessor{ + processor: config.SpanProcessor{ + Batch: &config.BatchSpanProcessor{ MaxExportBatchSize: intPtr(0), ExportTimeout: intPtr(0), MaxQueueSize: intPtr(0), ScheduleDelay: intPtr(0), - Exporter: telemetry.SpanExporter{ - Otlp: &telemetry.Otlp{ + Exporter: config.SpanExporter{ + OTLP: &config.OTLP{ Protocol: "grpc/protobuf", Endpoint: "localhost:4317", Compression: strPtr("invalid"), @@ -558,14 +557,14 @@ func TestSpanProcessor(t *testing.T) { }, { name: "batch/otlp-http-exporter", - processor: telemetry.SpanProcessor{ - Batch: &telemetry.BatchSpanProcessor{ + processor: config.SpanProcessor{ + Batch: &config.BatchSpanProcessor{ MaxExportBatchSize: intPtr(0), ExportTimeout: intPtr(0), MaxQueueSize: intPtr(0), ScheduleDelay: intPtr(0), - Exporter: telemetry.SpanExporter{ - Otlp: &telemetry.Otlp{ + Exporter: config.SpanExporter{ + OTLP: &config.OTLP{ Protocol: "http/protobuf", Endpoint: "http://localhost:4318", Compression: strPtr("gzip"), @@ -580,14 +579,14 @@ func TestSpanProcessor(t *testing.T) { }, { name: "batch/otlp-http-exporter-with-path", - processor: telemetry.SpanProcessor{ - Batch: &telemetry.BatchSpanProcessor{ + processor: config.SpanProcessor{ + Batch: &config.BatchSpanProcessor{ MaxExportBatchSize: intPtr(0), ExportTimeout: intPtr(0), MaxQueueSize: intPtr(0), ScheduleDelay: intPtr(0), - Exporter: telemetry.SpanExporter{ - Otlp: &telemetry.Otlp{ + Exporter: config.SpanExporter{ + OTLP: &config.OTLP{ Protocol: "http/protobuf", Endpoint: "http://localhost:4318/path/123", Compression: strPtr("none"), @@ -602,14 +601,14 @@ func TestSpanProcessor(t *testing.T) { }, { name: "batch/otlp-http-exporter-no-endpoint", - processor: telemetry.SpanProcessor{ - Batch: &telemetry.BatchSpanProcessor{ + processor: config.SpanProcessor{ + Batch: &config.BatchSpanProcessor{ MaxExportBatchSize: intPtr(0), ExportTimeout: intPtr(0), MaxQueueSize: intPtr(0), ScheduleDelay: intPtr(0), - Exporter: telemetry.SpanExporter{ - Otlp: &telemetry.Otlp{ + Exporter: config.SpanExporter{ + OTLP: &config.OTLP{ Protocol: "http/protobuf", Compression: strPtr("gzip"), Timeout: intPtr(1000), @@ -623,14 +622,14 @@ func TestSpanProcessor(t *testing.T) { }, { name: "batch/otlp-http-exporter-no-scheme", - processor: telemetry.SpanProcessor{ - Batch: &telemetry.BatchSpanProcessor{ + processor: config.SpanProcessor{ + Batch: &config.BatchSpanProcessor{ MaxExportBatchSize: intPtr(0), ExportTimeout: intPtr(0), MaxQueueSize: intPtr(0), ScheduleDelay: intPtr(0), - Exporter: telemetry.SpanExporter{ - Otlp: &telemetry.Otlp{ + Exporter: config.SpanExporter{ + OTLP: &config.OTLP{ Protocol: "http/protobuf", Endpoint: "localhost:4318", Compression: strPtr("gzip"), @@ -645,14 +644,14 @@ func TestSpanProcessor(t *testing.T) { }, { name: "batch/otlp-http-invalid-endpoint", - processor: telemetry.SpanProcessor{ - Batch: &telemetry.BatchSpanProcessor{ + processor: config.SpanProcessor{ + Batch: &config.BatchSpanProcessor{ MaxExportBatchSize: intPtr(0), ExportTimeout: intPtr(0), MaxQueueSize: intPtr(0), ScheduleDelay: intPtr(0), - Exporter: telemetry.SpanExporter{ - Otlp: &telemetry.Otlp{ + Exporter: config.SpanExporter{ + OTLP: &config.OTLP{ Protocol: "http/protobuf", Endpoint: " ", Compression: strPtr("gzip"), @@ -668,14 +667,14 @@ func TestSpanProcessor(t *testing.T) { }, { name: "batch/otlp-http-invalid-compression", - processor: telemetry.SpanProcessor{ - Batch: &telemetry.BatchSpanProcessor{ + processor: config.SpanProcessor{ + Batch: &config.BatchSpanProcessor{ MaxExportBatchSize: intPtr(0), ExportTimeout: intPtr(0), MaxQueueSize: intPtr(0), ScheduleDelay: intPtr(0), - Exporter: telemetry.SpanExporter{ - Otlp: &telemetry.Otlp{ + Exporter: config.SpanExporter{ + OTLP: &config.OTLP{ Protocol: "http/protobuf", Endpoint: "localhost:4318", Compression: strPtr("invalid"), diff --git a/service/telemetry.go b/service/telemetry.go index 0c51b47694f..68cbd165ac6 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -17,6 +17,7 @@ import ( ocmetric "go.opencensus.io/metric" "go.opencensus.io/metric/metricproducer" "go.opencensus.io/stats/view" + "go.opentelemetry.io/contrib/config" "go.opentelemetry.io/contrib/propagators/b3" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/metric" @@ -131,12 +132,12 @@ func (tel *telemetryInitializer) initMetrics(res *resource.Resource, logger *zap return err } if cfg.Metrics.Readers == nil { - cfg.Metrics.Readers = []telemetry.MetricReader{} + cfg.Metrics.Readers = []config.MetricReader{} } - cfg.Metrics.Readers = append(cfg.Metrics.Readers, telemetry.MetricReader{ - Pull: &telemetry.PullMetricReader{ - Exporter: telemetry.MetricExporter{ - Prometheus: &telemetry.Prometheus{ + cfg.Metrics.Readers = append(cfg.Metrics.Readers, config.MetricReader{ + Pull: &config.PullMetricReader{ + Exporter: config.MetricExporter{ + Prometheus: &config.Prometheus{ Host: &host, Port: &portInt, }, diff --git a/service/telemetry/config.go b/service/telemetry/config.go index becc1b11e38..19d9f58f18f 100644 --- a/service/telemetry/config.go +++ b/service/telemetry/config.go @@ -10,8 +10,6 @@ import ( "go.uber.org/zap/zapcore" "go.opentelemetry.io/collector/config/configtelemetry" - "go.opentelemetry.io/collector/confmap" - "go.opentelemetry.io/collector/internal/obsreportconfig" ) // Config defines the configurable settings for service telemetry. @@ -149,71 +147,3 @@ func (c *Config) Validate() error { return nil } - -func (sp *SpanProcessor) Unmarshal(conf *confmap.Conf) error { - if !obsreportconfig.UseOtelWithSDKConfigurationForInternalTelemetryFeatureGate.IsEnabled() { - // only unmarshal if feature gate is enabled - return nil - } - - if conf == nil { - return nil - } - - if err := conf.Unmarshal(sp); err != nil { - return fmt.Errorf("invalid span processor configuration: %w", err) - } - - if sp.Batch != nil { - return sp.Batch.Exporter.Validate() - } - return fmt.Errorf("unsupported span processor type %s", conf.AllKeys()) -} - -// Validate checks for valid exporters to be configured for the SpanExporter -func (se *SpanExporter) Validate() error { - if se.Console == nil && se.Otlp == nil { - return fmt.Errorf("invalid exporter configuration") - } - return nil -} - -func (mr *MetricReader) Unmarshal(conf *confmap.Conf) error { - if !obsreportconfig.UseOtelWithSDKConfigurationForInternalTelemetryFeatureGate.IsEnabled() { - // only unmarshal if feature gate is enabled - return nil - } - - if conf == nil { - return nil - } - - if err := conf.Unmarshal(mr); err != nil { - return fmt.Errorf("invalid metric reader configuration: %w", err) - } - - if mr.Pull != nil { - return mr.Pull.Validate() - } - if mr.Periodic != nil { - return mr.Periodic.Validate() - } - - return fmt.Errorf("unsupported metric reader type %s", conf.AllKeys()) -} - -// Validate checks for valid exporters to be configured for the PullMetricReader -func (pmr *PullMetricReader) Validate() error { - if pmr.Exporter.Prometheus == nil { - return fmt.Errorf("invalid exporter configuration") - } - return nil -} - -// Validate checks for valid exporters to be configured for the PeriodicMetricReader -func (pmr *PeriodicMetricReader) Validate() error { - if pmr.Exporter.Otlp == nil && pmr.Exporter.Console == nil { - return fmt.Errorf("invalid exporter configuration") - } - return nil -} diff --git a/service/telemetry/config_test.go b/service/telemetry/config_test.go index 8af1616fb92..f08a8c9226d 100644 --- a/service/telemetry/config_test.go +++ b/service/telemetry/config_test.go @@ -7,12 +7,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/config/configtelemetry" - "go.opentelemetry.io/collector/confmap" - "go.opentelemetry.io/collector/featuregate" - "go.opentelemetry.io/collector/internal/obsreportconfig" ) func TestLoadConfig(t *testing.T) { @@ -66,178 +62,3 @@ func TestLoadConfig(t *testing.T) { }) } } - -// Force the state of feature gate for a test -func setFeatureGateForTest(t testing.TB, gate *featuregate.Gate, enabled bool) func() { - originalValue := gate.IsEnabled() - require.NoError(t, featuregate.GlobalRegistry().Set(gate.ID(), enabled)) - return func() { - require.NoError(t, featuregate.GlobalRegistry().Set(gate.ID(), originalValue)) - } -} - -func TestUnmarshalMetricReaderWithGateOff(t *testing.T) { - defer setFeatureGateForTest(t, obsreportconfig.UseOtelWithSDKConfigurationForInternalTelemetryFeatureGate, false)() - reader := MetricReader{} - assert.NoError(t, reader.Unmarshal(confmap.NewFromStringMap(map[string]any{"invalid": "invalid"}))) -} - -func TestUnmarshalMetricReader(t *testing.T) { - defer setFeatureGateForTest(t, obsreportconfig.UseOtelWithSDKConfigurationForInternalTelemetryFeatureGate, true)() - tests := []struct { - name string - cfg *confmap.Conf - err string - }{ - { - name: "invalid config", - cfg: confmap.NewFromStringMap(map[string]any{"invalid": "invalid"}), - err: "unsupported metric reader type [invalid]", - }, - { - name: "nil config, nothing to do", - }, - { - name: "invalid pull reader type with valid prometheus exporter", - cfg: confmap.NewFromStringMap(map[string]any{"pull/prometheus1": PullMetricReader{ - Exporter: MetricExporter{ - Prometheus: &Prometheus{}, - }, - }}), - err: "unsupported metric reader type [pull/prometheus1]", - }, - { - name: "valid reader type, invalid config", - cfg: confmap.NewFromStringMap(map[string]any{"pull": "garbage"}), - err: "invalid metric reader configuration", - }, - { - name: "valid pull reader type, no exporter", - cfg: confmap.NewFromStringMap(map[string]any{"pull": PullMetricReader{}}), - err: "invalid exporter configuration", - }, - { - name: "valid pull reader type, invalid exporter", - cfg: confmap.NewFromStringMap(map[string]any{"pull": PullMetricReader{ - Exporter: MetricExporter{ - Prometheus: nil, - }, - }}), - err: "invalid exporter configuration", - }, - { - name: "valid pull reader type, valid prometheus exporter", - cfg: confmap.NewFromStringMap(map[string]any{"pull": PullMetricReader{ - Exporter: MetricExporter{ - Prometheus: &Prometheus{}, - }, - }}), - }, - { - name: "valid periodic reader type, valid console exporter", - cfg: confmap.NewFromStringMap(map[string]any{"periodic": PeriodicMetricReader{ - Exporter: MetricExporter{ - Console: Console{}, - }, - }}), - }, - { - name: "valid periodic reader type, invalid console exporter", - cfg: confmap.NewFromStringMap(map[string]any{"periodic": PeriodicMetricReader{ - Exporter: MetricExporter{ - Prometheus: &Prometheus{}, - }, - }}), - err: "invalid exporter configuration", - }, - { - name: "valid periodic reader type, valid otlp exporter", - cfg: confmap.NewFromStringMap(map[string]any{"periodic": PeriodicMetricReader{ - Exporter: MetricExporter{ - Otlp: &OtlpMetric{}, - }, - }}), - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - reader := MetricReader{} - err := reader.Unmarshal(tt.cfg) - if len(tt.err) > 0 { - assert.ErrorContains(t, err, tt.err) - } else { - assert.NoError(t, err) - } - }) - } -} - -func TestUnmarshalSpanProcessorWithGateOff(t *testing.T) { - defer setFeatureGateForTest(t, obsreportconfig.UseOtelWithSDKConfigurationForInternalTelemetryFeatureGate, false)() - sp := SpanProcessor{} - assert.NoError(t, sp.Unmarshal(confmap.NewFromStringMap(map[string]any{"invalid": "invalid"}))) -} - -func TestUnmarshalSpanProcessor(t *testing.T) { - defer setFeatureGateForTest(t, obsreportconfig.UseOtelWithSDKConfigurationForInternalTelemetryFeatureGate, true)() - tests := []struct { - name string - cfg *confmap.Conf - err string - }{ - { - name: "invalid config", - cfg: confmap.NewFromStringMap(map[string]any{"invalid": "invalid"}), - err: "unsupported span processor type [invalid]", - }, - { - name: "nil config, nothing to do", - }, - { - name: "invalid batch processor type with valid console exporter", - cfg: confmap.NewFromStringMap(map[string]any{"thing": BatchSpanProcessor{ - Exporter: SpanExporter{ - Console: Console{}, - }, - }}), - err: "unsupported span processor type [thing]", - }, - { - name: "valid batch processor, invalid config", - cfg: confmap.NewFromStringMap(map[string]any{"batch": "garbage"}), - err: "invalid span processor configuration", - }, - { - name: "valid batch processor, no exporter", - cfg: confmap.NewFromStringMap(map[string]any{"batch": BatchSpanProcessor{}}), - err: "invalid exporter configuration", - }, - { - name: "valid batch processor, valid console exporter", - cfg: confmap.NewFromStringMap(map[string]any{"batch": BatchSpanProcessor{ - Exporter: SpanExporter{ - Console: Console{}, - }, - }}), - }, - { - name: "valid batch processor type, valid otlp exporter", - cfg: confmap.NewFromStringMap(map[string]any{"batch": BatchSpanProcessor{ - Exporter: SpanExporter{ - Otlp: &Otlp{}, - }, - }}), - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - processor := SpanProcessor{} - err := processor.Unmarshal(tt.cfg) - if len(tt.err) > 0 { - assert.ErrorContains(t, err, tt.err) - } else { - assert.NoError(t, err) - } - }) - } -} diff --git a/service/telemetry/generated_config.go b/service/telemetry/generated_config.go index 340d9aac766..fc1b20885a2 100644 --- a/service/telemetry/generated_config.go +++ b/service/telemetry/generated_config.go @@ -3,575 +3,116 @@ package telemetry import ( - "encoding/json" - "fmt" + "go.opentelemetry.io/contrib/config" ) -type Attributes struct { - // ServiceName corresponds to the JSON schema field "service.name". - ServiceName *string `mapstructure:"service.name,omitempty"` -} +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".Attributes instead. +type Attributes = config.Attributes -type BatchLogRecordProcessor struct { - // ExportTimeout corresponds to the JSON schema field "export_timeout". - ExportTimeout *int `mapstructure:"export_timeout,omitempty"` +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".BatchLogRecordProcessor instead. +type BatchLogRecordProcessor = config.BatchLogRecordProcessor - // Exporter corresponds to the JSON schema field "exporter". - Exporter LogRecordExporter `mapstructure:"exporter"` +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".BatchSpanProcessor instead. +type BatchSpanProcessor = config.BatchSpanProcessor - // MaxExportBatchSize corresponds to the JSON schema field - // "max_export_batch_size". - MaxExportBatchSize *int `mapstructure:"max_export_batch_size,omitempty"` +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".Common instead. +type CommonJson = config.Common - // MaxQueueSize corresponds to the JSON schema field "max_queue_size". - MaxQueueSize *int `mapstructure:"max_queue_size,omitempty"` +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".Console instead. +type Console = config.Console - // ScheduleDelay corresponds to the JSON schema field "schedule_delay". - ScheduleDelay *int `mapstructure:"schedule_delay,omitempty"` -} +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".Headers instead. +type Headers = config.Headers -type BatchSpanProcessor struct { - // ExportTimeout corresponds to the JSON schema field "export_timeout". - ExportTimeout *int `mapstructure:"export_timeout,omitempty"` +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".LogRecordExporter instead. +type LogRecordExporter = config.LogRecordExporter - // Exporter corresponds to the JSON schema field "exporter". - Exporter SpanExporter `mapstructure:"exporter"` +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".LogRecordLimits instead. +type LogRecordLimits = config.LogRecordLimits - // MaxExportBatchSize corresponds to the JSON schema field - // "max_export_batch_size". - MaxExportBatchSize *int `mapstructure:"max_export_batch_size,omitempty"` +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".LogRecordProcessor instead. +type LogRecordProcessor = config.LogRecordProcessor - // MaxQueueSize corresponds to the JSON schema field "max_queue_size". - MaxQueueSize *int `mapstructure:"max_queue_size,omitempty"` +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".LoggerProvider instead. +type LoggerProviderJson = config.LoggerProvider - // ScheduleDelay corresponds to the JSON schema field "schedule_delay". - ScheduleDelay *int `mapstructure:"schedule_delay,omitempty"` -} +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".MeterProvider instead. +type MeterProviderJson = config.MeterProvider -type CommonJson map[string]interface{} +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".MetricExporter instead. +type MetricExporter = config.MetricExporter -type Console map[string]interface{} +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".MetricReader instead. +type MetricReader = config.MetricReader -type Headers map[string]string +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".OTLP instead. +type Otlp = config.OTLP -type LogRecordExporter struct { - // Otlp corresponds to the JSON schema field "otlp". - Otlp *Otlp `mapstructure:"otlp,omitempty"` -} +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".OTLPMetric instead. +type OtlpMetric = config.OTLPMetric -type LogRecordLimits struct { - // AttributeCountLimit corresponds to the JSON schema field - // "attribute_count_limit". - AttributeCountLimit *int `mapstructure:"attribute_count_limit,omitempty"` +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".PeriodicMetricReader instead. +type PeriodicMetricReader = config.PeriodicMetricReader - // AttributeValueLengthLimit corresponds to the JSON schema field - // "attribute_value_length_limit". - AttributeValueLengthLimit *int `mapstructure:"attribute_value_length_limit,omitempty"` -} +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".Prometheus instead. +type Prometheus = config.Prometheus -type LogRecordProcessor struct { - // Batch corresponds to the JSON schema field "batch". - Batch *BatchLogRecordProcessor `mapstructure:"batch,omitempty"` +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".PullMetricReader instead. +type PullMetricReader = config.PullMetricReader - // Simple corresponds to the JSON schema field "simple". - Simple *SimpleLogRecordProcessor `mapstructure:"simple,omitempty"` -} +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".Resource instead. +type ResourceJson = config.Resource -type LoggerProviderJson struct { - // Limits corresponds to the JSON schema field "limits". - Limits *LogRecordLimits `mapstructure:"limits,omitempty"` +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".Sampler instead. +type Sampler = config.Sampler - // Processors corresponds to the JSON schema field "processors". - Processors []LogRecordProcessor `mapstructure:"processors,omitempty"` -} +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".SamplerAlwaysOff instead. +type SamplerAlwaysOff = config.SamplerAlwaysOff -type MeterProviderJson struct { - // Readers corresponds to the JSON schema field "readers". - Readers []MetricReader `mapstructure:"readers,omitempty"` +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".SamplerAlwaysOn instead. +type SamplerAlwaysOn = config.SamplerAlwaysOn - // Views corresponds to the JSON schema field "views". - Views []View `mapstructure:"views,omitempty"` -} +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".ViewStreamAggregationExplicitBucketHistogram instead. +type ViewStreamAggregationExplicitBucketHistogram = config.ViewStreamAggregationExplicitBucketHistogram -type MetricExporter struct { - // Console corresponds to the JSON schema field "console". - Console Console `mapstructure:"console,omitempty"` +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".ViewStreamAggregationBase2ExponentialBucketHistogram instead. +type ViewStreamAggregationExponentialBucketHistogram = config.ViewStreamAggregationBase2ExponentialBucketHistogram - // Otlp corresponds to the JSON schema field "otlp". - Otlp *OtlpMetric `mapstructure:"otlp,omitempty"` +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".ViewStreamAggregation instead. +type ViewStreamAggregation = config.ViewStreamAggregation - // Prometheus corresponds to the JSON schema field "prometheus". - Prometheus *Prometheus `mapstructure:"prometheus,omitempty"` -} +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".ViewStream instead. +type ViewStream = config.ViewStream -type MetricReader struct { - // Periodic corresponds to the JSON schema field "periodic". - Periodic *PeriodicMetricReader `mapstructure:"periodic,omitempty"` +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".View instead. +type View = config.View - // Pull corresponds to the JSON schema field "pull". - Pull *PullMetricReader `mapstructure:"pull,omitempty"` -} +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".SpanExporter instead. +type SpanExporter = config.SpanExporter -type Otlp struct { - // Certificate corresponds to the JSON schema field "certificate". - Certificate *string `mapstructure:"certificate,omitempty"` +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".ViewSelector instead. +type ViewSelector = config.ViewSelector - // ClientCertificate corresponds to the JSON schema field "client_certificate". - ClientCertificate *string `mapstructure:"client_certificate,omitempty"` +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".SimpleLogRecordProcessor instead. +type SimpleLogRecordProcessor = config.SimpleLogRecordProcessor - // ClientKey corresponds to the JSON schema field "client_key". - ClientKey *string `mapstructure:"client_key,omitempty"` +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".SamplerJaegerRemote instead. +type SamplerJaegerRemote = config.SamplerJaegerRemote - // Compression corresponds to the JSON schema field "compression". - Compression *string `mapstructure:"compression,omitempty"` +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".SamplerParentBased instead. +type SamplerParentBased = config.SamplerParentBased - // Endpoint corresponds to the JSON schema field "endpoint". - Endpoint string `mapstructure:"endpoint"` +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".SamplerTraceIDRatioBased instead. +type SamplerTraceIdRatioBased = config.SamplerTraceIDRatioBased - // Headers corresponds to the JSON schema field "headers". - Headers Headers `mapstructure:"headers,omitempty"` +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".SimpleSpanProcessor instead. +type SimpleSpanProcessor = config.SimpleSpanProcessor - // Protocol corresponds to the JSON schema field "protocol". - Protocol string `mapstructure:"protocol"` +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".SpanLimits instead. +type SpanLimits = config.SpanLimits - // Timeout corresponds to the JSON schema field "timeout". - Timeout *int `mapstructure:"timeout,omitempty"` -} +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".SpanProcessor instead. +type SpanProcessor = config.SpanProcessor -type OtlpMetric struct { - // Certificate corresponds to the JSON schema field "certificate". - Certificate *string `mapstructure:"certificate,omitempty"` - - // ClientCertificate corresponds to the JSON schema field "client_certificate". - ClientCertificate *string `mapstructure:"client_certificate,omitempty"` - - // ClientKey corresponds to the JSON schema field "client_key". - ClientKey *string `mapstructure:"client_key,omitempty"` - - // Compression corresponds to the JSON schema field "compression". - Compression *string `mapstructure:"compression,omitempty"` - - // DefaultHistogramAggregation corresponds to the JSON schema field - // "default_histogram_aggregation". - DefaultHistogramAggregation *string `mapstructure:"default_histogram_aggregation,omitempty"` - - // Endpoint corresponds to the JSON schema field "endpoint". - Endpoint string `mapstructure:"endpoint"` - - // Headers corresponds to the JSON schema field "headers". - Headers Headers `mapstructure:"headers,omitempty"` - - // Protocol corresponds to the JSON schema field "protocol". - Protocol string `mapstructure:"protocol"` - - // TemporalityPreference corresponds to the JSON schema field - // "temporality_preference". - TemporalityPreference *string `mapstructure:"temporality_preference,omitempty"` - - // Timeout corresponds to the JSON schema field "timeout". - Timeout *int `mapstructure:"timeout,omitempty"` -} - -type PeriodicMetricReader struct { - // Exporter corresponds to the JSON schema field "exporter". - Exporter MetricExporter `mapstructure:"exporter"` - - // Interval corresponds to the JSON schema field "interval". - Interval *int `mapstructure:"interval,omitempty"` - - // Timeout corresponds to the JSON schema field "timeout". - Timeout *int `mapstructure:"timeout,omitempty"` -} - -type Prometheus struct { - // Host corresponds to the JSON schema field "host". - Host *string `mapstructure:"host,omitempty"` - - // Port corresponds to the JSON schema field "port". - Port *int `mapstructure:"port,omitempty"` -} - -type PullMetricReader struct { - // Exporter corresponds to the JSON schema field "exporter". - Exporter MetricExporter `mapstructure:"exporter"` -} - -type ResourceJson struct { - // Attributes corresponds to the JSON schema field "attributes". - Attributes *Attributes `mapstructure:"attributes,omitempty"` -} - -type Sampler struct { - // AlwaysOff corresponds to the JSON schema field "always_off". - AlwaysOff SamplerAlwaysOff `mapstructure:"always_off,omitempty"` - - // AlwaysOn corresponds to the JSON schema field "always_on". - AlwaysOn SamplerAlwaysOn `mapstructure:"always_on,omitempty"` - - // JaegerRemote corresponds to the JSON schema field "jaeger_remote". - JaegerRemote *SamplerJaegerRemote `mapstructure:"jaeger_remote,omitempty"` - - // ParentBased corresponds to the JSON schema field "parent_based". - ParentBased *SamplerParentBased `mapstructure:"parent_based,omitempty"` - - // TraceIdRatioBased corresponds to the JSON schema field "trace_id_ratio_based". - TraceIdRatioBased *SamplerTraceIdRatioBased `mapstructure:"trace_id_ratio_based,omitempty"` -} - -type SamplerAlwaysOff map[string]interface{} - -type SamplerAlwaysOn map[string]interface{} - -// UnmarshalJSON implements json.Unmarshaler. -func (j *BatchSpanProcessor) UnmarshalJSON(b []byte) error { - var raw map[string]interface{} - if err := json.Unmarshal(b, &raw); err != nil { - return err - } - if v, ok := raw["exporter"]; !ok || v == nil { - return fmt.Errorf("field exporter in BatchSpanProcessor: required") - } - type Plain BatchSpanProcessor - var plain Plain - if err := json.Unmarshal(b, &plain); err != nil { - return err - } - *j = BatchSpanProcessor(plain) - return nil -} - -type ViewStreamAggregationExplicitBucketHistogram struct { - // Boundaries corresponds to the JSON schema field "boundaries". - Boundaries []float64 `mapstructure:"boundaries,omitempty"` - - // RecordMinMax corresponds to the JSON schema field "record_min_max". - RecordMinMax *bool `mapstructure:"record_min_max,omitempty"` -} - -type ViewStreamAggregationExponentialBucketHistogram struct { - // MaxScale corresponds to the JSON schema field "max_scale". - MaxScale *int `mapstructure:"max_scale,omitempty"` - - // MaxSize corresponds to the JSON schema field "max_size". - MaxSize *int `mapstructure:"max_size,omitempty"` - - // RecordMinMax corresponds to the JSON schema field "record_min_max". - RecordMinMax *bool `mapstructure:"record_min_max,omitempty"` -} - -type ViewStreamAggregation struct { - // Default corresponds to the JSON schema field "default". - Default interface{} `mapstructure:"default,omitempty"` - - // Drop corresponds to the JSON schema field "drop". - Drop interface{} `mapstructure:"drop,omitempty"` - - // ExplicitBucketHistogram corresponds to the JSON schema field - // "explicit_bucket_histogram". - ExplicitBucketHistogram *ViewStreamAggregationExplicitBucketHistogram `mapstructure:"explicit_bucket_histogram,omitempty"` - - // ExponentialBucketHistogram corresponds to the JSON schema field - // "exponential_bucket_histogram". - ExponentialBucketHistogram *ViewStreamAggregationExponentialBucketHistogram `mapstructure:"exponential_bucket_histogram,omitempty"` - - // LastValue corresponds to the JSON schema field "last_value". - LastValue interface{} `mapstructure:"last_value,omitempty"` - - // Sum corresponds to the JSON schema field "sum". - Sum interface{} `mapstructure:"sum,omitempty"` -} - -// UnmarshalJSON implements json.Unmarshaler. -func (j *ViewStreamAggregation) UnmarshalJSON(b []byte) error { - var raw map[string]interface{} - if err := json.Unmarshal(b, &raw); err != nil { - return err - } - type Plain ViewStreamAggregation - var plain Plain - if err := json.Unmarshal(b, &plain); err != nil { - return err - } - if plain.Default != nil { - return fmt.Errorf("field %s: must be null", "default") - } - if plain.Drop != nil { - return fmt.Errorf("field %s: must be null", "drop") - } - if plain.LastValue != nil { - return fmt.Errorf("field %s: must be null", "last_value") - } - if plain.Sum != nil { - return fmt.Errorf("field %s: must be null", "sum") - } - *j = ViewStreamAggregation(plain) - return nil -} - -type ViewStream struct { - // Aggregation corresponds to the JSON schema field "aggregation". - Aggregation *ViewStreamAggregation `mapstructure:"aggregation,omitempty"` - - // AttributeKeys corresponds to the JSON schema field "attribute_keys". - AttributeKeys []string `mapstructure:"attribute_keys,omitempty"` - - // Description corresponds to the JSON schema field "description". - Description *string `mapstructure:"description,omitempty"` - - // Name corresponds to the JSON schema field "name". - Name *string `mapstructure:"name,omitempty"` -} - -type View struct { - // Selector corresponds to the JSON schema field "selector". - Selector *ViewSelector `mapstructure:"selector,omitempty"` - - // Stream corresponds to the JSON schema field "stream". - Stream *ViewStream `mapstructure:"stream,omitempty"` -} - -// UnmarshalJSON implements json.Unmarshaler. -func (j *PullMetricReader) UnmarshalJSON(b []byte) error { - var raw map[string]interface{} - if err := json.Unmarshal(b, &raw); err != nil { - return err - } - if v, ok := raw["exporter"]; !ok || v == nil { - return fmt.Errorf("field exporter in PullMetricReader: required") - } - type Plain PullMetricReader - var plain Plain - if err := json.Unmarshal(b, &plain); err != nil { - return err - } - *j = PullMetricReader(plain) - return nil -} - -// UnmarshalJSON implements json.Unmarshaler. -func (j *Otlp) UnmarshalJSON(b []byte) error { - var raw map[string]interface{} - if err := json.Unmarshal(b, &raw); err != nil { - return err - } - if v, ok := raw["endpoint"]; !ok || v == nil { - return fmt.Errorf("field endpoint in Otlp: required") - } - if v, ok := raw["protocol"]; !ok || v == nil { - return fmt.Errorf("field protocol in Otlp: required") - } - type Plain Otlp - var plain Plain - if err := json.Unmarshal(b, &plain); err != nil { - return err - } - *j = Otlp(plain) - return nil -} - -// UnmarshalJSON implements json.Unmarshaler. -func (j *PeriodicMetricReader) UnmarshalJSON(b []byte) error { - var raw map[string]interface{} - if err := json.Unmarshal(b, &raw); err != nil { - return err - } - if v, ok := raw["exporter"]; !ok || v == nil { - return fmt.Errorf("field exporter in PeriodicMetricReader: required") - } - type Plain PeriodicMetricReader - var plain Plain - if err := json.Unmarshal(b, &plain); err != nil { - return err - } - *j = PeriodicMetricReader(plain) - return nil -} - -type SpanExporter struct { - // Console corresponds to the JSON schema field "console". - Console Console `mapstructure:"console,omitempty"` - - // Otlp corresponds to the JSON schema field "otlp". - Otlp *Otlp `mapstructure:"otlp,omitempty"` -} - -// UnmarshalJSON implements json.Unmarshaler. -func (j *OtlpMetric) UnmarshalJSON(b []byte) error { - var raw map[string]interface{} - if err := json.Unmarshal(b, &raw); err != nil { - return err - } - if v, ok := raw["endpoint"]; !ok || v == nil { - return fmt.Errorf("field endpoint in OtlpMetric: required") - } - if v, ok := raw["protocol"]; !ok || v == nil { - return fmt.Errorf("field protocol in OtlpMetric: required") - } - type Plain OtlpMetric - var plain Plain - if err := json.Unmarshal(b, &plain); err != nil { - return err - } - *j = OtlpMetric(plain) - return nil -} - -type ViewSelector struct { - // InstrumentName corresponds to the JSON schema field "instrument_name". - InstrumentName *string `mapstructure:"instrument_name,omitempty"` - - // InstrumentType corresponds to the JSON schema field "instrument_type". - InstrumentType *string `mapstructure:"instrument_type,omitempty"` - - // MeterName corresponds to the JSON schema field "meter_name". - MeterName *string `mapstructure:"meter_name,omitempty"` - - // MeterSchemaUrl corresponds to the JSON schema field "meter_schema_url". - MeterSchemaUrl *string `mapstructure:"meter_schema_url,omitempty"` - - // MeterVersion corresponds to the JSON schema field "meter_version". - MeterVersion *string `mapstructure:"meter_version,omitempty"` -} - -// UnmarshalJSON implements json.Unmarshaler. -func (j *BatchLogRecordProcessor) UnmarshalJSON(b []byte) error { - var raw map[string]interface{} - if err := json.Unmarshal(b, &raw); err != nil { - return err - } - if v, ok := raw["exporter"]; !ok || v == nil { - return fmt.Errorf("field exporter in BatchLogRecordProcessor: required") - } - type Plain BatchLogRecordProcessor - var plain Plain - if err := json.Unmarshal(b, &plain); err != nil { - return err - } - *j = BatchLogRecordProcessor(plain) - return nil -} - -type SimpleLogRecordProcessor struct { - // Exporter corresponds to the JSON schema field "exporter". - Exporter LogRecordExporter `mapstructure:"exporter"` -} - -type SamplerJaegerRemote struct { - // Endpoint corresponds to the JSON schema field "endpoint". - Endpoint *string `mapstructure:"endpoint,omitempty"` - - // InitialSampler corresponds to the JSON schema field "initial_sampler". - InitialSampler *Sampler `mapstructure:"initial_sampler,omitempty"` - - // Interval corresponds to the JSON schema field "interval". - Interval *int `mapstructure:"interval,omitempty"` -} - -type SamplerParentBased struct { - // LocalParentNotSampled corresponds to the JSON schema field - // "local_parent_not_sampled". - LocalParentNotSampled *Sampler `mapstructure:"local_parent_not_sampled,omitempty"` - - // LocalParentSampled corresponds to the JSON schema field "local_parent_sampled". - LocalParentSampled *Sampler `mapstructure:"local_parent_sampled,omitempty"` - - // RemoteParentNotSampled corresponds to the JSON schema field - // "remote_parent_not_sampled". - RemoteParentNotSampled *Sampler `mapstructure:"remote_parent_not_sampled,omitempty"` - - // RemoteParentSampled corresponds to the JSON schema field - // "remote_parent_sampled". - RemoteParentSampled *Sampler `mapstructure:"remote_parent_sampled,omitempty"` - - // Root corresponds to the JSON schema field "root". - Root *Sampler `mapstructure:"root,omitempty"` -} - -type SamplerTraceIdRatioBased struct { - // Ratio corresponds to the JSON schema field "ratio". - Ratio *float64 `mapstructure:"ratio,omitempty"` -} - -// UnmarshalJSON implements json.Unmarshaler. -func (j *SimpleLogRecordProcessor) UnmarshalJSON(b []byte) error { - var raw map[string]interface{} - if err := json.Unmarshal(b, &raw); err != nil { - return err - } - if v, ok := raw["exporter"]; !ok || v == nil { - return fmt.Errorf("field exporter in SimpleLogRecordProcessor: required") - } - type Plain SimpleLogRecordProcessor - var plain Plain - if err := json.Unmarshal(b, &plain); err != nil { - return err - } - *j = SimpleLogRecordProcessor(plain) - return nil -} - -type SimpleSpanProcessor struct { - // Exporter corresponds to the JSON schema field "exporter". - Exporter SpanExporter `mapstructure:"exporter"` -} - -// UnmarshalJSON implements json.Unmarshaler. -func (j *SimpleSpanProcessor) UnmarshalJSON(b []byte) error { - var raw map[string]interface{} - if err := json.Unmarshal(b, &raw); err != nil { - return err - } - if v, ok := raw["exporter"]; !ok || v == nil { - return fmt.Errorf("field exporter in SimpleSpanProcessor: required") - } - type Plain SimpleSpanProcessor - var plain Plain - if err := json.Unmarshal(b, &plain); err != nil { - return err - } - *j = SimpleSpanProcessor(plain) - return nil -} - -type SpanLimits struct { - // AttributeCountLimit corresponds to the JSON schema field - // "attribute_count_limit". - AttributeCountLimit *int `mapstructure:"attribute_count_limit,omitempty"` - - // AttributeValueLengthLimit corresponds to the JSON schema field - // "attribute_value_length_limit". - AttributeValueLengthLimit *int `mapstructure:"attribute_value_length_limit,omitempty"` - - // EventAttributeCountLimit corresponds to the JSON schema field - // "event_attribute_count_limit". - EventAttributeCountLimit *int `mapstructure:"event_attribute_count_limit,omitempty"` - - // EventCountLimit corresponds to the JSON schema field "event_count_limit". - EventCountLimit *int `mapstructure:"event_count_limit,omitempty"` - - // LinkAttributeCountLimit corresponds to the JSON schema field - // "link_attribute_count_limit". - LinkAttributeCountLimit *int `mapstructure:"link_attribute_count_limit,omitempty"` - - // LinkCountLimit corresponds to the JSON schema field "link_count_limit". - LinkCountLimit *int `mapstructure:"link_count_limit,omitempty"` -} - -type SpanProcessor struct { - // Batch corresponds to the JSON schema field "batch". - Batch *BatchSpanProcessor `mapstructure:"batch,omitempty"` - - // Simple corresponds to the JSON schema field "simple". - Simple *SimpleSpanProcessor `mapstructure:"simple,omitempty"` -} - -type TracerProviderJson struct { - // Limits corresponds to the JSON schema field "limits". - Limits *SpanLimits `mapstructure:"limits,omitempty"` - - // Processors corresponds to the JSON schema field "processors". - Processors []SpanProcessor `mapstructure:"processors,omitempty"` - - // Sampler corresponds to the JSON schema field "sampler". - Sampler *Sampler `mapstructure:"sampler,omitempty"` -} +// Deprecated: [v0.90.0] Use "go.opentelemetry.io/contrib/config".TracerProvider instead. +type TracerProviderJson = config.TracerProvider diff --git a/service/telemetry_test.go b/service/telemetry_test.go index e22c7c88fd4..c7169190b58 100644 --- a/service/telemetry_test.go +++ b/service/telemetry_test.go @@ -15,6 +15,7 @@ import ( "github.com/stretchr/testify/require" "go.opencensus.io/stats" "go.opencensus.io/stats/view" + "go.opentelemetry.io/contrib/config" "go.opentelemetry.io/otel/metric" "go.uber.org/zap" @@ -197,11 +198,11 @@ func TestTelemetryInit(t *testing.T) { Level: configtelemetry.LevelDetailed, }, Traces: telemetry.TracesConfig{ - Processors: []telemetry.SpanProcessor{ + Processors: []config.SpanProcessor{ { - Batch: &telemetry.BatchSpanProcessor{ - Exporter: telemetry.SpanExporter{ - Console: telemetry.Console{}, + Batch: &config.BatchSpanProcessor{ + Exporter: config.SpanExporter{ + Console: config.Console{}, }, }, }, @@ -250,10 +251,10 @@ func TestTelemetryInit(t *testing.T) { tel := newColTelemetry(tc.useOtel, tc.disableHighCard, tc.extendedConfig) buildInfo := component.NewDefaultBuildInfo() if tc.extendedConfig { - tc.cfg.Metrics.Readers = []telemetry.MetricReader{ + tc.cfg.Metrics.Readers = []config.MetricReader{ { - Pull: &telemetry.PullMetricReader{ - Exporter: telemetry.MetricExporter{ + Pull: &config.PullMetricReader{ + Exporter: config.MetricExporter{ Prometheus: testutil.GetAvailableLocalAddressPrometheus(t), }, },