refactor(controller): route metrics through observability/metrics Emitter#227
Merged
Conversation
…tter Port the controller off tally.Scope to *metrics.Emitter using the Begin/Complete lifecycle helper per docs/observability/metrics.md. - Params.Scope tally.Scope -> Emitter *metrics.Emitter (optional, nil->Nop) - Each RPC bakes the repo tag into a per-request emitter, then Begin/Complete emit start + result-tagged finish (replacing calls/success/failure and the total_duration timers); no domain metrics struct or memoization - Sub-operations (get_graph, compare_target_graphs) get their own Begin/Complete lifecycle; compare_target_graphs flattens to its own op - Custom timers -> DurationHistogram on the repo-tagged emitter with explicit package-level buckets (controller/metrics.go) - emitFailureMetric(e, op, err) keeps the failure_type/reason axis - Add controller/metrics_test.go asserting the start/finish path shape
yushan8
approved these changes
Jul 21, 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
redo: #215 , which landed on the wrong branch
tally.Scopecounters/timers to*metrics.Emitterwith theBegin/Completelifecycle helper.ParamskeepsScope tally.Scope;NewControllersubscopes it tocontrollerand builds its own emitter (nil → no-op).repotag once, thenBegin/Completeemitstart+ result-taggedfinish(replacingcalls/success/failure+total_durationtimers).get_graphandcompare_target_graphsget their own lifecycle;compare_target_graphsflattens to its own op.DurationHistogramwith package-level buckets (controller/metrics.go);emitFailureMetrickeeps thefailure_type/failure_reasonaxis.Replaces #215 (auto-closed when base branch
pr1-emitter-coremerged).Test plan
make buildpassesmake test— all 21 tests pass