Commit 87ecb5a
authored
fix(metrics): use _counts histogram for replication tasks lag (#7716)
**What changed?**
Updated replication task processor lag histogram emission to use integer
_counts instead of duration/ns. Specifically, in
cleanupAckedReplicationTasks, changed ExponentialReplicationTasksLag
emission from ExponentialHistogram(..., lag) to
IntExponentialHistogram(..., lagCount), and updated metric definitions +
migration allowlist names from replication_tasks_lag_ns to
replication_tasks_lag_counts.
**Why?**
Per follow-up review, this metric represents queue depth/lag in number
of tasks, not time duration, so _counts is the correct histogram
semantic.
Previously, the code emitted replication_tasks_lag_ns with duration
buckets, which could misrepresent the signal and make dashboards/alerts
inconsistent with actual units. This change keeps timer emission for
backward compatibility while making histogram emission unit-correct for
migration and analysis.
**How did you test it?**
go test ./service/history/replication/... -count=1
go test ./common/metrics/... -run TestHistogramMigration -count=1
make pr
**Potential risks**
Low to moderate metrics-consumer risk.
No API/IDL or schema changes.
Timer metric (replication_tasks_lag) is unchanged.
Histogram metric name changed from _ns to _counts; any dashboards/alerts
reading the old histogram name will need to move to
replication_tasks_lag_counts.
**Release notes**
Internal metrics migration update: replication task processor lag
histogram now emits task-count based values via
replication_tasks_lag_counts (integer histogram), while preserving
existing timer emission.
**Documentation Changes**
N/A for Cadence docs; internal dashboard/alert metric references should
switch from replication_tasks_lag_ns to replication_tasks_lag_counts.
Signed-off-by: Diana Zawadzki <dzawa@live.de>1 parent 63d68a2 commit 87ecb5a
File tree
3 files changed
+5
-5
lines changed- common/metrics
- service/history/replication
3 files changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3562 | 3562 | | |
3563 | 3563 | | |
3564 | 3564 | | |
3565 | | - | |
| 3565 | + | |
3566 | 3566 | | |
3567 | 3567 | | |
3568 | 3568 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
281 | | - | |
| 281 | + | |
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | | - | |
286 | | - | |
| 285 | + | |
| 286 | + | |
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| |||
0 commit comments