aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChris Reeves <[email protected]>2023-03-09 16:02:35 +0000
committerGitHub <[email protected]>2023-03-09 09:02:35 -0700
commitb420561737e4589affbfe08c0acf7dcb593381d0 (patch)
tree0520ab671dfe17e3a6d4e19b1947c50fd8669e90
parentc05e3898b924c3434ee17e9e50cde2bc498e9f88 (diff)
downloadcaddy-b420561737e4589affbfe08c0acf7dcb593381d0.tar.gz
caddy-b420561737e4589affbfe08c0acf7dcb593381d0.zip
tracing: Support autoprop from OTEL_PROPAGATORS (#5147)
Co-authored-by: Matt Holt <[email protected]>
-rw-r--r--go.sum3
-rw-r--r--modules/caddyhttp/tracing/tracer.go4
2 files changed, 4 insertions, 3 deletions
diff --git a/go.sum b/go.sum
index 4dde45d08..96ca028b3 100644
--- a/go.sum
+++ b/go.sum
@@ -740,8 +740,9 @@ go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
-go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
+go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8=
+go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak=
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
diff --git a/modules/caddyhttp/tracing/tracer.go b/modules/caddyhttp/tracing/tracer.go
index d113a567b..cb7274305 100644
--- a/modules/caddyhttp/tracing/tracer.go
+++ b/modules/caddyhttp/tracing/tracer.go
@@ -6,9 +6,9 @@ import (
"net/http"
"github.com/caddyserver/caddy/v2"
-
"github.com/caddyserver/caddy/v2/modules/caddyhttp"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
+ "go.opentelemetry.io/contrib/propagators/autoprop"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
"go.opentelemetry.io/otel/propagation"
"go.opentelemetry.io/otel/sdk/resource"
@@ -62,7 +62,7 @@ func newOpenTelemetryWrapper(
return ot, fmt.Errorf("creating trace exporter error: %w", err)
}
- ot.propagators = propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{})
+ ot.propagators = autoprop.NewTextMapPropagator()
tracerProvider := globalTracerProvider.getTracerProvider(
sdktrace.WithBatcher(traceExporter),