From dd261c0b155130c40debc1bac3ca7f3d4d6b6640 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Mon, 11 Jul 2022 06:52:36 -0700 Subject: [PATCH 01/38] Enable propagation of the trace context from collector --- cmd/otelcorecol/go.mod | 11 ++++++++--- cmd/otelcorecol/go.sum | 19 ++++++++++++++++--- go.mod | 11 ++++++++--- go.sum | 19 ++++++++++++++++--- service/service.go | 6 ++++++ service/telemetry/config.go | 10 ++++++++++ 6 files changed, 64 insertions(+), 12 deletions(-) diff --git a/cmd/otelcorecol/go.mod b/cmd/otelcorecol/go.mod index a26c6b978c3..bd754b7ba93 100644 --- a/cmd/otelcorecol/go.mod +++ b/cmd/otelcorecol/go.mod @@ -59,13 +59,18 @@ require ( go.opentelemetry.io/collector/semconv v0.54.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.32.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0 // indirect + go.opentelemetry.io/contrib/propagators/autoprop v0.33.0 // indirect + go.opentelemetry.io/contrib/propagators/aws v1.8.0 // indirect + go.opentelemetry.io/contrib/propagators/b3 v1.8.0 // indirect + go.opentelemetry.io/contrib/propagators/jaeger v1.8.0 // indirect + go.opentelemetry.io/contrib/propagators/ot v1.8.0 // indirect go.opentelemetry.io/contrib/zpages v0.32.0 // indirect - go.opentelemetry.io/otel v1.7.0 // indirect + go.opentelemetry.io/otel v1.8.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.30.0 // indirect go.opentelemetry.io/otel/metric v0.30.0 // indirect - go.opentelemetry.io/otel/sdk v1.7.0 // indirect + go.opentelemetry.io/otel/sdk v1.8.0 // indirect go.opentelemetry.io/otel/sdk/metric v0.30.0 // indirect - go.opentelemetry.io/otel/trace v1.7.0 // indirect + go.opentelemetry.io/otel/trace v1.8.0 // indirect go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.21.0 // indirect diff --git a/cmd/otelcorecol/go.sum b/cmd/otelcorecol/go.sum index cdd6d31d0cb..803e38b8ba8 100644 --- a/cmd/otelcorecol/go.sum +++ b/cmd/otelcorecol/go.sum @@ -393,20 +393,33 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.3 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.32.0/go.mod h1:J0dBVrt7dPS/lKJyQoW0xzQiUr4r2Ik1VwPjAUWnofI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0 h1:mac9BKRqwaX6zxHPDe3pvmWpwuuIM0vuXv2juCnQevE= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0/go.mod h1:5eCOqeGphOyz6TsY3ZDNjE33SM/TFAK3RGuCL2naTgY= +go.opentelemetry.io/contrib/propagators/autoprop v0.33.0 h1:vYrciMtw1n9n7OeZ3OF51fORYEGjfHXt7JSbSmgxJsg= +go.opentelemetry.io/contrib/propagators/autoprop v0.33.0/go.mod h1:m1BVaXLEU1iSomaBqQ0tGcEfAQVMD6FI7yGLq5h4rIA= +go.opentelemetry.io/contrib/propagators/aws v1.8.0 h1:Ky4pY6IKdGPPSEv/ffkA1/LRBIpz4ohhuOhrk545YQk= +go.opentelemetry.io/contrib/propagators/aws v1.8.0/go.mod h1:0ptHDgrpjxekjXayHNG0fTUdFnehgJVQlDk4P7hfDKM= +go.opentelemetry.io/contrib/propagators/b3 v1.8.0 h1:l6+IOjo7VzRWuYeKM/uDUkKOQvG22jDV3l8zs9+f1w0= +go.opentelemetry.io/contrib/propagators/b3 v1.8.0/go.mod h1:fqKNRj1Bkecfq8v1T1H0q5di1ZHZK8fuSNpVn56tlAU= +go.opentelemetry.io/contrib/propagators/jaeger v1.8.0 h1:Qmaw0Uwaw+iRL4U8eU+gP07xctL1IfXxvZH7Hy72rIE= +go.opentelemetry.io/contrib/propagators/jaeger v1.8.0/go.mod h1:uC5cTyLIJO4cZXDdx2QE/BMhO4NCUua9pXmF5F5VMP0= +go.opentelemetry.io/contrib/propagators/ot v1.8.0 h1:LJRQci6KUNa6Rtcn27c0QX0B3d10HSyrTt+sAYyBvnU= +go.opentelemetry.io/contrib/propagators/ot v1.8.0/go.mod h1:xjICLXWlvu139XAY2jAchS8bFGN2MKIUMXZCzKrRFf0= go.opentelemetry.io/contrib/zpages v0.32.0 h1:AVKTx5ppWDaem7A61HFsO1T3CK/t6kFRQoZQMj0/TW4= go.opentelemetry.io/contrib/zpages v0.32.0/go.mod h1:Jx75I61RDcZU3d/1WrP6UdINlzGGLAwFNdQ3bCTb+qw= -go.opentelemetry.io/otel v1.7.0 h1:Z2lA3Tdch0iDcrhJXDIlC94XE+bxok1F9B+4Lz/lGsM= go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk= +go.opentelemetry.io/otel v1.8.0 h1:zcvBFizPbpa1q7FehvFiHbQwGzmPILebO0tyqIR5Djg= +go.opentelemetry.io/otel v1.8.0/go.mod h1:2pkj+iMj0o03Y+cW6/m8Y4WkRdYN3AvCXCnzRMp9yvM= go.opentelemetry.io/otel/exporters/prometheus v0.30.0 h1:YXo5ZY5nofaEYMCMTTMaRH2cLDZB8+0UGuk5RwMfIo0= go.opentelemetry.io/otel/exporters/prometheus v0.30.0/go.mod h1:qN5feW+0/d661KDtJuATEmHtw5bKBK7NSvNEP927zSs= go.opentelemetry.io/otel/metric v0.30.0 h1:Hs8eQZ8aQgs0U49diZoaS6Uaxw3+bBE3lcMUKBFIk3c= go.opentelemetry.io/otel/metric v0.30.0/go.mod h1:/ShZ7+TS4dHzDFmfi1kSXMhMVubNoP0oIaBp70J6UXU= -go.opentelemetry.io/otel/sdk v1.7.0 h1:4OmStpcKVOfvDOgCt7UriAPtKolwIhxpnSNI/yK+1B0= go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU= +go.opentelemetry.io/otel/sdk v1.8.0 h1:xwu69/fNuwbSHWe/0PGS888RmjWY181OmcXDQKu7ZQk= +go.opentelemetry.io/otel/sdk v1.8.0/go.mod h1:uPSfc+yfDH2StDM/Rm35WE8gXSNdvCg023J6HeGNO0c= go.opentelemetry.io/otel/sdk/metric v0.30.0 h1:XTqQ4y3erR2Oj8xSAOL5ovO5011ch2ELg51z4fVkpME= go.opentelemetry.io/otel/sdk/metric v0.30.0/go.mod h1:8AKFRi5HyvTR0RRty3paN1aMC9HMT+NzcEhw/BLkLX8= -go.opentelemetry.io/otel/trace v1.7.0 h1:O37Iogk1lEkMRXewVtZ1BBTVn5JEp8GrJvP92bJqC6o= go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= +go.opentelemetry.io/otel/trace v1.8.0 h1:cSy0DF9eGI5WIfNwZ1q2iUyGj00tGzP24dE1lOlHrfY= +go.opentelemetry.io/otel/trace v1.8.0/go.mod h1:0Bt3PXY8w+3pheS3hQUt+wow8b1ojPaTBoTCh2zIFI4= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= diff --git a/go.mod b/go.mod index 02bc8d75d9c..e108c49cae4 100644 --- a/go.mod +++ b/go.mod @@ -24,13 +24,14 @@ require ( go.opentelemetry.io/collector/semconv v0.54.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.32.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0 + go.opentelemetry.io/contrib/propagators/autoprop v0.33.0 go.opentelemetry.io/contrib/zpages v0.32.0 - go.opentelemetry.io/otel v1.7.0 + go.opentelemetry.io/otel v1.8.0 go.opentelemetry.io/otel/exporters/prometheus v0.30.0 go.opentelemetry.io/otel/metric v0.30.0 - go.opentelemetry.io/otel/sdk v1.7.0 + go.opentelemetry.io/otel/sdk v1.8.0 go.opentelemetry.io/otel/sdk/metric v0.30.0 - go.opentelemetry.io/otel/trace v1.7.0 + go.opentelemetry.io/otel/trace v1.8.0 go.uber.org/atomic v1.9.0 go.uber.org/multierr v1.8.0 go.uber.org/zap v1.21.0 @@ -73,6 +74,10 @@ require ( github.com/tklauser/go-sysconf v0.3.10 // indirect github.com/tklauser/numcpus v0.4.0 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect + go.opentelemetry.io/contrib/propagators/aws v1.8.0 // indirect + go.opentelemetry.io/contrib/propagators/b3 v1.8.0 // indirect + go.opentelemetry.io/contrib/propagators/jaeger v1.8.0 // indirect + go.opentelemetry.io/contrib/propagators/ot v1.8.0 // indirect golang.org/x/text v0.3.7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index aa1e7b8a04a..1f3673f923f 100644 --- a/go.sum +++ b/go.sum @@ -396,20 +396,33 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.3 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.32.0/go.mod h1:J0dBVrt7dPS/lKJyQoW0xzQiUr4r2Ik1VwPjAUWnofI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0 h1:mac9BKRqwaX6zxHPDe3pvmWpwuuIM0vuXv2juCnQevE= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0/go.mod h1:5eCOqeGphOyz6TsY3ZDNjE33SM/TFAK3RGuCL2naTgY= +go.opentelemetry.io/contrib/propagators/autoprop v0.33.0 h1:vYrciMtw1n9n7OeZ3OF51fORYEGjfHXt7JSbSmgxJsg= +go.opentelemetry.io/contrib/propagators/autoprop v0.33.0/go.mod h1:m1BVaXLEU1iSomaBqQ0tGcEfAQVMD6FI7yGLq5h4rIA= +go.opentelemetry.io/contrib/propagators/aws v1.8.0 h1:Ky4pY6IKdGPPSEv/ffkA1/LRBIpz4ohhuOhrk545YQk= +go.opentelemetry.io/contrib/propagators/aws v1.8.0/go.mod h1:0ptHDgrpjxekjXayHNG0fTUdFnehgJVQlDk4P7hfDKM= +go.opentelemetry.io/contrib/propagators/b3 v1.8.0 h1:l6+IOjo7VzRWuYeKM/uDUkKOQvG22jDV3l8zs9+f1w0= +go.opentelemetry.io/contrib/propagators/b3 v1.8.0/go.mod h1:fqKNRj1Bkecfq8v1T1H0q5di1ZHZK8fuSNpVn56tlAU= +go.opentelemetry.io/contrib/propagators/jaeger v1.8.0 h1:Qmaw0Uwaw+iRL4U8eU+gP07xctL1IfXxvZH7Hy72rIE= +go.opentelemetry.io/contrib/propagators/jaeger v1.8.0/go.mod h1:uC5cTyLIJO4cZXDdx2QE/BMhO4NCUua9pXmF5F5VMP0= +go.opentelemetry.io/contrib/propagators/ot v1.8.0 h1:LJRQci6KUNa6Rtcn27c0QX0B3d10HSyrTt+sAYyBvnU= +go.opentelemetry.io/contrib/propagators/ot v1.8.0/go.mod h1:xjICLXWlvu139XAY2jAchS8bFGN2MKIUMXZCzKrRFf0= go.opentelemetry.io/contrib/zpages v0.32.0 h1:AVKTx5ppWDaem7A61HFsO1T3CK/t6kFRQoZQMj0/TW4= go.opentelemetry.io/contrib/zpages v0.32.0/go.mod h1:Jx75I61RDcZU3d/1WrP6UdINlzGGLAwFNdQ3bCTb+qw= -go.opentelemetry.io/otel v1.7.0 h1:Z2lA3Tdch0iDcrhJXDIlC94XE+bxok1F9B+4Lz/lGsM= go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk= +go.opentelemetry.io/otel v1.8.0 h1:zcvBFizPbpa1q7FehvFiHbQwGzmPILebO0tyqIR5Djg= +go.opentelemetry.io/otel v1.8.0/go.mod h1:2pkj+iMj0o03Y+cW6/m8Y4WkRdYN3AvCXCnzRMp9yvM= go.opentelemetry.io/otel/exporters/prometheus v0.30.0 h1:YXo5ZY5nofaEYMCMTTMaRH2cLDZB8+0UGuk5RwMfIo0= go.opentelemetry.io/otel/exporters/prometheus v0.30.0/go.mod h1:qN5feW+0/d661KDtJuATEmHtw5bKBK7NSvNEP927zSs= go.opentelemetry.io/otel/metric v0.30.0 h1:Hs8eQZ8aQgs0U49diZoaS6Uaxw3+bBE3lcMUKBFIk3c= go.opentelemetry.io/otel/metric v0.30.0/go.mod h1:/ShZ7+TS4dHzDFmfi1kSXMhMVubNoP0oIaBp70J6UXU= -go.opentelemetry.io/otel/sdk v1.7.0 h1:4OmStpcKVOfvDOgCt7UriAPtKolwIhxpnSNI/yK+1B0= go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU= +go.opentelemetry.io/otel/sdk v1.8.0 h1:xwu69/fNuwbSHWe/0PGS888RmjWY181OmcXDQKu7ZQk= +go.opentelemetry.io/otel/sdk v1.8.0/go.mod h1:uPSfc+yfDH2StDM/Rm35WE8gXSNdvCg023J6HeGNO0c= go.opentelemetry.io/otel/sdk/metric v0.30.0 h1:XTqQ4y3erR2Oj8xSAOL5ovO5011ch2ELg51z4fVkpME= go.opentelemetry.io/otel/sdk/metric v0.30.0/go.mod h1:8AKFRi5HyvTR0RRty3paN1aMC9HMT+NzcEhw/BLkLX8= -go.opentelemetry.io/otel/trace v1.7.0 h1:O37Iogk1lEkMRXewVtZ1BBTVn5JEp8GrJvP92bJqC6o= go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= +go.opentelemetry.io/otel/trace v1.8.0 h1:cSy0DF9eGI5WIfNwZ1q2iUyGj00tGzP24dE1lOlHrfY= +go.opentelemetry.io/otel/trace v1.8.0/go.mod h1:0Bt3PXY8w+3pheS3hQUt+wow8b1ojPaTBoTCh2zIFI4= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= diff --git a/service/service.go b/service/service.go index df59d4d217f..5cd9e24584a 100644 --- a/service/service.go +++ b/service/service.go @@ -18,6 +18,8 @@ import ( "context" "fmt" + "go.opentelemetry.io/contrib/propagators/autoprop" + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/metric/nonrecording" sdktrace "go.opentelemetry.io/otel/sdk/trace" "go.uber.org/multierr" @@ -62,6 +64,10 @@ func newService(set *settings) (*service, error) { telemetryInitializer: set.telemetry, } + if !set.Config.Service.Telemetry.Traces.DisablePropagation { + otel.SetTextMapPropagator(autoprop.NewTextMapPropagator()) + } + var err error if srv.telemetrySettings.Logger, err = telemetrylogs.NewLogger(set.Config.Service.Telemetry.Logs, set.LoggingOptions); err != nil { return nil, fmt.Errorf("failed to get logger: %w", err) diff --git a/service/telemetry/config.go b/service/telemetry/config.go index 5a2f9a7ed92..2cc307f4796 100644 --- a/service/telemetry/config.go +++ b/service/telemetry/config.go @@ -24,6 +24,7 @@ import ( type Config struct { Logs LogsConfig `mapstructure:"logs"` Metrics MetricsConfig `mapstructure:"metrics"` + Traces TracesConfig `mapstructure:"traces"` // Resource specifies user-defined attributes to include with all emitted telemetry. // Note that some attributes are added automatically (e.g. service.version) even @@ -103,3 +104,12 @@ type MetricsConfig struct { // Address is the [address]:port that metrics exposition should be bound to. Address string `mapstructure:"address"` } + +// TracesConfig defines settings to configure context propagation of the collector traces. Collector uses +// go.opentelemetry.io/contrib/propagators/autoprop package to propagate the context and OTEL_PROPAGATORS +// environment variable can be set to configure the propagators. +type TracesConfig struct { + // DisablePropagation disables propagation of the trace context to external backend beyond exporters. + // The context is propagated by default. + DisablePropagation bool `mapstructure:"disable_propagation"` +} From 653ffb86363a9ea33979a16f534f771cb9a97ca4 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Mon, 11 Jul 2022 07:10:40 -0700 Subject: [PATCH 02/38] added changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59b641f8a8b..7b1b388572d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### 💡 Enhancements 💡 - Add `linux-ppc64le` architecture to cross build tests in CI +- Add support to propagate context of internal trace generated in collector's export request (#5572) ### 🧰 Bug fixes 🧰 From 514136ee68478b13a058c3514870af835e78aacf Mon Sep 17 00:00:00 2001 From: Pavan Krishna Date: Mon, 11 Jul 2022 09:03:01 -0700 Subject: [PATCH 03/38] Update service/telemetry/config.go Co-authored-by: Pablo Baeyens --- service/telemetry/config.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/service/telemetry/config.go b/service/telemetry/config.go index 2cc307f4796..09d11691814 100644 --- a/service/telemetry/config.go +++ b/service/telemetry/config.go @@ -105,9 +105,7 @@ type MetricsConfig struct { Address string `mapstructure:"address"` } -// TracesConfig defines settings to configure context propagation of the collector traces. Collector uses -// go.opentelemetry.io/contrib/propagators/autoprop package to propagate the context and OTEL_PROPAGATORS -// environment variable can be set to configure the propagators. +// TracesConfig defines the configurable settings for service telemetry traces. type TracesConfig struct { // DisablePropagation disables propagation of the trace context to external backend beyond exporters. // The context is propagated by default. From 9eeb7c0e56c290e8fdb655a3730cbd17eda8188b Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Mon, 11 Jul 2022 09:31:09 -0700 Subject: [PATCH 04/38] merge conflict resolve --- cmd/otelcorecol/go.mod | 19 +++++++++++------ cmd/otelcorecol/go.sum | 47 +++++++++++++++++++++--------------------- go.sum | 4 ---- 3 files changed, 37 insertions(+), 33 deletions(-) diff --git a/cmd/otelcorecol/go.mod b/cmd/otelcorecol/go.mod index 94d951fc656..ac7fd405f89 100644 --- a/cmd/otelcorecol/go.mod +++ b/cmd/otelcorecol/go.mod @@ -51,18 +51,25 @@ require ( github.com/shirou/gopsutil/v3 v3.22.6 // indirect github.com/spf13/cobra v1.5.0 // indirect github.com/spf13/pflag v1.0.5 // indirect + github.com/tklauser/go-sysconf v0.3.10 // indirect + github.com/tklauser/numcpus v0.4.0 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect go.opencensus.io v0.23.0 // indirect go.opentelemetry.io/collector/pdata v0.54.0 // indirect go.opentelemetry.io/collector/semconv v0.54.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.32.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0 // indirect - go.opentelemetry.io/contrib/zpages v0.32.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 // indirect + go.opentelemetry.io/contrib/propagators/autoprop v0.33.0 // indirect + go.opentelemetry.io/contrib/propagators/aws v1.8.0 // indirect + go.opentelemetry.io/contrib/propagators/b3 v1.8.0 // indirect + go.opentelemetry.io/contrib/propagators/jaeger v1.8.0 // indirect + go.opentelemetry.io/contrib/propagators/ot v1.8.0 // indirect + go.opentelemetry.io/contrib/zpages v0.33.0 // indirect go.opentelemetry.io/otel v1.8.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.30.0 // indirect - go.opentelemetry.io/otel/metric v0.30.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.31.0 // indirect + go.opentelemetry.io/otel/metric v0.31.0 // indirect go.opentelemetry.io/otel/sdk v1.8.0 // indirect - go.opentelemetry.io/otel/sdk/metric v0.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v0.31.0 // indirect go.opentelemetry.io/otel/trace v1.8.0 // indirect go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.8.0 // indirect diff --git a/cmd/otelcorecol/go.sum b/cmd/otelcorecol/go.sum index 77535c41b30..37f70918591 100644 --- a/cmd/otelcorecol/go.sum +++ b/cmd/otelcorecol/go.sum @@ -58,7 +58,6 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21 github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= -github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= 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= @@ -67,7 +66,6 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= @@ -99,12 +97,10 @@ github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go. github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/frankban/quicktest v1.4.0/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= -github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -181,7 +177,6 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/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.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -358,7 +353,6 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -376,7 +370,9 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= +github.com/tklauser/numcpus v0.4.0 h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o= github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -392,25 +388,32 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.32.0 h1:WenoaOMNP71oq3KkMZ/jnxI9xU/JSCLw8yZILSI2lfU= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.32.0/go.mod h1:J0dBVrt7dPS/lKJyQoW0xzQiUr4r2Ik1VwPjAUWnofI= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0 h1:mac9BKRqwaX6zxHPDe3pvmWpwuuIM0vuXv2juCnQevE= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0/go.mod h1:5eCOqeGphOyz6TsY3ZDNjE33SM/TFAK3RGuCL2naTgY= -go.opentelemetry.io/contrib/zpages v0.32.0 h1:AVKTx5ppWDaem7A61HFsO1T3CK/t6kFRQoZQMj0/TW4= -go.opentelemetry.io/contrib/zpages v0.32.0/go.mod h1:Jx75I61RDcZU3d/1WrP6UdINlzGGLAwFNdQ3bCTb+qw= -go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0 h1:z6rnla1Asjzn0FrhohzIbDi4bxbtc6EMmQ7f5ZPn+pA= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0/go.mod h1:y/SlJpJQPd2UzfBCj0E9Flk9FDCtTyqUmaCB41qFrWI= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 h1:Z0lVKLXU+jxGf3ANoh+UWx9Ai5bjpQVnZXI1zEzvqS0= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0/go.mod h1:U5rUt7Rw6zuORsWNfpMRy8XMNKLrmIlv/4HgLVW/d5M= +go.opentelemetry.io/contrib/propagators/autoprop v0.33.0 h1:vYrciMtw1n9n7OeZ3OF51fORYEGjfHXt7JSbSmgxJsg= +go.opentelemetry.io/contrib/propagators/autoprop v0.33.0/go.mod h1:m1BVaXLEU1iSomaBqQ0tGcEfAQVMD6FI7yGLq5h4rIA= +go.opentelemetry.io/contrib/propagators/aws v1.8.0 h1:Ky4pY6IKdGPPSEv/ffkA1/LRBIpz4ohhuOhrk545YQk= +go.opentelemetry.io/contrib/propagators/aws v1.8.0/go.mod h1:0ptHDgrpjxekjXayHNG0fTUdFnehgJVQlDk4P7hfDKM= +go.opentelemetry.io/contrib/propagators/b3 v1.8.0 h1:l6+IOjo7VzRWuYeKM/uDUkKOQvG22jDV3l8zs9+f1w0= +go.opentelemetry.io/contrib/propagators/b3 v1.8.0/go.mod h1:fqKNRj1Bkecfq8v1T1H0q5di1ZHZK8fuSNpVn56tlAU= +go.opentelemetry.io/contrib/propagators/jaeger v1.8.0 h1:Qmaw0Uwaw+iRL4U8eU+gP07xctL1IfXxvZH7Hy72rIE= +go.opentelemetry.io/contrib/propagators/jaeger v1.8.0/go.mod h1:uC5cTyLIJO4cZXDdx2QE/BMhO4NCUua9pXmF5F5VMP0= +go.opentelemetry.io/contrib/propagators/ot v1.8.0 h1:LJRQci6KUNa6Rtcn27c0QX0B3d10HSyrTt+sAYyBvnU= +go.opentelemetry.io/contrib/propagators/ot v1.8.0/go.mod h1:xjICLXWlvu139XAY2jAchS8bFGN2MKIUMXZCzKrRFf0= +go.opentelemetry.io/contrib/zpages v0.33.0 h1:0JATTp4rT56Mrfrq1icN9GqrI+1uFjq2NwJJRl8m3fk= +go.opentelemetry.io/contrib/zpages v0.33.0/go.mod h1:ddmD63NkBVE29GucaBBCR8/b/TRlY+PkpIbF3m2JF7Y= go.opentelemetry.io/otel v1.8.0 h1:zcvBFizPbpa1q7FehvFiHbQwGzmPILebO0tyqIR5Djg= go.opentelemetry.io/otel v1.8.0/go.mod h1:2pkj+iMj0o03Y+cW6/m8Y4WkRdYN3AvCXCnzRMp9yvM= -go.opentelemetry.io/otel/exporters/prometheus v0.30.0 h1:YXo5ZY5nofaEYMCMTTMaRH2cLDZB8+0UGuk5RwMfIo0= -go.opentelemetry.io/otel/exporters/prometheus v0.30.0/go.mod h1:qN5feW+0/d661KDtJuATEmHtw5bKBK7NSvNEP927zSs= -go.opentelemetry.io/otel/metric v0.30.0 h1:Hs8eQZ8aQgs0U49diZoaS6Uaxw3+bBE3lcMUKBFIk3c= -go.opentelemetry.io/otel/metric v0.30.0/go.mod h1:/ShZ7+TS4dHzDFmfi1kSXMhMVubNoP0oIaBp70J6UXU= -go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU= +go.opentelemetry.io/otel/exporters/prometheus v0.31.0 h1:jwtnOGBM8dIty5AVZ+9ZCzZexCea3aVKmUfZAQcHqxs= +go.opentelemetry.io/otel/exporters/prometheus v0.31.0/go.mod h1:QarXIB8L79IwIPoNgG3A6zNvBgVmcppeFogV1d8612s= +go.opentelemetry.io/otel/metric v0.31.0 h1:6SiklT+gfWAwWUR0meEMxQBtihpiEs4c+vL9spDTqUs= +go.opentelemetry.io/otel/metric v0.31.0/go.mod h1:ohmwj9KTSIeBnDBm/ZwH2PSZxZzoOaG2xZeekTRzL5A= go.opentelemetry.io/otel/sdk v1.8.0 h1:xwu69/fNuwbSHWe/0PGS888RmjWY181OmcXDQKu7ZQk= go.opentelemetry.io/otel/sdk v1.8.0/go.mod h1:uPSfc+yfDH2StDM/Rm35WE8gXSNdvCg023J6HeGNO0c= -go.opentelemetry.io/otel/sdk/metric v0.30.0 h1:XTqQ4y3erR2Oj8xSAOL5ovO5011ch2ELg51z4fVkpME= -go.opentelemetry.io/otel/sdk/metric v0.30.0/go.mod h1:8AKFRi5HyvTR0RRty3paN1aMC9HMT+NzcEhw/BLkLX8= -go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= +go.opentelemetry.io/otel/sdk/metric v0.31.0 h1:2sZx4R43ZMhJdteKAlKoHvRgrMp53V1aRxvEf5lCq8Q= +go.opentelemetry.io/otel/sdk/metric v0.31.0/go.mod h1:fl0SmNnX9mN9xgU6OLYLMBMrNAsaZQi7qBwprwO3abk= go.opentelemetry.io/otel/trace v1.8.0 h1:cSy0DF9eGI5WIfNwZ1q2iUyGj00tGzP24dE1lOlHrfY= go.opentelemetry.io/otel/trace v1.8.0/go.mod h1:0Bt3PXY8w+3pheS3hQUt+wow8b1ojPaTBoTCh2zIFI4= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= @@ -560,7 +563,6 @@ golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -706,7 +708,6 @@ google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8= google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= diff --git a/go.sum b/go.sum index c5c09f30ba6..365d368154c 100644 --- a/go.sum +++ b/go.sum @@ -67,7 +67,6 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= @@ -104,7 +103,6 @@ github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSw github.com/frankban/quicktest v1.4.0/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= -github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -181,7 +179,6 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/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.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -570,7 +567,6 @@ golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= From 2466bbd834db9c52c9f2c996584361898bc9d681 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Mon, 11 Jul 2022 09:46:02 -0700 Subject: [PATCH 05/38] added config per suggestion --- service/service.go | 2 +- service/telemetry/config.go | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/service/service.go b/service/service.go index b3cc9434f79..984dde998a8 100644 --- a/service/service.go +++ b/service/service.go @@ -64,7 +64,7 @@ func newService(set *settings) (*service, error) { telemetryInitializer: set.telemetry, } - if !set.Config.Service.Telemetry.Traces.DisablePropagation { + if set.Config.Service.Telemetry.Traces.Propagation.Enabled { otel.SetTextMapPropagator(autoprop.NewTextMapPropagator()) } diff --git a/service/telemetry/config.go b/service/telemetry/config.go index 09d11691814..b300b1d635d 100644 --- a/service/telemetry/config.go +++ b/service/telemetry/config.go @@ -107,7 +107,13 @@ type MetricsConfig struct { // TracesConfig defines the configurable settings for service telemetry traces. type TracesConfig struct { - // DisablePropagation disables propagation of the trace context to external backend beyond exporters. - // The context is propagated by default. - DisablePropagation bool `mapstructure:"disable_propagation"` + // Configuration related to propagation of collector traces. + Propagation PropagationConfig `mapstructure:"propagation"` +} + +// PropagationConfig defines the configuration related to propagation of collectors traces +type PropagationConfig struct { + // Enabled sets context propagation of collector traces to downstream + // services consuming collectors export requests. + Enabled bool `mapstructure:"enabled"` } From 6aab1e0bf75756fbe9290fd831f9f8749d9e207e Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Mon, 11 Jul 2022 11:03:08 -0700 Subject: [PATCH 06/38] added test file --- service/collector_test.go | 1 + service/testdata/otelcol-notraceprop.yaml | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 service/testdata/otelcol-notraceprop.yaml diff --git a/service/collector_test.go b/service/collector_test.go index c830e7666b4..cc59f7a4c6b 100644 --- a/service/collector_test.go +++ b/service/collector_test.go @@ -353,6 +353,7 @@ func TestCollectorRun(t *testing.T) { }{ {file: "otelcol-nometrics.yaml"}, {file: "otelcol-noaddress.yaml"}, + {file: "otelcol-notraceprop.yaml"}, } for _, tt := range tests { diff --git a/service/testdata/otelcol-notraceprop.yaml b/service/testdata/otelcol-notraceprop.yaml new file mode 100644 index 00000000000..abe0001f674 --- /dev/null +++ b/service/testdata/otelcol-notraceprop.yaml @@ -0,0 +1,15 @@ +receivers: + nop: + +exporters: + nop: + +service: + telemetry: + traces: + propagation: + enabled: false + pipelines: + metrics: + receivers: [nop] + exporters: [nop] \ No newline at end of file From e33c76839f40ace44f959245c0f7ef6c9f74212b Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Mon, 11 Jul 2022 11:04:04 -0700 Subject: [PATCH 07/38] added test file --- service/collector_test.go | 2 +- .../{otelcol-notraceprop.yaml => otelcol-traceprop.yaml} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename service/testdata/{otelcol-notraceprop.yaml => otelcol-traceprop.yaml} (100%) diff --git a/service/collector_test.go b/service/collector_test.go index cc59f7a4c6b..eadfd2d0dfc 100644 --- a/service/collector_test.go +++ b/service/collector_test.go @@ -353,7 +353,7 @@ func TestCollectorRun(t *testing.T) { }{ {file: "otelcol-nometrics.yaml"}, {file: "otelcol-noaddress.yaml"}, - {file: "otelcol-notraceprop.yaml"}, + {file: "otelcol-traceprop.yaml"}, } for _, tt := range tests { diff --git a/service/testdata/otelcol-notraceprop.yaml b/service/testdata/otelcol-traceprop.yaml similarity index 100% rename from service/testdata/otelcol-notraceprop.yaml rename to service/testdata/otelcol-traceprop.yaml From 706739911b42ade8edcddc5e8fa11e08018243e9 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Mon, 11 Jul 2022 11:16:05 -0700 Subject: [PATCH 08/38] added test file --- service/testdata/otelcol-traceprop.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/testdata/otelcol-traceprop.yaml b/service/testdata/otelcol-traceprop.yaml index abe0001f674..342b9be9be4 100644 --- a/service/testdata/otelcol-traceprop.yaml +++ b/service/testdata/otelcol-traceprop.yaml @@ -8,7 +8,7 @@ service: telemetry: traces: propagation: - enabled: false + enabled: true pipelines: metrics: receivers: [nop] From dd94bc605e2e4f2764f99193143b83bd9731bee1 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Tue, 12 Jul 2022 03:29:27 -0700 Subject: [PATCH 09/38] config->featuregate --- service/collector_test.go | 1 - service/service.go | 6 ------ service/telemetry.go | 18 ++++++++++++++++++ service/telemetry/config.go | 14 -------------- service/testdata/otelcol-traceprop.yaml | 15 --------------- 5 files changed, 18 insertions(+), 36 deletions(-) delete mode 100644 service/testdata/otelcol-traceprop.yaml diff --git a/service/collector_test.go b/service/collector_test.go index eadfd2d0dfc..c830e7666b4 100644 --- a/service/collector_test.go +++ b/service/collector_test.go @@ -353,7 +353,6 @@ func TestCollectorRun(t *testing.T) { }{ {file: "otelcol-nometrics.yaml"}, {file: "otelcol-noaddress.yaml"}, - {file: "otelcol-traceprop.yaml"}, } for _, tt := range tests { diff --git a/service/service.go b/service/service.go index 984dde998a8..1afa0694d15 100644 --- a/service/service.go +++ b/service/service.go @@ -18,8 +18,6 @@ import ( "context" "fmt" - "go.opentelemetry.io/contrib/propagators/autoprop" - "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/metric" sdktrace "go.opentelemetry.io/otel/sdk/trace" "go.uber.org/multierr" @@ -64,10 +62,6 @@ func newService(set *settings) (*service, error) { telemetryInitializer: set.telemetry, } - if set.Config.Service.Telemetry.Traces.Propagation.Enabled { - otel.SetTextMapPropagator(autoprop.NewTextMapPropagator()) - } - var err error if srv.telemetrySettings.Logger, err = telemetrylogs.NewLogger(set.Config.Service.Telemetry.Logs, set.LoggingOptions); err != nil { return nil, fmt.Errorf("failed to get logger: %w", err) diff --git a/service/telemetry.go b/service/telemetry.go index 7379964b1fa..4132a0b7439 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -16,6 +16,7 @@ package service // import "go.opentelemetry.io/collector/service" import ( "errors" + "net/http" "strings" "sync" @@ -26,6 +27,8 @@ import ( ocmetric "go.opencensus.io/metric" "go.opencensus.io/metric/metricproducer" "go.opencensus.io/stats/view" + "go.opentelemetry.io/contrib/propagators/autoprop" + "go.opentelemetry.io/otel" otelprometheus "go.opentelemetry.io/otel/exporters/prometheus" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/sdk/metric/aggregator/histogram" @@ -53,6 +56,10 @@ const ( // useOtelForInternalMetricsfeatureGateID is the feature gate ID that controls whether the collector uses open // telemetrySettings for internal metrics. useOtelForInternalMetricsfeatureGateID = "telemetry.useOtelForInternalMetrics" + + // allowContextPropagationFeatureGateID is the feature gate ID that rt to propagate traceparent etc. + // headers from collector to the downstream entities that process the export requests from collector + allowTraceContextPropagationFeatureGateID = "telemetry.allowTraceContextPropagation" ) type telemetryInitializer struct { @@ -73,6 +80,13 @@ func newColTelemetry(registry *featuregate.Registry) *telemetryInitializer { Description: "controls whether the collector to uses OpenTelemetry for internal metrics", Enabled: false, }) + + registry.MustRegister(featuregate.Gate{ + ID: allowTraceContextPropagationFeatureGateID, + Description: "controls whether to propagate trace context headers of the internal spans generated by collector", + Enabled: false, + }) + return &telemetryInitializer{ registry: registry, mp: metric.NewNoopMeterProvider(), @@ -123,6 +137,10 @@ func (tel *telemetryInitializer) initOnce(buildInfo component.BuildInfo, logger telAttrs[semconv.AttributeServiceVersion] = buildInfo.Version } + if tel.registry.IsEnabled(allowTraceContextPropagationFeatureGateID) { + otel.SetTextMapPropagator(autoprop.NewTextMapPropagator()) + } + var pe http.Handler var err error if tel.registry.IsEnabled(useOtelForInternalMetricsfeatureGateID) { diff --git a/service/telemetry/config.go b/service/telemetry/config.go index b300b1d635d..5a2f9a7ed92 100644 --- a/service/telemetry/config.go +++ b/service/telemetry/config.go @@ -24,7 +24,6 @@ import ( type Config struct { Logs LogsConfig `mapstructure:"logs"` Metrics MetricsConfig `mapstructure:"metrics"` - Traces TracesConfig `mapstructure:"traces"` // Resource specifies user-defined attributes to include with all emitted telemetry. // Note that some attributes are added automatically (e.g. service.version) even @@ -104,16 +103,3 @@ type MetricsConfig struct { // Address is the [address]:port that metrics exposition should be bound to. Address string `mapstructure:"address"` } - -// TracesConfig defines the configurable settings for service telemetry traces. -type TracesConfig struct { - // Configuration related to propagation of collector traces. - Propagation PropagationConfig `mapstructure:"propagation"` -} - -// PropagationConfig defines the configuration related to propagation of collectors traces -type PropagationConfig struct { - // Enabled sets context propagation of collector traces to downstream - // services consuming collectors export requests. - Enabled bool `mapstructure:"enabled"` -} diff --git a/service/testdata/otelcol-traceprop.yaml b/service/testdata/otelcol-traceprop.yaml deleted file mode 100644 index 342b9be9be4..00000000000 --- a/service/testdata/otelcol-traceprop.yaml +++ /dev/null @@ -1,15 +0,0 @@ -receivers: - nop: - -exporters: - nop: - -service: - telemetry: - traces: - propagation: - enabled: true - pipelines: - metrics: - receivers: [nop] - exporters: [nop] \ No newline at end of file From 0f62c54f49e70ee1fab08c9544378696673da16e Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Tue, 12 Jul 2022 03:33:09 -0700 Subject: [PATCH 10/38] config -> featuregate --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c57ea34b7ad..3375e40395e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,8 @@ ### 💡 Enhancements 💡 - Add `linux-ppc64le` architecture to cross build tests in CI -- Add support to propagate context of internal trace generated in collector's export request (#5572) +- Add support to propagate context of internal trace generated in collector's export request if + telemetry.allowTraceContextPropagation featuregate is enabled (#5572) ### 🧰 Bug fixes 🧰 From ccf607ee6e7cfda1e3c7e1458846e48c0448430b Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Tue, 12 Jul 2022 03:37:49 -0700 Subject: [PATCH 11/38] fixed imports --- service/telemetry.go | 1 - 1 file changed, 1 deletion(-) diff --git a/service/telemetry.go b/service/telemetry.go index 4132a0b7439..61442035366 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -16,7 +16,6 @@ package service // import "go.opentelemetry.io/collector/service" import ( "errors" - "net/http" "strings" "sync" From 989932b88a2c4a6f64ac65b30f524beefca49abb Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Tue, 12 Jul 2022 03:39:29 -0700 Subject: [PATCH 12/38] added test case --- service/collector_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/service/collector_test.go b/service/collector_test.go index c830e7666b4..a53b775e890 100644 --- a/service/collector_test.go +++ b/service/collector_test.go @@ -347,6 +347,18 @@ func TestCollectorStartWithOpenTelemetryMetrics(t *testing.T) { } } +func TestCollectorStartWithTraceContextPropagation(t *testing.T) { + for _, tc := range ownMetricsTestCases("test version") { + t.Run(tc.name, func(t *testing.T) { + colTel := newColTelemetry(featuregate.NewRegistry()) + colTel.registry.Apply(map[string]bool{ + allowTraceContextPropagationFeatureGateID: true, + }) + testCollectorStartHelper(t, colTel, tc) + }) + } +} + func TestCollectorRun(t *testing.T) { tests := []struct { file string From e35e48bba7ae4dd64d6fb7dc34665c77cb9fb893 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Tue, 12 Jul 2022 05:19:11 -0700 Subject: [PATCH 13/38] added test case --- CHANGELOG.md | 4 ++-- service/telemetry.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3375e40395e..8f999220897 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,8 @@ ### 💡 Enhancements 💡 - Add `linux-ppc64le` architecture to cross build tests in CI -- Add support to propagate context of internal trace generated in collector's export request if - telemetry.allowTraceContextPropagation featuregate is enabled (#5572) +- Add support to propagate context of internal spans generated got collector's export request + if telemetry.allowTraceContextPropagation featuregate is enabled (#5572) ### 🧰 Bug fixes 🧰 diff --git a/service/telemetry.go b/service/telemetry.go index 61442035366..be995c49a94 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -56,8 +56,8 @@ const ( // telemetrySettings for internal metrics. useOtelForInternalMetricsfeatureGateID = "telemetry.useOtelForInternalMetrics" - // allowContextPropagationFeatureGateID is the feature gate ID that rt to propagate traceparent etc. - // headers from collector to the downstream entities that process the export requests from collector + // allowTraceContextPropagationFeatureGateID is the feature gate ID to propagate trace context of internal spans + // generated for collector's export requests. allowTraceContextPropagationFeatureGateID = "telemetry.allowTraceContextPropagation" ) From 05c32efac67a09edf098ca34e6207b489f989962 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Tue, 12 Jul 2022 05:25:59 -0700 Subject: [PATCH 14/38] fixed comment --- CHANGELOG.md | 3 +-- service/telemetry.go | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f999220897..ee744e5990f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,7 @@ ### 💡 Enhancements 💡 - Add `linux-ppc64le` architecture to cross build tests in CI -- Add support to propagate context of internal spans generated got collector's export request - if telemetry.allowTraceContextPropagation featuregate is enabled (#5572) +- Add support to propagate trace context of collector's internal spans if `telemetry.allowTraceContextPropagation` featuregate is enabled (#5572) ### 🧰 Bug fixes 🧰 diff --git a/service/telemetry.go b/service/telemetry.go index be995c49a94..91e14b4ecd8 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -56,8 +56,8 @@ const ( // telemetrySettings for internal metrics. useOtelForInternalMetricsfeatureGateID = "telemetry.useOtelForInternalMetrics" - // allowTraceContextPropagationFeatureGateID is the feature gate ID to propagate trace context of internal spans - // generated for collector's export requests. + // allowTraceContextPropagationFeatureGateID is the feature gate ID to propagate trace context of collectors + // internal spans allowTraceContextPropagationFeatureGateID = "telemetry.allowTraceContextPropagation" ) From c3e9798d2f9975404ab097e73c84c2e4b3909bc7 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Tue, 12 Jul 2022 05:26:26 -0700 Subject: [PATCH 15/38] fixed comment --- service/telemetry.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/telemetry.go b/service/telemetry.go index 91e14b4ecd8..7a25e73c014 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -82,7 +82,7 @@ func newColTelemetry(registry *featuregate.Registry) *telemetryInitializer { registry.MustRegister(featuregate.Gate{ ID: allowTraceContextPropagationFeatureGateID, - Description: "controls whether to propagate trace context headers of the internal spans generated by collector", + Description: "controls whether to propagate trace context headers of the internal spans", Enabled: false, }) From 6b8b2e1f98d167debd1c482a716eaa25628a5972 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Date: Wed, 13 Jul 2022 05:15:21 -0700 Subject: [PATCH 16/38] Update telemetry.go --- service/telemetry.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/telemetry.go b/service/telemetry.go index 7a25e73c014..081801f90a3 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -56,7 +56,7 @@ const ( // telemetrySettings for internal metrics. useOtelForInternalMetricsfeatureGateID = "telemetry.useOtelForInternalMetrics" - // allowTraceContextPropagationFeatureGateID is the feature gate ID to propagate trace context of collectors + // allowTraceContextPropagationFeatureGateID is the feature gate ID to propagate trace context of collector's // internal spans allowTraceContextPropagationFeatureGateID = "telemetry.allowTraceContextPropagation" ) From 2163b0d181b02dedb8c56f8a7b093739c07aa249 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Thu, 14 Jul 2022 10:07:50 -0700 Subject: [PATCH 17/38] don't use autoprop --- service/telemetry.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/telemetry.go b/service/telemetry.go index 081801f90a3..99524466885 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -26,10 +26,10 @@ import ( ocmetric "go.opencensus.io/metric" "go.opencensus.io/metric/metricproducer" "go.opencensus.io/stats/view" - "go.opentelemetry.io/contrib/propagators/autoprop" "go.opentelemetry.io/otel" otelprometheus "go.opentelemetry.io/otel/exporters/prometheus" "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/sdk/metric/aggregator/histogram" controller "go.opentelemetry.io/otel/sdk/metric/controller/basic" "go.opentelemetry.io/otel/sdk/metric/export/aggregation" @@ -137,7 +137,7 @@ func (tel *telemetryInitializer) initOnce(buildInfo component.BuildInfo, logger } if tel.registry.IsEnabled(allowTraceContextPropagationFeatureGateID) { - otel.SetTextMapPropagator(autoprop.NewTextMapPropagator()) + otel.SetTextMapPropagator(propagation.TraceContext{}) } var pe http.Handler From abd268b8b0d25ca51edc2790dd931e853831be4e Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Thu, 14 Jul 2022 10:13:12 -0700 Subject: [PATCH 18/38] don't use autoprop --- service/telemetry.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/service/telemetry.go b/service/telemetry.go index 99524466885..7274e26749b 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -137,7 +137,9 @@ func (tel *telemetryInitializer) initOnce(buildInfo component.BuildInfo, logger } if tel.registry.IsEnabled(allowTraceContextPropagationFeatureGateID) { - otel.SetTextMapPropagator(propagation.TraceContext{}) + otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator( + propagation.TraceContext{}, + propagation.Baggage{})) } var pe http.Handler From 75e6098d334702adef066cc164e8f08dde4d3fca Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Thu, 14 Jul 2022 10:31:11 -0700 Subject: [PATCH 19/38] reverting back to using autoprop --- service/telemetry.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/service/telemetry.go b/service/telemetry.go index 7274e26749b..081801f90a3 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -26,10 +26,10 @@ import ( ocmetric "go.opencensus.io/metric" "go.opencensus.io/metric/metricproducer" "go.opencensus.io/stats/view" + "go.opentelemetry.io/contrib/propagators/autoprop" "go.opentelemetry.io/otel" otelprometheus "go.opentelemetry.io/otel/exporters/prometheus" "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/sdk/metric/aggregator/histogram" controller "go.opentelemetry.io/otel/sdk/metric/controller/basic" "go.opentelemetry.io/otel/sdk/metric/export/aggregation" @@ -137,9 +137,7 @@ func (tel *telemetryInitializer) initOnce(buildInfo component.BuildInfo, logger } if tel.registry.IsEnabled(allowTraceContextPropagationFeatureGateID) { - otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator( - propagation.TraceContext{}, - propagation.Baggage{})) + otel.SetTextMapPropagator(autoprop.NewTextMapPropagator()) } var pe http.Handler From c5a453d555a0b070ba8004857ebb37e88a5e70d1 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Thu, 14 Jul 2022 10:35:00 -0700 Subject: [PATCH 20/38] added comment --- cmd/otelcorecol/go.mod | 5 ----- cmd/otelcorecol/go.sum | 10 ---------- service/telemetry.go | 3 +++ 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/cmd/otelcorecol/go.mod b/cmd/otelcorecol/go.mod index ac7fd405f89..e130eb42ec7 100644 --- a/cmd/otelcorecol/go.mod +++ b/cmd/otelcorecol/go.mod @@ -59,11 +59,6 @@ require ( go.opentelemetry.io/collector/semconv v0.54.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 // indirect - go.opentelemetry.io/contrib/propagators/autoprop v0.33.0 // indirect - go.opentelemetry.io/contrib/propagators/aws v1.8.0 // indirect - go.opentelemetry.io/contrib/propagators/b3 v1.8.0 // indirect - go.opentelemetry.io/contrib/propagators/jaeger v1.8.0 // indirect - go.opentelemetry.io/contrib/propagators/ot v1.8.0 // indirect go.opentelemetry.io/contrib/zpages v0.33.0 // indirect go.opentelemetry.io/otel v1.8.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.31.0 // indirect diff --git a/cmd/otelcorecol/go.sum b/cmd/otelcorecol/go.sum index 37f70918591..0cfbe9dfa60 100644 --- a/cmd/otelcorecol/go.sum +++ b/cmd/otelcorecol/go.sum @@ -392,16 +392,6 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.3 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0/go.mod h1:y/SlJpJQPd2UzfBCj0E9Flk9FDCtTyqUmaCB41qFrWI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 h1:Z0lVKLXU+jxGf3ANoh+UWx9Ai5bjpQVnZXI1zEzvqS0= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0/go.mod h1:U5rUt7Rw6zuORsWNfpMRy8XMNKLrmIlv/4HgLVW/d5M= -go.opentelemetry.io/contrib/propagators/autoprop v0.33.0 h1:vYrciMtw1n9n7OeZ3OF51fORYEGjfHXt7JSbSmgxJsg= -go.opentelemetry.io/contrib/propagators/autoprop v0.33.0/go.mod h1:m1BVaXLEU1iSomaBqQ0tGcEfAQVMD6FI7yGLq5h4rIA= -go.opentelemetry.io/contrib/propagators/aws v1.8.0 h1:Ky4pY6IKdGPPSEv/ffkA1/LRBIpz4ohhuOhrk545YQk= -go.opentelemetry.io/contrib/propagators/aws v1.8.0/go.mod h1:0ptHDgrpjxekjXayHNG0fTUdFnehgJVQlDk4P7hfDKM= -go.opentelemetry.io/contrib/propagators/b3 v1.8.0 h1:l6+IOjo7VzRWuYeKM/uDUkKOQvG22jDV3l8zs9+f1w0= -go.opentelemetry.io/contrib/propagators/b3 v1.8.0/go.mod h1:fqKNRj1Bkecfq8v1T1H0q5di1ZHZK8fuSNpVn56tlAU= -go.opentelemetry.io/contrib/propagators/jaeger v1.8.0 h1:Qmaw0Uwaw+iRL4U8eU+gP07xctL1IfXxvZH7Hy72rIE= -go.opentelemetry.io/contrib/propagators/jaeger v1.8.0/go.mod h1:uC5cTyLIJO4cZXDdx2QE/BMhO4NCUua9pXmF5F5VMP0= -go.opentelemetry.io/contrib/propagators/ot v1.8.0 h1:LJRQci6KUNa6Rtcn27c0QX0B3d10HSyrTt+sAYyBvnU= -go.opentelemetry.io/contrib/propagators/ot v1.8.0/go.mod h1:xjICLXWlvu139XAY2jAchS8bFGN2MKIUMXZCzKrRFf0= go.opentelemetry.io/contrib/zpages v0.33.0 h1:0JATTp4rT56Mrfrq1icN9GqrI+1uFjq2NwJJRl8m3fk= go.opentelemetry.io/contrib/zpages v0.33.0/go.mod h1:ddmD63NkBVE29GucaBBCR8/b/TRlY+PkpIbF3m2JF7Y= go.opentelemetry.io/otel v1.8.0 h1:zcvBFizPbpa1q7FehvFiHbQwGzmPILebO0tyqIR5Djg= diff --git a/service/telemetry.go b/service/telemetry.go index 081801f90a3..ea9ca470fff 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -137,6 +137,9 @@ func (tel *telemetryInitializer) initOnce(buildInfo component.BuildInfo, logger } if tel.registry.IsEnabled(allowTraceContextPropagationFeatureGateID) { + // Use OTEL_PROPAGATOR environment variable to configure propagators to be enabled. + // Once `autoprop` supports configuring the propagators via string id introduce telemetry.traces + // config to take it as collectors configuration. otel.SetTextMapPropagator(autoprop.NewTextMapPropagator()) } From 48875c079add6d2f7e623d51e583d8af03e30fd1 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Thu, 14 Jul 2022 10:39:27 -0700 Subject: [PATCH 21/38] updated go.sum --- cmd/otelcorecol/go.mod | 5 +++++ cmd/otelcorecol/go.sum | 10 ++++++++++ go.sum | 4 ++++ 3 files changed, 19 insertions(+) diff --git a/cmd/otelcorecol/go.mod b/cmd/otelcorecol/go.mod index e130eb42ec7..ac7fd405f89 100644 --- a/cmd/otelcorecol/go.mod +++ b/cmd/otelcorecol/go.mod @@ -59,6 +59,11 @@ require ( go.opentelemetry.io/collector/semconv v0.54.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 // indirect + go.opentelemetry.io/contrib/propagators/autoprop v0.33.0 // indirect + go.opentelemetry.io/contrib/propagators/aws v1.8.0 // indirect + go.opentelemetry.io/contrib/propagators/b3 v1.8.0 // indirect + go.opentelemetry.io/contrib/propagators/jaeger v1.8.0 // indirect + go.opentelemetry.io/contrib/propagators/ot v1.8.0 // indirect go.opentelemetry.io/contrib/zpages v0.33.0 // indirect go.opentelemetry.io/otel v1.8.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.31.0 // indirect diff --git a/cmd/otelcorecol/go.sum b/cmd/otelcorecol/go.sum index 0cfbe9dfa60..37f70918591 100644 --- a/cmd/otelcorecol/go.sum +++ b/cmd/otelcorecol/go.sum @@ -392,6 +392,16 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.3 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0/go.mod h1:y/SlJpJQPd2UzfBCj0E9Flk9FDCtTyqUmaCB41qFrWI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 h1:Z0lVKLXU+jxGf3ANoh+UWx9Ai5bjpQVnZXI1zEzvqS0= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0/go.mod h1:U5rUt7Rw6zuORsWNfpMRy8XMNKLrmIlv/4HgLVW/d5M= +go.opentelemetry.io/contrib/propagators/autoprop v0.33.0 h1:vYrciMtw1n9n7OeZ3OF51fORYEGjfHXt7JSbSmgxJsg= +go.opentelemetry.io/contrib/propagators/autoprop v0.33.0/go.mod h1:m1BVaXLEU1iSomaBqQ0tGcEfAQVMD6FI7yGLq5h4rIA= +go.opentelemetry.io/contrib/propagators/aws v1.8.0 h1:Ky4pY6IKdGPPSEv/ffkA1/LRBIpz4ohhuOhrk545YQk= +go.opentelemetry.io/contrib/propagators/aws v1.8.0/go.mod h1:0ptHDgrpjxekjXayHNG0fTUdFnehgJVQlDk4P7hfDKM= +go.opentelemetry.io/contrib/propagators/b3 v1.8.0 h1:l6+IOjo7VzRWuYeKM/uDUkKOQvG22jDV3l8zs9+f1w0= +go.opentelemetry.io/contrib/propagators/b3 v1.8.0/go.mod h1:fqKNRj1Bkecfq8v1T1H0q5di1ZHZK8fuSNpVn56tlAU= +go.opentelemetry.io/contrib/propagators/jaeger v1.8.0 h1:Qmaw0Uwaw+iRL4U8eU+gP07xctL1IfXxvZH7Hy72rIE= +go.opentelemetry.io/contrib/propagators/jaeger v1.8.0/go.mod h1:uC5cTyLIJO4cZXDdx2QE/BMhO4NCUua9pXmF5F5VMP0= +go.opentelemetry.io/contrib/propagators/ot v1.8.0 h1:LJRQci6KUNa6Rtcn27c0QX0B3d10HSyrTt+sAYyBvnU= +go.opentelemetry.io/contrib/propagators/ot v1.8.0/go.mod h1:xjICLXWlvu139XAY2jAchS8bFGN2MKIUMXZCzKrRFf0= go.opentelemetry.io/contrib/zpages v0.33.0 h1:0JATTp4rT56Mrfrq1icN9GqrI+1uFjq2NwJJRl8m3fk= go.opentelemetry.io/contrib/zpages v0.33.0/go.mod h1:ddmD63NkBVE29GucaBBCR8/b/TRlY+PkpIbF3m2JF7Y= go.opentelemetry.io/otel v1.8.0 h1:zcvBFizPbpa1q7FehvFiHbQwGzmPILebO0tyqIR5Djg= diff --git a/go.sum b/go.sum index 365d368154c..c5c09f30ba6 100644 --- a/go.sum +++ b/go.sum @@ -67,6 +67,7 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= @@ -103,6 +104,7 @@ github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSw github.com/frankban/quicktest v1.4.0/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -179,6 +181,7 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/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.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -567,6 +570,7 @@ golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= From 63a76f62473efafd370e0e2f3a162858ba02b3d0 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Thu, 14 Jul 2022 10:42:21 -0700 Subject: [PATCH 22/38] updated go.sum --- service/telemetry.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/telemetry.go b/service/telemetry.go index ea9ca470fff..186f958f4e9 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -138,8 +138,8 @@ func (tel *telemetryInitializer) initOnce(buildInfo component.BuildInfo, logger if tel.registry.IsEnabled(allowTraceContextPropagationFeatureGateID) { // Use OTEL_PROPAGATOR environment variable to configure propagators to be enabled. - // Once `autoprop` supports configuring the propagators via string id introduce telemetry.traces - // config to take it as collectors configuration. + // Once `autoprop` supports configuring the propagators via string ids of propagators, they can set via + // collectors own telemetry configuration. otel.SetTextMapPropagator(autoprop.NewTextMapPropagator()) } From decb4f960ec34b91d2807609844f32478cededf2 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Thu, 14 Jul 2022 10:42:39 -0700 Subject: [PATCH 23/38] updated go.sum --- service/telemetry.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/telemetry.go b/service/telemetry.go index 186f958f4e9..b4473c4f234 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -137,7 +137,7 @@ func (tel *telemetryInitializer) initOnce(buildInfo component.BuildInfo, logger } if tel.registry.IsEnabled(allowTraceContextPropagationFeatureGateID) { - // Use OTEL_PROPAGATOR environment variable to configure propagators to be enabled. + // Use OTEL_PROPAGATOR environment variable to configure propagators that are to be enabled. // Once `autoprop` supports configuring the propagators via string ids of propagators, they can set via // collectors own telemetry configuration. otel.SetTextMapPropagator(autoprop.NewTextMapPropagator()) From 841b1c022801032c6d6df2387d54c405d6866500 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Thu, 14 Jul 2022 10:48:29 -0700 Subject: [PATCH 24/38] updated go.sum --- service/telemetry.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/telemetry.go b/service/telemetry.go index b4473c4f234..85ef2d0ad70 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -138,7 +138,7 @@ func (tel *telemetryInitializer) initOnce(buildInfo component.BuildInfo, logger if tel.registry.IsEnabled(allowTraceContextPropagationFeatureGateID) { // Use OTEL_PROPAGATOR environment variable to configure propagators that are to be enabled. - // Once `autoprop` supports configuring the propagators via string ids of propagators, they can set via + // Once `autoprop` supports configuring the propagators via string ids, they can be enabled via // collectors own telemetry configuration. otel.SetTextMapPropagator(autoprop.NewTextMapPropagator()) } From ae9579ec9adfc5abd7ef9541eb6cd4b03590825a Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Thu, 28 Jul 2022 00:22:59 -0700 Subject: [PATCH 25/38] introduce configuration to read the list of propagtors to be enabled through autoprop --- cmd/otelcorecol/go.mod | 2 +- cmd/otelcorecol/go.sum | 10 ++++++++-- go.mod | 2 +- go.sum | 4 ++-- .../configunmarshaler/defaultunmarshaler.go | 7 +++++++ service/telemetry.go | 14 ++++++++++---- service/telemetry/config.go | 9 +++++++++ 7 files changed, 38 insertions(+), 10 deletions(-) diff --git a/cmd/otelcorecol/go.mod b/cmd/otelcorecol/go.mod index ac7fd405f89..861e5965aa4 100644 --- a/cmd/otelcorecol/go.mod +++ b/cmd/otelcorecol/go.mod @@ -59,7 +59,7 @@ require ( go.opentelemetry.io/collector/semconv v0.54.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 // indirect - go.opentelemetry.io/contrib/propagators/autoprop v0.33.0 // indirect + go.opentelemetry.io/contrib/propagators/autoprop v0.33.1-0.20220726151433-758f66bb79f9 // indirect go.opentelemetry.io/contrib/propagators/aws v1.8.0 // indirect go.opentelemetry.io/contrib/propagators/b3 v1.8.0 // indirect go.opentelemetry.io/contrib/propagators/jaeger v1.8.0 // indirect diff --git a/cmd/otelcorecol/go.sum b/cmd/otelcorecol/go.sum index 37f70918591..58642b94be8 100644 --- a/cmd/otelcorecol/go.sum +++ b/cmd/otelcorecol/go.sum @@ -58,6 +58,7 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21 github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= +github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= 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= @@ -66,6 +67,7 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= @@ -101,6 +103,7 @@ github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBd github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/frankban/quicktest v1.4.0/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= +github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -177,6 +180,7 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/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.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -353,6 +357,7 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -392,8 +397,8 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.3 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0/go.mod h1:y/SlJpJQPd2UzfBCj0E9Flk9FDCtTyqUmaCB41qFrWI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 h1:Z0lVKLXU+jxGf3ANoh+UWx9Ai5bjpQVnZXI1zEzvqS0= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0/go.mod h1:U5rUt7Rw6zuORsWNfpMRy8XMNKLrmIlv/4HgLVW/d5M= -go.opentelemetry.io/contrib/propagators/autoprop v0.33.0 h1:vYrciMtw1n9n7OeZ3OF51fORYEGjfHXt7JSbSmgxJsg= -go.opentelemetry.io/contrib/propagators/autoprop v0.33.0/go.mod h1:m1BVaXLEU1iSomaBqQ0tGcEfAQVMD6FI7yGLq5h4rIA= +go.opentelemetry.io/contrib/propagators/autoprop v0.33.1-0.20220726151433-758f66bb79f9 h1:Ks06Yixj04H2eJZs50kGQj9DcLE3h97BUzYl4qXTiMw= +go.opentelemetry.io/contrib/propagators/autoprop v0.33.1-0.20220726151433-758f66bb79f9/go.mod h1:m1BVaXLEU1iSomaBqQ0tGcEfAQVMD6FI7yGLq5h4rIA= go.opentelemetry.io/contrib/propagators/aws v1.8.0 h1:Ky4pY6IKdGPPSEv/ffkA1/LRBIpz4ohhuOhrk545YQk= go.opentelemetry.io/contrib/propagators/aws v1.8.0/go.mod h1:0ptHDgrpjxekjXayHNG0fTUdFnehgJVQlDk4P7hfDKM= go.opentelemetry.io/contrib/propagators/b3 v1.8.0 h1:l6+IOjo7VzRWuYeKM/uDUkKOQvG22jDV3l8zs9+f1w0= @@ -563,6 +568,7 @@ golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/go.mod b/go.mod index 4679d3eb425..539cb0ca782 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( go.opentelemetry.io/collector/semconv v0.54.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 - go.opentelemetry.io/contrib/propagators/autoprop v0.33.0 + go.opentelemetry.io/contrib/propagators/autoprop v0.33.1-0.20220726151433-758f66bb79f9 go.opentelemetry.io/contrib/zpages v0.33.0 go.opentelemetry.io/otel v1.8.0 go.opentelemetry.io/otel/exporters/prometheus v0.31.0 diff --git a/go.sum b/go.sum index c5c09f30ba6..6ca2149cf23 100644 --- a/go.sum +++ b/go.sum @@ -399,8 +399,8 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.3 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0/go.mod h1:y/SlJpJQPd2UzfBCj0E9Flk9FDCtTyqUmaCB41qFrWI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 h1:Z0lVKLXU+jxGf3ANoh+UWx9Ai5bjpQVnZXI1zEzvqS0= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0/go.mod h1:U5rUt7Rw6zuORsWNfpMRy8XMNKLrmIlv/4HgLVW/d5M= -go.opentelemetry.io/contrib/propagators/autoprop v0.33.0 h1:vYrciMtw1n9n7OeZ3OF51fORYEGjfHXt7JSbSmgxJsg= -go.opentelemetry.io/contrib/propagators/autoprop v0.33.0/go.mod h1:m1BVaXLEU1iSomaBqQ0tGcEfAQVMD6FI7yGLq5h4rIA= +go.opentelemetry.io/contrib/propagators/autoprop v0.33.1-0.20220726151433-758f66bb79f9 h1:Ks06Yixj04H2eJZs50kGQj9DcLE3h97BUzYl4qXTiMw= +go.opentelemetry.io/contrib/propagators/autoprop v0.33.1-0.20220726151433-758f66bb79f9/go.mod h1:m1BVaXLEU1iSomaBqQ0tGcEfAQVMD6FI7yGLq5h4rIA= go.opentelemetry.io/contrib/propagators/aws v1.8.0 h1:Ky4pY6IKdGPPSEv/ffkA1/LRBIpz4ohhuOhrk545YQk= go.opentelemetry.io/contrib/propagators/aws v1.8.0/go.mod h1:0ptHDgrpjxekjXayHNG0fTUdFnehgJVQlDk4P7hfDKM= go.opentelemetry.io/contrib/propagators/b3 v1.8.0 h1:l6+IOjo7VzRWuYeKM/uDUkKOQvG22jDV3l8zs9+f1w0= diff --git a/service/internal/configunmarshaler/defaultunmarshaler.go b/service/internal/configunmarshaler/defaultunmarshaler.go index 1fe5ccc4604..c54d8bc0723 100644 --- a/service/internal/configunmarshaler/defaultunmarshaler.go +++ b/service/internal/configunmarshaler/defaultunmarshaler.go @@ -182,6 +182,7 @@ func unmarshalService(srvRaw map[string]interface{}) (config.Service, error) { InitialFields: map[string]interface{}(nil), }, Metrics: defaultServiceTelemetryMetricsSettings(), + Traces: defaultServiceTelemetryTracesSettings(), }, } @@ -204,6 +205,12 @@ func defaultServiceTelemetryMetricsSettings() telemetry.MetricsConfig { } } +func defaultServiceTelemetryTracesSettings() telemetry.TracesConfig { + return telemetry.TracesConfig{ + Propagators: "tracecontext", + } +} + // LoadReceiver loads a receiver config from componentConfig using the provided factories. func LoadReceiver(componentConfig *confmap.Conf, id config.ComponentID, factory component.ReceiverFactory) (config.Receiver, error) { // Create the default config for this receiver. diff --git a/service/telemetry.go b/service/telemetry.go index 85ef2d0ad70..87f2dc69a19 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -137,10 +137,16 @@ func (tel *telemetryInitializer) initOnce(buildInfo component.BuildInfo, logger } if tel.registry.IsEnabled(allowTraceContextPropagationFeatureGateID) { - // Use OTEL_PROPAGATOR environment variable to configure propagators that are to be enabled. - // Once `autoprop` supports configuring the propagators via string ids, they can be enabled via - // collectors own telemetry configuration. - otel.SetTextMapPropagator(autoprop.NewTextMapPropagator()) + props := strings.Split(cfg.Traces.Propagators, ",") + + textMapPropagators, err := autoprop.TextMapPropagator(props...) + if err != nil { + return err + } + + if textMapPropagators != nil { + otel.SetTextMapPropagator(textMapPropagators) + } } var pe http.Handler diff --git a/service/telemetry/config.go b/service/telemetry/config.go index 5a2f9a7ed92..2f84384d56a 100644 --- a/service/telemetry/config.go +++ b/service/telemetry/config.go @@ -24,6 +24,7 @@ import ( type Config struct { Logs LogsConfig `mapstructure:"logs"` Metrics MetricsConfig `mapstructure:"metrics"` + Traces TracesConfig `mapstructure:"traces"` // Resource specifies user-defined attributes to include with all emitted telemetry. // Note that some attributes are added automatically (e.g. service.version) even @@ -103,3 +104,11 @@ type MetricsConfig struct { // Address is the [address]:port that metrics exposition should be bound to. Address string `mapstructure:"address"` } + +// TracesConfig exposes the common Telemetry configuration collector's internal spans. +type TracesConfig struct { + // Propagators is a comma separated list of TextMapPropagators from the default registered list + // (tracecontext, baggage, b3, b3multi, jaeger, xray, or ottrace). The default propagator used in + // tracecontext and setting the vale to none disables the context propagation. + Propagators string `mapstructure:"propagators"` +} From df829e26b9540f583563a7fa0cbedbc0c4a3dcdb Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Thu, 28 Jul 2022 00:23:53 -0700 Subject: [PATCH 26/38] introduce configuration to read the list of propagtors to be enabled through autoprop --- service/telemetry/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/telemetry/config.go b/service/telemetry/config.go index 2f84384d56a..dcba2c56a03 100644 --- a/service/telemetry/config.go +++ b/service/telemetry/config.go @@ -109,6 +109,6 @@ type MetricsConfig struct { type TracesConfig struct { // Propagators is a comma separated list of TextMapPropagators from the default registered list // (tracecontext, baggage, b3, b3multi, jaeger, xray, or ottrace). The default propagator used in - // tracecontext and setting the vale to none disables the context propagation. + // tracecontext and setting the vale to "none" disables the context propagation altogether. Propagators string `mapstructure:"propagators"` } From 3d9ac12f2e25ca0f80e14b2ae3c9e0ec19281f72 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Thu, 28 Jul 2022 00:41:53 -0700 Subject: [PATCH 27/38] added tests --- service/internal/configunmarshaler/defaultunmarshaler_test.go | 1 + service/telemetry/config.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/service/internal/configunmarshaler/defaultunmarshaler_test.go b/service/internal/configunmarshaler/defaultunmarshaler_test.go index be849d7bb9e..e3ba4b0afd0 100644 --- a/service/internal/configunmarshaler/defaultunmarshaler_test.go +++ b/service/internal/configunmarshaler/defaultunmarshaler_test.go @@ -77,6 +77,7 @@ func TestDecodeConfig(t *testing.T) { Level: configtelemetry.LevelNormal, Address: ":8081", }, + Traces: telemetry.TracesConfig{Propagators: "tracecontext"}, }, cfg.Service.Telemetry) // Verify Service Extensions diff --git a/service/telemetry/config.go b/service/telemetry/config.go index dcba2c56a03..050cda73184 100644 --- a/service/telemetry/config.go +++ b/service/telemetry/config.go @@ -105,7 +105,7 @@ type MetricsConfig struct { Address string `mapstructure:"address"` } -// TracesConfig exposes the common Telemetry configuration collector's internal spans. +// TracesConfig exposes the common Telemetry configuration for collector's internal spans. type TracesConfig struct { // Propagators is a comma separated list of TextMapPropagators from the default registered list // (tracecontext, baggage, b3, b3multi, jaeger, xray, or ottrace). The default propagator used in From 9e35ff146b34980a30db822d876c487574e85c3e Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Thu, 28 Jul 2022 05:14:22 -0700 Subject: [PATCH 28/38] make genotelcorecol --- cmd/otelcorecol/go.sum | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cmd/otelcorecol/go.sum b/cmd/otelcorecol/go.sum index 58642b94be8..40dcb4ccb48 100644 --- a/cmd/otelcorecol/go.sum +++ b/cmd/otelcorecol/go.sum @@ -58,7 +58,6 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21 github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= -github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= 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= @@ -67,7 +66,6 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= @@ -103,7 +101,6 @@ github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBd github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/frankban/quicktest v1.4.0/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= -github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -180,7 +177,6 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/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.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -357,7 +353,6 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -568,7 +563,6 @@ golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= From c564d4474980b2f682c5d0514e4848fbc6209736 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Fri, 5 Aug 2022 09:17:54 -0700 Subject: [PATCH 29/38] tracepropagation tests --- service/collector_test.go | 45 ++++++++++++++++++++--- service/testdata/otelcol-invalidprop.yaml | 18 +++++++++ 2 files changed, 57 insertions(+), 6 deletions(-) create mode 100644 service/testdata/otelcol-invalidprop.yaml diff --git a/service/collector_test.go b/service/collector_test.go index 9d58698f4e9..b6349e52c4d 100644 --- a/service/collector_test.go +++ b/service/collector_test.go @@ -346,13 +346,46 @@ func TestCollectorStartWithOpenTelemetryMetrics(t *testing.T) { } func TestCollectorStartWithTraceContextPropagation(t *testing.T) { - for _, tc := range ownMetricsTestCases("test version") { - t.Run(tc.name, func(t *testing.T) { + tests := []struct { + file string + errExpected bool + propagators string + }{ + {file: "otelcol-prop.yaml", errExpected: true}, + {file: "otelcol-nop.yaml", errExpected: false}, + } + + for _, tt := range tests { + t.Run(tt.file, func(t *testing.T) { + factories, err := componenttest.NopFactories() + require.NoError(t, err) + + cfgProvider, err := NewConfigProvider(newDefaultConfigProviderSettings([]string{filepath.Join("testdata", tt.file)})) + require.NoError(t, err) + colTel := newColTelemetry(featuregate.NewRegistry()) - colTel.registry.Apply(map[string]bool{ - allowTraceContextPropagationFeatureGateID: true, - }) - testCollectorStartHelper(t, colTel, tc) + err = colTel.registry.Apply(map[string]bool{allowTraceContextPropagationFeatureGateID: true}) + require.NoError(t, err) + + set := CollectorSettings{ + BuildInfo: component.NewDefaultBuildInfo(), + Factories: factories, + ConfigProvider: cfgProvider, + telemetry: colTel, + } + + col, err := New(set) + require.NoError(t, err) + + if tt.errExpected { + require.Error(t, col.Run(context.Background())) + assert.Equal(t, Closed, col.GetState()) + } else { + wg := startCollector(context.Background(), t, col) + col.Shutdown() + wg.Wait() + assert.Equal(t, Closed, col.GetState()) + } }) } } diff --git a/service/testdata/otelcol-invalidprop.yaml b/service/testdata/otelcol-invalidprop.yaml new file mode 100644 index 00000000000..9d84894c4c4 --- /dev/null +++ b/service/testdata/otelcol-invalidprop.yaml @@ -0,0 +1,18 @@ +receivers: + nop: + +processors: + nop: + +exporters: + nop: + +service: + telemetry: + traces: + + pipelines: + traces: + receivers: [nop] + processors: [nop] + exporters: [nop] From 2a5d90074e95b89db7aa41f672698f61767ce916 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Fri, 5 Aug 2022 09:23:13 -0700 Subject: [PATCH 30/38] tracepropagation tests --- service/collector_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/service/collector_test.go b/service/collector_test.go index b6349e52c4d..2c95d8d6647 100644 --- a/service/collector_test.go +++ b/service/collector_test.go @@ -349,7 +349,6 @@ func TestCollectorStartWithTraceContextPropagation(t *testing.T) { tests := []struct { file string errExpected bool - propagators string }{ {file: "otelcol-prop.yaml", errExpected: true}, {file: "otelcol-nop.yaml", errExpected: false}, From b53ed76709c8f8856b64430962c2f96781e12d4e Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Fri, 5 Aug 2022 10:08:07 -0700 Subject: [PATCH 31/38] tracepropagation tests --- service/collector_test.go | 2 +- service/testdata/otelcol-invalidprop.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/service/collector_test.go b/service/collector_test.go index 2c95d8d6647..b6a5a0278b0 100644 --- a/service/collector_test.go +++ b/service/collector_test.go @@ -350,7 +350,7 @@ func TestCollectorStartWithTraceContextPropagation(t *testing.T) { file string errExpected bool }{ - {file: "otelcol-prop.yaml", errExpected: true}, + {file: "otelcol-invalidprop.yaml", errExpected: true}, {file: "otelcol-nop.yaml", errExpected: false}, } diff --git a/service/testdata/otelcol-invalidprop.yaml b/service/testdata/otelcol-invalidprop.yaml index 9d84894c4c4..4d801c21bf6 100644 --- a/service/testdata/otelcol-invalidprop.yaml +++ b/service/testdata/otelcol-invalidprop.yaml @@ -10,7 +10,7 @@ exporters: service: telemetry: traces: - + propagators: "unknown,tracecontext" pipelines: traces: receivers: [nop] From 797c41531289193631ac10993eef7ba5fcb29190 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Mon, 8 Aug 2022 07:08:19 -0700 Subject: [PATCH 32/38] updated autoprop version to official released --- cmd/otelcorecol/go.mod | 18 +++++++++--------- cmd/otelcorecol/go.sum | 35 ++++++++++++++++++----------------- go.mod | 18 +++++++++--------- go.sum | 35 ++++++++++++++++++----------------- 4 files changed, 54 insertions(+), 52 deletions(-) diff --git a/cmd/otelcorecol/go.mod b/cmd/otelcorecol/go.mod index 271b7552882..1c358275b0e 100644 --- a/cmd/otelcorecol/go.mod +++ b/cmd/otelcorecol/go.mod @@ -7,7 +7,7 @@ go 1.18 require ( github.com/stretchr/testify v1.8.0 go.opentelemetry.io/collector v0.57.2 - golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a + golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 ) require ( @@ -59,18 +59,18 @@ require ( go.opentelemetry.io/collector/semconv v0.56.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 // indirect - go.opentelemetry.io/contrib/propagators/autoprop v0.33.1-0.20220726151433-758f66bb79f9 // indirect - go.opentelemetry.io/contrib/propagators/aws v1.8.0 // indirect - go.opentelemetry.io/contrib/propagators/b3 v1.8.0 // indirect - go.opentelemetry.io/contrib/propagators/jaeger v1.8.0 // indirect - go.opentelemetry.io/contrib/propagators/ot v1.8.0 // indirect + go.opentelemetry.io/contrib/propagators/autoprop v0.34.0 // indirect + go.opentelemetry.io/contrib/propagators/aws v1.9.0 // indirect + go.opentelemetry.io/contrib/propagators/b3 v1.9.0 // indirect + go.opentelemetry.io/contrib/propagators/jaeger v1.9.0 // indirect + go.opentelemetry.io/contrib/propagators/ot v1.9.0 // indirect go.opentelemetry.io/contrib/zpages v0.33.0 // indirect - go.opentelemetry.io/otel v1.8.0 // indirect + go.opentelemetry.io/otel v1.9.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.31.0 // indirect go.opentelemetry.io/otel/metric v0.31.0 // indirect - go.opentelemetry.io/otel/sdk v1.8.0 // indirect + go.opentelemetry.io/otel/sdk v1.9.0 // indirect go.opentelemetry.io/otel/sdk/metric v0.31.0 // indirect - go.opentelemetry.io/otel/trace v1.8.0 // indirect + go.opentelemetry.io/otel/trace v1.9.0 // indirect go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.21.0 // indirect diff --git a/cmd/otelcorecol/go.sum b/cmd/otelcorecol/go.sum index 7ab02cec65f..2565b4bacea 100644 --- a/cmd/otelcorecol/go.sum +++ b/cmd/otelcorecol/go.sum @@ -381,30 +381,30 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.3 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0/go.mod h1:y/SlJpJQPd2UzfBCj0E9Flk9FDCtTyqUmaCB41qFrWI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 h1:Z0lVKLXU+jxGf3ANoh+UWx9Ai5bjpQVnZXI1zEzvqS0= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0/go.mod h1:U5rUt7Rw6zuORsWNfpMRy8XMNKLrmIlv/4HgLVW/d5M= -go.opentelemetry.io/contrib/propagators/autoprop v0.33.1-0.20220726151433-758f66bb79f9 h1:Ks06Yixj04H2eJZs50kGQj9DcLE3h97BUzYl4qXTiMw= -go.opentelemetry.io/contrib/propagators/autoprop v0.33.1-0.20220726151433-758f66bb79f9/go.mod h1:m1BVaXLEU1iSomaBqQ0tGcEfAQVMD6FI7yGLq5h4rIA= -go.opentelemetry.io/contrib/propagators/aws v1.8.0 h1:Ky4pY6IKdGPPSEv/ffkA1/LRBIpz4ohhuOhrk545YQk= -go.opentelemetry.io/contrib/propagators/aws v1.8.0/go.mod h1:0ptHDgrpjxekjXayHNG0fTUdFnehgJVQlDk4P7hfDKM= -go.opentelemetry.io/contrib/propagators/b3 v1.8.0 h1:l6+IOjo7VzRWuYeKM/uDUkKOQvG22jDV3l8zs9+f1w0= -go.opentelemetry.io/contrib/propagators/b3 v1.8.0/go.mod h1:fqKNRj1Bkecfq8v1T1H0q5di1ZHZK8fuSNpVn56tlAU= -go.opentelemetry.io/contrib/propagators/jaeger v1.8.0 h1:Qmaw0Uwaw+iRL4U8eU+gP07xctL1IfXxvZH7Hy72rIE= -go.opentelemetry.io/contrib/propagators/jaeger v1.8.0/go.mod h1:uC5cTyLIJO4cZXDdx2QE/BMhO4NCUua9pXmF5F5VMP0= -go.opentelemetry.io/contrib/propagators/ot v1.8.0 h1:LJRQci6KUNa6Rtcn27c0QX0B3d10HSyrTt+sAYyBvnU= -go.opentelemetry.io/contrib/propagators/ot v1.8.0/go.mod h1:xjICLXWlvu139XAY2jAchS8bFGN2MKIUMXZCzKrRFf0= +go.opentelemetry.io/contrib/propagators/autoprop v0.34.0 h1:S1iBWYnf1iqK4O/qnjUhQ2MMNis/h5+LeB/51+uzGHI= +go.opentelemetry.io/contrib/propagators/autoprop v0.34.0/go.mod h1:lJppyBme+d8vGNukA9sHdlKvw/q4i4c9JXx2RTpuHmM= +go.opentelemetry.io/contrib/propagators/aws v1.9.0 h1:60BnkzNPdU3WD12oOGQNTjgbyws8iDggIaBWpghvcVo= +go.opentelemetry.io/contrib/propagators/aws v1.9.0/go.mod h1:lYGAfTJZU1mo92QxtuiuNJjRyRyEWj1ldO1b0Vpc1I0= +go.opentelemetry.io/contrib/propagators/b3 v1.9.0 h1:Lzb9zU98jCE2kyfCjWfSSsiQoGtvBL+COxvUBf7FNhU= +go.opentelemetry.io/contrib/propagators/b3 v1.9.0/go.mod h1:fyx3gFXn+4w5uWTTiqaI8oBNBW/6w9Ow5zxXf7NGixU= +go.opentelemetry.io/contrib/propagators/jaeger v1.9.0 h1:edJTgwezAtLKUINAXfjxllJ1vlsphNPV7RkuKNd/HkQ= +go.opentelemetry.io/contrib/propagators/jaeger v1.9.0/go.mod h1:Q/AXutvrBTfEDSeRLwOmKhyviX5adJvTesg6JFTybYg= +go.opentelemetry.io/contrib/propagators/ot v1.9.0 h1:+pYoqyFoA3H6EZ7Wie2ZQdqS4ZfG42PAGvj3eLUukHE= +go.opentelemetry.io/contrib/propagators/ot v1.9.0/go.mod h1:D2GfaecHHX67fXT93/5iKl2DArjt8+H0XWtFD8b4Z+k= go.opentelemetry.io/contrib/zpages v0.33.0 h1:0JATTp4rT56Mrfrq1icN9GqrI+1uFjq2NwJJRl8m3fk= go.opentelemetry.io/contrib/zpages v0.33.0/go.mod h1:ddmD63NkBVE29GucaBBCR8/b/TRlY+PkpIbF3m2JF7Y= -go.opentelemetry.io/otel v1.8.0 h1:zcvBFizPbpa1q7FehvFiHbQwGzmPILebO0tyqIR5Djg= -go.opentelemetry.io/otel v1.8.0/go.mod h1:2pkj+iMj0o03Y+cW6/m8Y4WkRdYN3AvCXCnzRMp9yvM= +go.opentelemetry.io/otel v1.9.0 h1:8WZNQFIB2a71LnANS9JeyidJKKGOOremcUtb/OtHISw= +go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo= go.opentelemetry.io/otel/exporters/prometheus v0.31.0 h1:jwtnOGBM8dIty5AVZ+9ZCzZexCea3aVKmUfZAQcHqxs= go.opentelemetry.io/otel/exporters/prometheus v0.31.0/go.mod h1:QarXIB8L79IwIPoNgG3A6zNvBgVmcppeFogV1d8612s= go.opentelemetry.io/otel/metric v0.31.0 h1:6SiklT+gfWAwWUR0meEMxQBtihpiEs4c+vL9spDTqUs= go.opentelemetry.io/otel/metric v0.31.0/go.mod h1:ohmwj9KTSIeBnDBm/ZwH2PSZxZzoOaG2xZeekTRzL5A= -go.opentelemetry.io/otel/sdk v1.8.0 h1:xwu69/fNuwbSHWe/0PGS888RmjWY181OmcXDQKu7ZQk= -go.opentelemetry.io/otel/sdk v1.8.0/go.mod h1:uPSfc+yfDH2StDM/Rm35WE8gXSNdvCg023J6HeGNO0c= +go.opentelemetry.io/otel/sdk v1.9.0 h1:LNXp1vrr83fNXTHgU8eO89mhzxb/bbWAsHG6fNf3qWo= +go.opentelemetry.io/otel/sdk v1.9.0/go.mod h1:AEZc8nt5bd2F7BC24J5R0mrjYnpEgYHyTcM/vrSple4= go.opentelemetry.io/otel/sdk/metric v0.31.0 h1:2sZx4R43ZMhJdteKAlKoHvRgrMp53V1aRxvEf5lCq8Q= go.opentelemetry.io/otel/sdk/metric v0.31.0/go.mod h1:fl0SmNnX9mN9xgU6OLYLMBMrNAsaZQi7qBwprwO3abk= -go.opentelemetry.io/otel/trace v1.8.0 h1:cSy0DF9eGI5WIfNwZ1q2iUyGj00tGzP24dE1lOlHrfY= -go.opentelemetry.io/otel/trace v1.8.0/go.mod h1:0Bt3PXY8w+3pheS3hQUt+wow8b1ojPaTBoTCh2zIFI4= +go.opentelemetry.io/otel/trace v1.9.0 h1:oZaCNJUjWcg60VXWee8lJKlqhPbXAPB51URuR47pQYc= +go.opentelemetry.io/otel/trace v1.9.0/go.mod h1:2737Q0MuG8q1uILYm2YYVkAyLtOofiTNGg6VODnOiPo= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= @@ -556,8 +556,9 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 h1:9vYwv7OjYaky/tlAeD7C4oC9EsPTlaFl1H2jS++V+ME= +golang.org/x/sys v0.0.0-20220804214406-8e32c043e418/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/go.mod b/go.mod index 9301285b777..8c9a0f76c50 100644 --- a/go.mod +++ b/go.mod @@ -24,19 +24,19 @@ require ( go.opentelemetry.io/collector/semconv v0.56.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 - go.opentelemetry.io/contrib/propagators/autoprop v0.33.1-0.20220726151433-758f66bb79f9 + go.opentelemetry.io/contrib/propagators/autoprop v0.34.0 go.opentelemetry.io/contrib/zpages v0.33.0 - go.opentelemetry.io/otel v1.8.0 + go.opentelemetry.io/otel v1.9.0 go.opentelemetry.io/otel/exporters/prometheus v0.31.0 go.opentelemetry.io/otel/metric v0.31.0 - go.opentelemetry.io/otel/sdk v1.8.0 + go.opentelemetry.io/otel/sdk v1.9.0 go.opentelemetry.io/otel/sdk/metric v0.31.0 - go.opentelemetry.io/otel/trace v1.8.0 + go.opentelemetry.io/otel/trace v1.9.0 go.uber.org/atomic v1.9.0 go.uber.org/multierr v1.8.0 go.uber.org/zap v1.21.0 golang.org/x/net v0.0.0-20220225172249-27dd8689420f - golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a + golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.1 @@ -74,10 +74,10 @@ require ( github.com/tklauser/go-sysconf v0.3.10 // indirect github.com/tklauser/numcpus v0.4.0 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect - go.opentelemetry.io/contrib/propagators/aws v1.8.0 // indirect - go.opentelemetry.io/contrib/propagators/b3 v1.8.0 // indirect - go.opentelemetry.io/contrib/propagators/jaeger v1.8.0 // indirect - go.opentelemetry.io/contrib/propagators/ot v1.8.0 // indirect + go.opentelemetry.io/contrib/propagators/aws v1.9.0 // indirect + go.opentelemetry.io/contrib/propagators/b3 v1.9.0 // indirect + go.opentelemetry.io/contrib/propagators/jaeger v1.9.0 // indirect + go.opentelemetry.io/contrib/propagators/ot v1.9.0 // indirect golang.org/x/text v0.3.7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index 7ec8c698bda..12846b9232e 100644 --- a/go.sum +++ b/go.sum @@ -385,30 +385,30 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.3 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0/go.mod h1:y/SlJpJQPd2UzfBCj0E9Flk9FDCtTyqUmaCB41qFrWI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 h1:Z0lVKLXU+jxGf3ANoh+UWx9Ai5bjpQVnZXI1zEzvqS0= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0/go.mod h1:U5rUt7Rw6zuORsWNfpMRy8XMNKLrmIlv/4HgLVW/d5M= -go.opentelemetry.io/contrib/propagators/autoprop v0.33.1-0.20220726151433-758f66bb79f9 h1:Ks06Yixj04H2eJZs50kGQj9DcLE3h97BUzYl4qXTiMw= -go.opentelemetry.io/contrib/propagators/autoprop v0.33.1-0.20220726151433-758f66bb79f9/go.mod h1:m1BVaXLEU1iSomaBqQ0tGcEfAQVMD6FI7yGLq5h4rIA= -go.opentelemetry.io/contrib/propagators/aws v1.8.0 h1:Ky4pY6IKdGPPSEv/ffkA1/LRBIpz4ohhuOhrk545YQk= -go.opentelemetry.io/contrib/propagators/aws v1.8.0/go.mod h1:0ptHDgrpjxekjXayHNG0fTUdFnehgJVQlDk4P7hfDKM= -go.opentelemetry.io/contrib/propagators/b3 v1.8.0 h1:l6+IOjo7VzRWuYeKM/uDUkKOQvG22jDV3l8zs9+f1w0= -go.opentelemetry.io/contrib/propagators/b3 v1.8.0/go.mod h1:fqKNRj1Bkecfq8v1T1H0q5di1ZHZK8fuSNpVn56tlAU= -go.opentelemetry.io/contrib/propagators/jaeger v1.8.0 h1:Qmaw0Uwaw+iRL4U8eU+gP07xctL1IfXxvZH7Hy72rIE= -go.opentelemetry.io/contrib/propagators/jaeger v1.8.0/go.mod h1:uC5cTyLIJO4cZXDdx2QE/BMhO4NCUua9pXmF5F5VMP0= -go.opentelemetry.io/contrib/propagators/ot v1.8.0 h1:LJRQci6KUNa6Rtcn27c0QX0B3d10HSyrTt+sAYyBvnU= -go.opentelemetry.io/contrib/propagators/ot v1.8.0/go.mod h1:xjICLXWlvu139XAY2jAchS8bFGN2MKIUMXZCzKrRFf0= +go.opentelemetry.io/contrib/propagators/autoprop v0.34.0 h1:S1iBWYnf1iqK4O/qnjUhQ2MMNis/h5+LeB/51+uzGHI= +go.opentelemetry.io/contrib/propagators/autoprop v0.34.0/go.mod h1:lJppyBme+d8vGNukA9sHdlKvw/q4i4c9JXx2RTpuHmM= +go.opentelemetry.io/contrib/propagators/aws v1.9.0 h1:60BnkzNPdU3WD12oOGQNTjgbyws8iDggIaBWpghvcVo= +go.opentelemetry.io/contrib/propagators/aws v1.9.0/go.mod h1:lYGAfTJZU1mo92QxtuiuNJjRyRyEWj1ldO1b0Vpc1I0= +go.opentelemetry.io/contrib/propagators/b3 v1.9.0 h1:Lzb9zU98jCE2kyfCjWfSSsiQoGtvBL+COxvUBf7FNhU= +go.opentelemetry.io/contrib/propagators/b3 v1.9.0/go.mod h1:fyx3gFXn+4w5uWTTiqaI8oBNBW/6w9Ow5zxXf7NGixU= +go.opentelemetry.io/contrib/propagators/jaeger v1.9.0 h1:edJTgwezAtLKUINAXfjxllJ1vlsphNPV7RkuKNd/HkQ= +go.opentelemetry.io/contrib/propagators/jaeger v1.9.0/go.mod h1:Q/AXutvrBTfEDSeRLwOmKhyviX5adJvTesg6JFTybYg= +go.opentelemetry.io/contrib/propagators/ot v1.9.0 h1:+pYoqyFoA3H6EZ7Wie2ZQdqS4ZfG42PAGvj3eLUukHE= +go.opentelemetry.io/contrib/propagators/ot v1.9.0/go.mod h1:D2GfaecHHX67fXT93/5iKl2DArjt8+H0XWtFD8b4Z+k= go.opentelemetry.io/contrib/zpages v0.33.0 h1:0JATTp4rT56Mrfrq1icN9GqrI+1uFjq2NwJJRl8m3fk= go.opentelemetry.io/contrib/zpages v0.33.0/go.mod h1:ddmD63NkBVE29GucaBBCR8/b/TRlY+PkpIbF3m2JF7Y= -go.opentelemetry.io/otel v1.8.0 h1:zcvBFizPbpa1q7FehvFiHbQwGzmPILebO0tyqIR5Djg= -go.opentelemetry.io/otel v1.8.0/go.mod h1:2pkj+iMj0o03Y+cW6/m8Y4WkRdYN3AvCXCnzRMp9yvM= +go.opentelemetry.io/otel v1.9.0 h1:8WZNQFIB2a71LnANS9JeyidJKKGOOremcUtb/OtHISw= +go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo= go.opentelemetry.io/otel/exporters/prometheus v0.31.0 h1:jwtnOGBM8dIty5AVZ+9ZCzZexCea3aVKmUfZAQcHqxs= go.opentelemetry.io/otel/exporters/prometheus v0.31.0/go.mod h1:QarXIB8L79IwIPoNgG3A6zNvBgVmcppeFogV1d8612s= go.opentelemetry.io/otel/metric v0.31.0 h1:6SiklT+gfWAwWUR0meEMxQBtihpiEs4c+vL9spDTqUs= go.opentelemetry.io/otel/metric v0.31.0/go.mod h1:ohmwj9KTSIeBnDBm/ZwH2PSZxZzoOaG2xZeekTRzL5A= -go.opentelemetry.io/otel/sdk v1.8.0 h1:xwu69/fNuwbSHWe/0PGS888RmjWY181OmcXDQKu7ZQk= -go.opentelemetry.io/otel/sdk v1.8.0/go.mod h1:uPSfc+yfDH2StDM/Rm35WE8gXSNdvCg023J6HeGNO0c= +go.opentelemetry.io/otel/sdk v1.9.0 h1:LNXp1vrr83fNXTHgU8eO89mhzxb/bbWAsHG6fNf3qWo= +go.opentelemetry.io/otel/sdk v1.9.0/go.mod h1:AEZc8nt5bd2F7BC24J5R0mrjYnpEgYHyTcM/vrSple4= go.opentelemetry.io/otel/sdk/metric v0.31.0 h1:2sZx4R43ZMhJdteKAlKoHvRgrMp53V1aRxvEf5lCq8Q= go.opentelemetry.io/otel/sdk/metric v0.31.0/go.mod h1:fl0SmNnX9mN9xgU6OLYLMBMrNAsaZQi7qBwprwO3abk= -go.opentelemetry.io/otel/trace v1.8.0 h1:cSy0DF9eGI5WIfNwZ1q2iUyGj00tGzP24dE1lOlHrfY= -go.opentelemetry.io/otel/trace v1.8.0/go.mod h1:0Bt3PXY8w+3pheS3hQUt+wow8b1ojPaTBoTCh2zIFI4= +go.opentelemetry.io/otel/trace v1.9.0 h1:oZaCNJUjWcg60VXWee8lJKlqhPbXAPB51URuR47pQYc= +go.opentelemetry.io/otel/trace v1.9.0/go.mod h1:2737Q0MuG8q1uILYm2YYVkAyLtOofiTNGg6VODnOiPo= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= @@ -560,8 +560,9 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 h1:9vYwv7OjYaky/tlAeD7C4oC9EsPTlaFl1H2jS++V+ME= +golang.org/x/sys v0.0.0-20220804214406-8e32c043e418/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From 1d78eee95b5c8dd0841cf9a737367c8502c6a62c Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Fri, 12 Aug 2022 10:33:52 -0700 Subject: [PATCH 33/38] go mod tidy --- cmd/otelcorecol/go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/otelcorecol/go.mod b/cmd/otelcorecol/go.mod index a8405198d11..c0372c7cb6f 100644 --- a/cmd/otelcorecol/go.mod +++ b/cmd/otelcorecol/go.mod @@ -7,7 +7,7 @@ go 1.18 require ( github.com/stretchr/testify v1.8.0 go.opentelemetry.io/collector v0.58.0 - golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a + golang.org/x/sys v0.0.0-20220808155132-1c4a2a72c664 ) require ( From c3c8f80a167a477389616bd772cf77a8c788ef63 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Fri, 12 Aug 2022 10:45:50 -0700 Subject: [PATCH 34/38] go mod tidy --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5fda5afc49..88edbd45ed0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ ### 💡 Enhancements 💡 +- Add support to propagate trace context of collector's internal spans if `telemetry.allowTraceContextPropagation` featuregate is enabled (#5572) + ### 🧰 Bug fixes 🧰 ## v0.58.0 Beta @@ -138,7 +140,6 @@ There isn't a valid core binary for this release. Use v0.57.2 instead. - Add `linux-ppc64le` architecture to cross build tests in CI (#5645) - `client`: perform case insensitive lookups in case the requested metadata value isn't found (#5646) - `loggingexporter`: Decouple `loglevel` field from level of logged messages (#5678) -- Add support to propagate trace context of collector's internal spans if `telemetry.allowTraceContextPropagation` featuregate is enabled (#5572) - Expose `pcommon.NewSliceFromRaw` function (#5679) - `loggingexporter`: create the exporter's logger from the service's logger (#5677) - Add `otelcol_exporter_queue_capacity` metrics show the collector's exporter queue capacity (#5475) From f6e4649913d0fe24da67709722294d767263aa07 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Fri, 12 Aug 2022 11:10:23 -0700 Subject: [PATCH 35/38] csv is now an actual list --- service/internal/configunmarshaler/defaultunmarshaler.go | 2 +- .../internal/configunmarshaler/defaultunmarshaler_test.go | 2 +- service/telemetry.go | 4 +--- service/telemetry/config.go | 5 +++-- service/testdata/otelcol-invalidprop.yaml | 4 +++- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/service/internal/configunmarshaler/defaultunmarshaler.go b/service/internal/configunmarshaler/defaultunmarshaler.go index c54d8bc0723..06e2d915524 100644 --- a/service/internal/configunmarshaler/defaultunmarshaler.go +++ b/service/internal/configunmarshaler/defaultunmarshaler.go @@ -207,7 +207,7 @@ func defaultServiceTelemetryMetricsSettings() telemetry.MetricsConfig { func defaultServiceTelemetryTracesSettings() telemetry.TracesConfig { return telemetry.TracesConfig{ - Propagators: "tracecontext", + Propagators: []string{"tracecontext"}, } } diff --git a/service/internal/configunmarshaler/defaultunmarshaler_test.go b/service/internal/configunmarshaler/defaultunmarshaler_test.go index e3ba4b0afd0..40caf3da325 100644 --- a/service/internal/configunmarshaler/defaultunmarshaler_test.go +++ b/service/internal/configunmarshaler/defaultunmarshaler_test.go @@ -77,7 +77,7 @@ func TestDecodeConfig(t *testing.T) { Level: configtelemetry.LevelNormal, Address: ":8081", }, - Traces: telemetry.TracesConfig{Propagators: "tracecontext"}, + Traces: telemetry.TracesConfig{Propagators: []string{"tracecontext"}}, }, cfg.Service.Telemetry) // Verify Service Extensions diff --git a/service/telemetry.go b/service/telemetry.go index 62b2e94b8a6..46ac9a3f11b 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -138,9 +138,7 @@ func (tel *telemetryInitializer) initOnce(buildInfo component.BuildInfo, logger } if tel.registry.IsEnabled(allowTraceContextPropagationFeatureGateID) { - props := strings.Split(cfg.Traces.Propagators, ",") - - textMapPropagators, err := autoprop.TextMapPropagator(props...) + textMapPropagators, err := autoprop.TextMapPropagator(cfg.Traces.Propagators...) if err != nil { return err } diff --git a/service/telemetry/config.go b/service/telemetry/config.go index 050cda73184..25d8cd784cd 100644 --- a/service/telemetry/config.go +++ b/service/telemetry/config.go @@ -106,9 +106,10 @@ type MetricsConfig struct { } // TracesConfig exposes the common Telemetry configuration for collector's internal spans. +// Experimental: *NOTE* this structure is subject to change or removal in the future. type TracesConfig struct { - // Propagators is a comma separated list of TextMapPropagators from the default registered list + // Propagators is a list of TextMapPropagators from the default registered list // (tracecontext, baggage, b3, b3multi, jaeger, xray, or ottrace). The default propagator used in // tracecontext and setting the vale to "none" disables the context propagation altogether. - Propagators string `mapstructure:"propagators"` + Propagators []string `mapstructure:"propagators"` } diff --git a/service/testdata/otelcol-invalidprop.yaml b/service/testdata/otelcol-invalidprop.yaml index 4d801c21bf6..1e37edc42f1 100644 --- a/service/testdata/otelcol-invalidprop.yaml +++ b/service/testdata/otelcol-invalidprop.yaml @@ -10,7 +10,9 @@ exporters: service: telemetry: traces: - propagators: "unknown,tracecontext" + propagators: + - "unknown" + - "tracecontext" pipelines: traces: receivers: [nop] From fc48710fbc450579ea161a388f879d20cf9b78f1 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Mon, 15 Aug 2022 22:44:25 -0700 Subject: [PATCH 36/38] made changes per latest suggestion --- cmd/otelcorecol/go.mod | 4 -- cmd/otelcorecol/go.sum | 8 ---- go.mod | 6 +-- go.sum | 8 ---- service/collector_test.go | 7 +-- .../configunmarshaler/defaultunmarshaler.go | 7 --- .../defaultunmarshaler_test.go | 1 - service/telemetry.go | 47 +++++++++++-------- service/telemetry/config.go | 6 +-- service/testdata/otelcol-validprop.yaml | 20 ++++++++ 10 files changed, 54 insertions(+), 60 deletions(-) create mode 100644 service/testdata/otelcol-validprop.yaml diff --git a/cmd/otelcorecol/go.mod b/cmd/otelcorecol/go.mod index c0372c7cb6f..9ad7fed6547 100644 --- a/cmd/otelcorecol/go.mod +++ b/cmd/otelcorecol/go.mod @@ -59,11 +59,7 @@ require ( go.opentelemetry.io/collector/semconv v0.56.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.34.0 // indirect - go.opentelemetry.io/contrib/propagators/autoprop v0.34.0 // indirect - go.opentelemetry.io/contrib/propagators/aws v1.9.0 // indirect go.opentelemetry.io/contrib/propagators/b3 v1.9.0 // indirect - go.opentelemetry.io/contrib/propagators/jaeger v1.9.0 // indirect - go.opentelemetry.io/contrib/propagators/ot v1.9.0 // indirect go.opentelemetry.io/contrib/zpages v0.34.0 // indirect go.opentelemetry.io/otel v1.9.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.31.0 // indirect diff --git a/cmd/otelcorecol/go.sum b/cmd/otelcorecol/go.sum index cef12c7f776..8344989c21f 100644 --- a/cmd/otelcorecol/go.sum +++ b/cmd/otelcorecol/go.sum @@ -380,16 +380,8 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.3 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0/go.mod h1:fk1+icoN47ytLSgkoWHLJrtVTSQ+HgmkNgPTKrk/Nsc= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.34.0 h1:9NkMW03wwEzPtP/KciZ4Ozu/Uz5ZA7kfqXJIObnrjGU= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.34.0/go.mod h1:548ZsYzmT4PL4zWKRd8q/N4z0Wxzn/ZxUE+lkEpwWQA= -go.opentelemetry.io/contrib/propagators/autoprop v0.34.0 h1:S1iBWYnf1iqK4O/qnjUhQ2MMNis/h5+LeB/51+uzGHI= -go.opentelemetry.io/contrib/propagators/autoprop v0.34.0/go.mod h1:lJppyBme+d8vGNukA9sHdlKvw/q4i4c9JXx2RTpuHmM= -go.opentelemetry.io/contrib/propagators/aws v1.9.0 h1:60BnkzNPdU3WD12oOGQNTjgbyws8iDggIaBWpghvcVo= -go.opentelemetry.io/contrib/propagators/aws v1.9.0/go.mod h1:lYGAfTJZU1mo92QxtuiuNJjRyRyEWj1ldO1b0Vpc1I0= go.opentelemetry.io/contrib/propagators/b3 v1.9.0 h1:Lzb9zU98jCE2kyfCjWfSSsiQoGtvBL+COxvUBf7FNhU= go.opentelemetry.io/contrib/propagators/b3 v1.9.0/go.mod h1:fyx3gFXn+4w5uWTTiqaI8oBNBW/6w9Ow5zxXf7NGixU= -go.opentelemetry.io/contrib/propagators/jaeger v1.9.0 h1:edJTgwezAtLKUINAXfjxllJ1vlsphNPV7RkuKNd/HkQ= -go.opentelemetry.io/contrib/propagators/jaeger v1.9.0/go.mod h1:Q/AXutvrBTfEDSeRLwOmKhyviX5adJvTesg6JFTybYg= -go.opentelemetry.io/contrib/propagators/ot v1.9.0 h1:+pYoqyFoA3H6EZ7Wie2ZQdqS4ZfG42PAGvj3eLUukHE= -go.opentelemetry.io/contrib/propagators/ot v1.9.0/go.mod h1:D2GfaecHHX67fXT93/5iKl2DArjt8+H0XWtFD8b4Z+k= go.opentelemetry.io/contrib/zpages v0.34.0 h1:8ZXfrPkhegp/5GQYrO0pWMv2k3DQ7f+VBjaS6fMaBLM= go.opentelemetry.io/contrib/zpages v0.34.0/go.mod h1:zuVCe4eoOREH+liRJLCtGITqL3NiUvkdr6U/4j9iQRg= go.opentelemetry.io/otel v1.9.0 h1:8WZNQFIB2a71LnANS9JeyidJKKGOOremcUtb/OtHISw= diff --git a/go.mod b/go.mod index 5bc0b92a994..30b800d3822 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( go.opentelemetry.io/collector/semconv v0.56.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.34.0 - go.opentelemetry.io/contrib/propagators/autoprop v0.34.0 + go.opentelemetry.io/contrib/propagators/b3 v1.9.0 go.opentelemetry.io/contrib/zpages v0.34.0 go.opentelemetry.io/otel v1.9.0 go.opentelemetry.io/otel/exporters/prometheus v0.31.0 @@ -74,10 +74,6 @@ require ( github.com/tklauser/go-sysconf v0.3.10 // indirect github.com/tklauser/numcpus v0.4.0 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect - go.opentelemetry.io/contrib/propagators/aws v1.9.0 // indirect - go.opentelemetry.io/contrib/propagators/b3 v1.9.0 // indirect - go.opentelemetry.io/contrib/propagators/jaeger v1.9.0 // indirect - go.opentelemetry.io/contrib/propagators/ot v1.9.0 // indirect golang.org/x/text v0.3.7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index 66f7079f111..cd2bb2e206b 100644 --- a/go.sum +++ b/go.sum @@ -384,16 +384,8 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.3 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0/go.mod h1:fk1+icoN47ytLSgkoWHLJrtVTSQ+HgmkNgPTKrk/Nsc= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.34.0 h1:9NkMW03wwEzPtP/KciZ4Ozu/Uz5ZA7kfqXJIObnrjGU= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.34.0/go.mod h1:548ZsYzmT4PL4zWKRd8q/N4z0Wxzn/ZxUE+lkEpwWQA= -go.opentelemetry.io/contrib/propagators/autoprop v0.34.0 h1:S1iBWYnf1iqK4O/qnjUhQ2MMNis/h5+LeB/51+uzGHI= -go.opentelemetry.io/contrib/propagators/autoprop v0.34.0/go.mod h1:lJppyBme+d8vGNukA9sHdlKvw/q4i4c9JXx2RTpuHmM= -go.opentelemetry.io/contrib/propagators/aws v1.9.0 h1:60BnkzNPdU3WD12oOGQNTjgbyws8iDggIaBWpghvcVo= -go.opentelemetry.io/contrib/propagators/aws v1.9.0/go.mod h1:lYGAfTJZU1mo92QxtuiuNJjRyRyEWj1ldO1b0Vpc1I0= go.opentelemetry.io/contrib/propagators/b3 v1.9.0 h1:Lzb9zU98jCE2kyfCjWfSSsiQoGtvBL+COxvUBf7FNhU= go.opentelemetry.io/contrib/propagators/b3 v1.9.0/go.mod h1:fyx3gFXn+4w5uWTTiqaI8oBNBW/6w9Ow5zxXf7NGixU= -go.opentelemetry.io/contrib/propagators/jaeger v1.9.0 h1:edJTgwezAtLKUINAXfjxllJ1vlsphNPV7RkuKNd/HkQ= -go.opentelemetry.io/contrib/propagators/jaeger v1.9.0/go.mod h1:Q/AXutvrBTfEDSeRLwOmKhyviX5adJvTesg6JFTybYg= -go.opentelemetry.io/contrib/propagators/ot v1.9.0 h1:+pYoqyFoA3H6EZ7Wie2ZQdqS4ZfG42PAGvj3eLUukHE= -go.opentelemetry.io/contrib/propagators/ot v1.9.0/go.mod h1:D2GfaecHHX67fXT93/5iKl2DArjt8+H0XWtFD8b4Z+k= go.opentelemetry.io/contrib/zpages v0.34.0 h1:8ZXfrPkhegp/5GQYrO0pWMv2k3DQ7f+VBjaS6fMaBLM= go.opentelemetry.io/contrib/zpages v0.34.0/go.mod h1:zuVCe4eoOREH+liRJLCtGITqL3NiUvkdr6U/4j9iQRg= go.opentelemetry.io/otel v1.9.0 h1:8WZNQFIB2a71LnANS9JeyidJKKGOOremcUtb/OtHISw= diff --git a/service/collector_test.go b/service/collector_test.go index cc55646c329..d448f0b27b0 100644 --- a/service/collector_test.go +++ b/service/collector_test.go @@ -352,6 +352,7 @@ func TestCollectorStartWithTraceContextPropagation(t *testing.T) { }{ {file: "otelcol-invalidprop.yaml", errExpected: true}, {file: "otelcol-nop.yaml", errExpected: false}, + {file: "otelcol-validprop.yaml", errExpected: false}, } for _, tt := range tests { @@ -362,15 +363,11 @@ func TestCollectorStartWithTraceContextPropagation(t *testing.T) { cfgProvider, err := NewConfigProvider(newDefaultConfigProviderSettings([]string{filepath.Join("testdata", tt.file)})) require.NoError(t, err) - colTel := newColTelemetry(featuregate.NewRegistry()) - err = colTel.registry.Apply(map[string]bool{allowTraceContextPropagationFeatureGateID: true}) - require.NoError(t, err) - set := CollectorSettings{ BuildInfo: component.NewDefaultBuildInfo(), Factories: factories, ConfigProvider: cfgProvider, - telemetry: colTel, + telemetry: newColTelemetry(featuregate.NewRegistry()), } col, err := New(set) diff --git a/service/internal/configunmarshaler/defaultunmarshaler.go b/service/internal/configunmarshaler/defaultunmarshaler.go index 06e2d915524..1fe5ccc4604 100644 --- a/service/internal/configunmarshaler/defaultunmarshaler.go +++ b/service/internal/configunmarshaler/defaultunmarshaler.go @@ -182,7 +182,6 @@ func unmarshalService(srvRaw map[string]interface{}) (config.Service, error) { InitialFields: map[string]interface{}(nil), }, Metrics: defaultServiceTelemetryMetricsSettings(), - Traces: defaultServiceTelemetryTracesSettings(), }, } @@ -205,12 +204,6 @@ func defaultServiceTelemetryMetricsSettings() telemetry.MetricsConfig { } } -func defaultServiceTelemetryTracesSettings() telemetry.TracesConfig { - return telemetry.TracesConfig{ - Propagators: []string{"tracecontext"}, - } -} - // LoadReceiver loads a receiver config from componentConfig using the provided factories. func LoadReceiver(componentConfig *confmap.Conf, id config.ComponentID, factory component.ReceiverFactory) (config.Receiver, error) { // Create the default config for this receiver. diff --git a/service/internal/configunmarshaler/defaultunmarshaler_test.go b/service/internal/configunmarshaler/defaultunmarshaler_test.go index 40caf3da325..be849d7bb9e 100644 --- a/service/internal/configunmarshaler/defaultunmarshaler_test.go +++ b/service/internal/configunmarshaler/defaultunmarshaler_test.go @@ -77,7 +77,6 @@ func TestDecodeConfig(t *testing.T) { Level: configtelemetry.LevelNormal, Address: ":8081", }, - Traces: telemetry.TracesConfig{Propagators: []string{"tracecontext"}}, }, cfg.Service.Telemetry) // Verify Service Extensions diff --git a/service/telemetry.go b/service/telemetry.go index 46ac9a3f11b..8bb7142f6d3 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -26,10 +26,11 @@ import ( ocmetric "go.opencensus.io/metric" "go.opencensus.io/metric/metricproducer" "go.opencensus.io/stats/view" - "go.opentelemetry.io/contrib/propagators/autoprop" + "go.opentelemetry.io/contrib/propagators/b3" "go.opentelemetry.io/otel" otelprometheus "go.opentelemetry.io/otel/exporters/prometheus" "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/sdk/metric/aggregator/histogram" controller "go.opentelemetry.io/otel/sdk/metric/controller/basic" "go.opentelemetry.io/otel/sdk/metric/export/aggregation" @@ -57,9 +58,13 @@ const ( // telemetrySettings for internal metrics. useOtelForInternalMetricsfeatureGateID = "telemetry.useOtelForInternalMetrics" - // allowTraceContextPropagationFeatureGateID is the feature gate ID to propagate trace context of collector's - // internal spans - allowTraceContextPropagationFeatureGateID = "telemetry.allowTraceContextPropagation" + // supported trace propagators + traceContextPropagator = "tracecontext" + b3Propagator = "b3" +) + +var ( + errUnsupportedPropagator = errors.New("unsupported trace propagator") ) type telemetryInitializer struct { @@ -81,12 +86,6 @@ func newColTelemetry(registry *featuregate.Registry) *telemetryInitializer { Enabled: false, }) - registry.MustRegister(featuregate.Gate{ - ID: allowTraceContextPropagationFeatureGateID, - Description: "controls whether to propagate trace context headers of the internal spans", - Enabled: false, - }) - return &telemetryInitializer{ registry: registry, mp: metric.NewNoopMeterProvider(), @@ -137,15 +136,10 @@ func (tel *telemetryInitializer) initOnce(buildInfo component.BuildInfo, logger telAttrs[semconv.AttributeServiceVersion] = buildInfo.Version } - if tel.registry.IsEnabled(allowTraceContextPropagationFeatureGateID) { - textMapPropagators, err := autoprop.TextMapPropagator(cfg.Traces.Propagators...) - if err != nil { - return err - } - - if textMapPropagators != nil { - otel.SetTextMapPropagator(textMapPropagators) - } + if tp, err := textMapPropagatorFromConfig(cfg.Traces.Propagators); err == nil { + otel.SetTextMapPropagator(tp) + } else { + return err } var pe http.Handler @@ -260,3 +254,18 @@ func sanitizePrometheusKey(str string) string { } return strings.Map(runeFilterMap, str) } + +func textMapPropagatorFromConfig(props []string) (propagation.TextMapPropagator, error) { + var textMapPropagators []propagation.TextMapPropagator + for _, prop := range props { + switch prop { + case traceContextPropagator: + textMapPropagators = append(textMapPropagators, propagation.TraceContext{}) + case b3Propagator: + textMapPropagators = append(textMapPropagators, b3.New()) + default: + return nil, errUnsupportedPropagator + } + } + return propagation.NewCompositeTextMapPropagator(textMapPropagators...), nil +} diff --git a/service/telemetry/config.go b/service/telemetry/config.go index 25d8cd784cd..198dbef218f 100644 --- a/service/telemetry/config.go +++ b/service/telemetry/config.go @@ -108,8 +108,8 @@ type MetricsConfig struct { // TracesConfig exposes the common Telemetry configuration for collector's internal spans. // Experimental: *NOTE* this structure is subject to change or removal in the future. type TracesConfig struct { - // Propagators is a list of TextMapPropagators from the default registered list - // (tracecontext, baggage, b3, b3multi, jaeger, xray, or ottrace). The default propagator used in - // tracecontext and setting the vale to "none" disables the context propagation altogether. + // Propagators is a list of TextMapPropagators from the supported propagators list. Currently, + // tracecontext and b3 are supported. By default, the value is set to empty list and + // context propagation is disabled. Propagators []string `mapstructure:"propagators"` } diff --git a/service/testdata/otelcol-validprop.yaml b/service/testdata/otelcol-validprop.yaml new file mode 100644 index 00000000000..a80e058c36a --- /dev/null +++ b/service/testdata/otelcol-validprop.yaml @@ -0,0 +1,20 @@ +receivers: + nop: + +processors: + nop: + +exporters: + nop: + +service: + telemetry: + traces: + propagators: + - "b3" + - "tracecontext" + pipelines: + traces: + receivers: [nop] + processors: [nop] + exporters: [nop] From eea5c4e68306db691f6ee1aa646491072dba7e65 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Nimmagadda Date: Tue, 16 Aug 2022 12:01:13 -0700 Subject: [PATCH 37/38] fixed readme --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be0bf613642..066397f3d99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ ### 💡 Enhancements 💡 - Add httpprovider to allow loading config files stored in HTTP (#5810) -- Add support to propagate trace context of collector's internal spans if `telemetry.allowTraceContextPropagation` featuregate is enabled (#5572) +- Added `service.telemetry.traces.propagators` configuration to set propagators for collector's internal spans. (#5572) ### 🧰 Bug fixes 🧰 From b9272d54b67e21780c181679a0b104ebba6ad311 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Tue, 16 Aug 2022 13:31:54 -0700 Subject: [PATCH 38/38] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4cd9c4b9c8..0d134f72e60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,8 +17,8 @@ - Deprecate `component.NewExtensionFactoryWithStabilityLevel` in favor of `component.NewExtensionFactory` (#5917) ### 💡 Enhancements 💡 -- Add support to unmarshalls bytes into pmetric.Metrics with `jsoniter` in jsonUnmarshaler(#5433) +- Add support to unmarshalls bytes into pmetric.Metrics with `jsoniter` in jsonUnmarshaler(#5433) - Add httpprovider to allow loading config files stored in HTTP (#5810) - Added `service.telemetry.traces.propagators` configuration to set propagators for collector's internal spans. (#5572)