Skip to content

Commit

Permalink
Merge pull request #8017 from aduffeck/fix-empty-traceids
Browse files Browse the repository at this point in the history
Use a on-sampling instead of noop traceprovider to get proper traceids
  • Loading branch information
aduffeck authored Dec 19, 2023
2 parents 06b8e6e + 17e0c92 commit fe20ea2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-empty-traceids.md
Original file line number Diff line number Diff line change
@@ -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
8 changes: 7 additions & 1 deletion ocis-pkg/tracing/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit fe20ea2

Please sign in to comment.