diff --git a/ddtrace/tracer/metrics.go b/ddtrace/tracer/metrics.go index 409d8a439a..9cd17a968b 100644 --- a/ddtrace/tracer/metrics.go +++ b/ddtrace/tracer/metrics.go @@ -85,7 +85,9 @@ func (t *tracer) reportRuntimeMetrics(interval time.Duration) { } } -func (t *tracer) reportHealthMetrics(interval time.Duration) { +// reportHealthMetricsAtInterval reports noisy health metrics at the specified interval. +// The periodic reporting ensures metrics are delivered without overwhelming the system or logs. +func (t *tracer) reportHealthMetricsAtInterval(interval time.Duration) { ticker := time.NewTicker(interval) defer ticker.Stop() for { diff --git a/ddtrace/tracer/metrics_test.go b/ddtrace/tracer/metrics_test.go index 64548fce86..16a40e8492 100644 --- a/ddtrace/tracer/metrics_test.go +++ b/ddtrace/tracer/metrics_test.go @@ -43,7 +43,7 @@ func TestReportRuntimeMetrics(t *testing.T) { assert.Contains(calls, "runtime.go.gc_stats.pause_quantiles.75p") } -func TestReportHealthMetrics(t *testing.T) { +func TestReportHealthMetricsAtInterval(t *testing.T) { assert := assert.New(t) var tg statsdtest.TestStatsdClient diff --git a/ddtrace/tracer/tracer.go b/ddtrace/tracer/tracer.go index a345fd6366..25e08b7cb3 100644 --- a/ddtrace/tracer/tracer.go +++ b/ddtrace/tracer/tracer.go @@ -376,7 +376,7 @@ func newTracer(opts ...StartOption) *tracer { t.wg.Add(1) go func() { defer t.wg.Done() - t.reportHealthMetrics(statsInterval) + t.reportHealthMetricsAtInterval(statsInterval) }() t.stats.Start() return t