Skip to content

Commit

Permalink
ddtrace/tracer: replace sprintf usage with concat
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahkm committed Dec 17, 2024
1 parent c7db44d commit df8f03e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions ddtrace/tracer/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
package tracer

import (
"fmt"
"runtime"
"runtime/debug"
"sync/atomic"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit df8f03e

Please sign in to comment.