Tracing: Only enable traces to profiles for api servers for now (#89126)

This commit is contained in:
Marcus Efraimsson
2024-06-12 19:36:31 +03:00
committed by GitHub
parent 636910e57e
commit 1abaa825c6
3 changed files with 6 additions and 1 deletions
+3 -1
View File
@@ -272,7 +272,9 @@ func (ots *TracingService) initOpentelemetryTracer() error {
}
}
tp = NewProfilingTracerProvider(tp)
if ots.cfg.ProfilingIntegration {
tp = NewProfilingTracerProvider(tp)
}
// Register our TracerProvider as the global so any imported
// instrumentation in the future will default to using it
+2
View File
@@ -21,6 +21,8 @@ type TracingConfig struct {
ServiceName string
ServiceVersion string
ProfilingIntegration bool
}
func ProvideTracingConfig(cfg *setting.Cfg) (*TracingConfig, error) {
@@ -109,6 +109,7 @@ func (o *TracingOptions) ApplyTo(config *genericapiserver.RecommendedConfig) err
tracingCfg.Sampler = o.SamplerType
tracingCfg.SamplerParam = o.SamplerParam
tracingCfg.SamplerRemoteURL = o.SamplingServiceURL
tracingCfg.ProfilingIntegration = true
ts, err := tracing.ProvideService(tracingCfg)
if err != nil {