From 69e8d13f7e448157198fee339a3d551b0240a95f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Tue, 19 Dec 2023 14:49:48 +0100 Subject: [PATCH 1/2] Use a on-sampling instead of noop traceprovider to get proper traceids Fixes #7928 --- ocis-pkg/tracing/tracing.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ocis-pkg/tracing/tracing.go b/ocis-pkg/tracing/tracing.go index a949b234c19..fb86e48ea69 100644 --- a/ocis-pkg/tracing/tracing.go +++ b/ocis-pkg/tracing/tracing.go @@ -39,7 +39,13 @@ func GetServiceTraceProvider(c ConfigConverter, serviceName string) (trace.Trace if cfg.Enabled { return GetTraceProvider(cfg.Endpoint, cfg.Collector, serviceName, cfg.Type) } - return trace.NewNoopTracerProvider(), nil + + tp := sdktrace.NewTracerProvider( + sdktrace.WithSampler(sdktrace.NeverSample()), + ) + rtrace.SetDefaultTracerProvider(tp) + + return tp, nil } // GetPropagator gets a configured propagator. From 17e0c927503e7952c643b49dc706ce52ad01715c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Tue, 19 Dec 2023 15:05:51 +0100 Subject: [PATCH 2/2] Add changelog --- changelog/unreleased/fix-empty-traceids.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelog/unreleased/fix-empty-traceids.md diff --git a/changelog/unreleased/fix-empty-traceids.md b/changelog/unreleased/fix-empty-traceids.md new file mode 100644 index 00000000000..6a7658db3a1 --- /dev/null +++ b/changelog/unreleased/fix-empty-traceids.md @@ -0,0 +1,5 @@ +Bugfix: Fix empty trace ids + +We changed the default tracing to produce non-empty traceids. + +https://github.com/owncloud/ocis/pull/8017