Skip to content

[controller] Emit histogram metrics for total duration#109

Merged
justinwon777 merged 1 commit into
mainfrom
justin.won/histogram-total-duration
Jun 9, 2026
Merged

[controller] Emit histogram metrics for total duration#109
justinwon777 merged 1 commit into
mainfrom
justin.won/histogram-total-duration

Conversation

@justinwon777

@justinwon777 justinwon777 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary:
Intent:

  • Add M3 histogram metric for total_duration on both GetChangedTargets and GetChangedTargetsAndEdges RPCs in preparation for uMonitor latency alerts
  • M3 timers are being deprecated (EoL June 30, 2026); histograms are the replacement for percentile-based alerting

Changes:

  • Added package-level _totalDurationBuckets (linear, 10s–15min, 90 buckets) and totalDurationBuckets field on the controller struct
  • Emitted total_duration.histogram alongside the existing total_duration timer at all four RPC completion paths (cache hit + compute path for each API)

Test Plan:

  • Existing unit tests in controller/getchangedtargets_test.go and controller/getchangedtargetsandedges_test.go pass (histogram emission uses tally.NoopScope)

Revert Plan:
Revert this PR via git revert <commit_sha>.

Refs: BUILD-379
Issues: LINEAR-BUILD-379

…tsAndEdges total duration

Summary:
Intent:
- Add M3 histogram metric for `total_duration` on both `GetChangedTargets` and `GetChangedTargetsAndEdges` RPCs in preparation for uMonitor latency alerts
- M3 timers are being deprecated (EoL June 30, 2026); histograms are the replacement for percentile-based alerting

Changes:
- Added package-level `_totalDurationBuckets` (linear, 10s–15min, 90 buckets) and `totalDurationBuckets` field on the controller struct
- Emitted `total_duration.histogram` alongside the existing `total_duration` timer at all four RPC completion paths (cache hit + compute path for each API)
- Updated `newTestController` in test helper to include the bucket configuration

Test Plan:
- Existing unit tests in `controller/getchangedtargets_test.go` and `controller/getchangedtargetsandedges_test.go` pass (histogram emission uses `tally.NoopScope`)

Revert Plan:
Revert this PR via `git revert <commit_sha>`.

Refs: BUILD-379
Issues: LINEAR-BUILD-379
@justinwon777
justinwon777 requested review from a team as code owners June 9, 2026 22:23
@CLAassistant

CLAassistant commented Jun 9, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@justinwon777 justinwon777 changed the title [controller] Emit histogram for GetChangedTargets and GetChangedTarge… [controller] Emit histogram metrics for total duration Jun 9, 2026
@justinwon777
justinwon777 merged commit 3010a88 into main Jun 9, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants