Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: rename reportHealthMetrics function #3040

Merged
merged 3 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading