[controller] Emit histogram metrics for total duration#109
Merged
Conversation
…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
yushan8
approved these changes
Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Intent:
total_durationon bothGetChangedTargetsandGetChangedTargetsAndEdgesRPCs in preparation for uMonitor latency alertsChanges:
_totalDurationBuckets(linear, 10s–15min, 90 buckets) andtotalDurationBucketsfield on the controller structtotal_duration.histogramalongside the existingtotal_durationtimer at all four RPC completion paths (cache hit + compute path for each API)Test Plan:
controller/getchangedtargets_test.goandcontroller/getchangedtargetsandedges_test.gopass (histogram emission usestally.NoopScope)Revert Plan:
Revert this PR via
git revert <commit_sha>.Refs: BUILD-379
Issues: LINEAR-BUILD-379