Skip to content

Commit

Permalink
instr(metrics): Fix small issues with delay metric (#4411)
Browse files Browse the repository at this point in the history
- Only emit the metrics when there are actual values (needed for the
gauge metric).
- Align the max metric with the count/sum metric names.
  • Loading branch information
Dav1dde authored Dec 19, 2024
1 parent 8a93115 commit 9ad36d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions relay-server/src/services/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,9 @@ impl StoreService {
}

for (namespace, (total, count, max)) in delay_stats {
if count == 0 {
continue;
}
metric!(
counter(RelayCounters::MetricDelaySum) += total,
namespace = namespace.as_str()
Expand Down
2 changes: 1 addition & 1 deletion relay-server/src/statsd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl GaugeMetric for RelayGauges {
RelayGauges::ProjectCacheScheduledFetches => "project_cache.fetches.size",
RelayGauges::ServerActiveConnections => "server.http.connections",
#[cfg(feature = "processing")]
RelayGauges::MetricDelayMax => "metrics.buckets.delay.max",
RelayGauges::MetricDelayMax => "metrics.delay.max",
}
}
}
Expand Down

0 comments on commit 9ad36d8

Please sign in to comment.