From 9bab8cbce889cffeb43e819de5c9659197f1ec96 Mon Sep 17 00:00:00 2001 From: Gordon Date: Mon, 10 Jun 2024 16:01:40 -0400 Subject: [PATCH 1/2] Fix naming of latency metrics --- telemetry/prometheus/metrics.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telemetry/prometheus/metrics.go b/telemetry/prometheus/metrics.go index aa3bdbcf..98ef8f2c 100644 --- a/telemetry/prometheus/metrics.go +++ b/telemetry/prometheus/metrics.go @@ -208,7 +208,7 @@ func (p *metrics) Time(name string, value time.Duration, tags []string) { // Latency is a helper function to measure the latency of a routine. func (p *metrics) Latency(jobName string, start time.Time, tags ...string) { - p.Time("stats.latency", time.Since(start), append(tags, fmt.Sprintf("job:%s", jobName))) + p.Time(fmt.Sprintf("%s.latency", jobName), time.Since(start), tags) } // parseTagsToLabelPairs converts a slice of tags in "key:value" format to two slices: From bcf28624e6a0fb888b93223b8fd2561b15614e9a Mon Sep 17 00:00:00 2001 From: Gordon Date: Mon, 10 Jun 2024 16:13:26 -0400 Subject: [PATCH 2/2] Update error metrics --- telemetry/prometheus/metrics.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telemetry/prometheus/metrics.go b/telemetry/prometheus/metrics.go index 98ef8f2c..65bc6ff3 100644 --- a/telemetry/prometheus/metrics.go +++ b/telemetry/prometheus/metrics.go @@ -155,7 +155,7 @@ func (p *metrics) IncMonotonic(name string, tags []string) { // Error implements the Error method of the Metrics interface using CounterVec. func (p *metrics) Error(errName string) { - p.IncMonotonic("stats.errors", []string{fmt.Sprintf("type:%s", errName)}) + p.IncMonotonic("errors", []string{fmt.Sprintf("type:%s", errName)}) } // Histogram implements the Histogram method of the Metrics interface using HistogramVec.