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

This commit is contained in:
Marcus Efraimsson 2024-06-12 18:36:31 +02:00 committed by GitHub
parent 636910e57e
commit 1abaa825c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 1 deletions

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

View File

@ -21,6 +21,8 @@ type TracingConfig struct {
ServiceName string
ServiceVersion string
ProfilingIntegration bool
}
func ProvideTracingConfig(cfg *setting.Cfg) (*TracingConfig, error) {

View File

@ -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 {