Skip to content

refactor(controller): route metrics through observability/metrics Emitter#215

Open
xytan0056 wants to merge 1 commit into
pr1-emitter-corefrom
pr2-controller-metrics
Open

refactor(controller): route metrics through observability/metrics Emitter#215
xytan0056 wants to merge 1 commit into
pr1-emitter-corefrom
pr2-controller-metrics

Conversation

@xytan0056

@xytan0056 xytan0056 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Ports the controller off raw tally.Scope counters/timers to *metrics.Emitter with the Begin/Complete lifecycle helper.

  • Params keeps Scope tally.Scope; NewController subscopes it to controller and builds its own emitter (nil → no-op). Same for every component — no injected emitter.
  • Each RPC bakes the repo tag once, then Begin/Complete emit start + result-tagged finish (replacing calls/success/failure + total_duration timers).
  • Sub-ops get_graph and compare_target_graphs get their own lifecycle; compare_target_graphs flattens to its own op.
  • Other timers → DurationHistogram with package-level buckets (controller/metrics.go); emitFailureMetric keeps the failure_type/failure_reason axis.
  1. feat(observability/metrics): add Emitter and Begin/Complete lifecycle helpers #214.

@xytan0056
xytan0056 requested review from a team as code owners July 17, 2026 06:36
@xytan0056 xytan0056 changed the title refactor(controller): route metrics through observability/metrics Emitter [WIP] refactor(controller): route metrics through observability/metrics Emitter Jul 17, 2026
@xytan0056
xytan0056 force-pushed the pr2-controller-metrics branch 2 times, most recently from 61b8436 to fc94dd2 Compare July 17, 2026 08:09
@xytan0056 xytan0056 changed the title [WIP] refactor(controller): route metrics through observability/metrics Emitter refactor(controller): route metrics through observability/metrics Emitter Jul 17, 2026
@xytan0056
xytan0056 force-pushed the pr2-controller-metrics branch from fc94dd2 to 206444a Compare July 17, 2026 09:12
@xytan0056
xytan0056 force-pushed the pr2-controller-metrics branch from 206444a to d62bb17 Compare July 17, 2026 17:15
@xytan0056 xytan0056 changed the title refactor(controller): route metrics through observability/metrics Emitter [WIP] refactor(controller): route metrics through observability/metrics Emitter Jul 17, 2026
@xytan0056 xytan0056 changed the title [WIP] refactor(controller): route metrics through observability/metrics Emitter refactor(controller): route metrics through observability/metrics Emitter Jul 17, 2026
…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
@xytan0056
xytan0056 force-pushed the pr2-controller-metrics branch from d62bb17 to 7a8d276 Compare July 17, 2026 23:10
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.

1 participant