Skip to content

Commit

Permalink
Only init DefaultTracerProvider if tracing is enabled (#2978)
Browse files Browse the repository at this point in the history
Stay with NOOP provider otherwise
  • Loading branch information
rhafer authored Jun 16, 2022
1 parent f7b1b5f commit dffcaf7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/unreleased/per-service-trace.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ This is especially helpful when running multiple reva services in a single
process (like e.g. oCIS does).

https://github.com/cs3org/reva/pull/2962
https://github.com/cs3org/reva/pull/2978
4 changes: 3 additions & 1 deletion cmd/revad/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ func initServers(mainConf map[string]interface{}, log *zerolog.Logger, tp trace.
}

func initTracing(conf *coreConf) trace.TracerProvider {
rtrace.InitDefaultTracerProvider(conf.TracingCollector, conf.TracingEndpoint)
if conf.TracingEnabled {
rtrace.InitDefaultTracerProvider(conf.TracingCollector, conf.TracingEndpoint)
}
return rtrace.GetTracerProvider(conf.TracingEnabled, conf.TracingCollector, conf.TracingEndpoint, conf.TracingServiceName)
}

Expand Down

0 comments on commit dffcaf7

Please sign in to comment.