From df8f03e3f45012488f138e38d78d4d1ba0af4fbe Mon Sep 17 00:00:00 2001 From: Hannah Kim Date: Tue, 17 Dec 2024 16:04:39 -0500 Subject: [PATCH] ddtrace/tracer: replace sprintf usage with concat --- ddtrace/tracer/metrics.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ddtrace/tracer/metrics.go b/ddtrace/tracer/metrics.go index a870cbed31..067ab694f8 100644 --- a/ddtrace/tracer/metrics.go +++ b/ddtrace/tracer/metrics.go @@ -6,7 +6,6 @@ package tracer import ( - "fmt" "runtime" "runtime/debug" "sync/atomic" @@ -94,14 +93,12 @@ func (t *tracer) reportHealthMetrics(interval time.Duration) { case <-ticker.C: t.spansStarted.mu.Lock() for name, v := range t.spansStarted.spans { - tag := fmt.Sprintf("integration:%s", name) - t.statsd.Count("datadog.tracer.spans_started", int64(v), []string{tag}, 1) + t.statsd.Count("datadog.tracer.spans_started", int64(v), []string{"integration:" + name}, 1) } t.spansStarted.mu.Unlock() t.spansFinished.mu.Lock() for name, v := range t.spansFinished.spans { - tag := fmt.Sprintf("integration:%s", name) - t.statsd.Count("datadog.tracer.spans_finished", int64(v), []string{tag}, 1) + t.statsd.Count("datadog.tracer.spans_finished", int64(v), []string{"integration:" + name}, 1) } t.spansFinished.mu.Unlock() t.statsd.Count("datadog.tracer.traces_dropped", int64(atomic.SwapUint32(&t.tracesDropped, 0)), []string{"reason:trace_too_large"}, 1)