Skip to content

Commit

Permalink
Merge branch 'main' into mtoff/health-metrics-3
Browse files Browse the repository at this point in the history
  • Loading branch information
mtoffl01 authored Dec 23, 2024
2 parents 286ed77 + 3961f7f commit 735a883
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion ddtrace/tracer/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/tracer/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion ddtrace/tracer/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 735a883

Please sign in to comment.