Skip to content

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

Open
xytan0056 wants to merge 1 commit into
pr2-trackinflightfrom
pr3-recordrequest
Open

refactor(controller): route metrics through observability/metrics Emitter#183
xytan0056 wants to merge 1 commit into
pr2-trackinflightfrom
pr3-recordrequest

Conversation

@xytan0056

@xytan0056 xytan0056 commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replaces tally.Scope with *metrics.Emitter in controller Params and all handler/helper signatures
  • Adds controller/metrics.go with requestMetrics struct and emitterFor memoization (per the design doc pattern)
  • Converts Timer(x).Record(d)DurationHistogram(op, x, buckets).RecordDuration(d) with explicit per-callsite buckets
  • emitFailureMetric now takes *metrics.Emitter + op instead of tally.Scope
  • All metric paths preserved 1:1; one expected path change: compare_target_graphs flattens from nested subscope to top-level op

Depends on #181.

Test plan

  • All existing controller tests pass unchanged (20/20)
  • make build / make test / make gazelle pass
  • Test helper uses metrics.Nop() instead of tally.NoopScope

if err != nil {
result = ResultFail
}
// TODO: when err != nil, derive failure_type and failure_source tags from

@xytan0056 xytan0056 Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update when errors package is ready

@xytan0056 xytan0056 changed the title [WIP] feat(observability/metrics): add RecordRequest feat(observability/metrics): add RecordRequest Jul 11, 2026
@xytan0056 xytan0056 force-pushed the pr2-trackinflight branch from 76e7a51 to a101bd7 Compare July 11, 2026 03:22
@xytan0056 xytan0056 force-pushed the pr3-recordrequest branch from 4e0dd99 to 2d79c40 Compare July 11, 2026 03:22
@xytan0056 xytan0056 force-pushed the pr2-trackinflight branch from a101bd7 to 1ecc59c Compare July 12, 2026 22:12
@xytan0056 xytan0056 force-pushed the pr3-recordrequest branch from 2d79c40 to f8d2cad Compare July 12, 2026 22:12
@xytan0056 xytan0056 force-pushed the pr2-trackinflight branch from 1ecc59c to a101bd7 Compare July 12, 2026 22:16
@xytan0056 xytan0056 force-pushed the pr3-recordrequest branch from f8d2cad to 2d79c40 Compare July 12, 2026 22:16
@xytan0056 xytan0056 force-pushed the pr2-trackinflight branch from a101bd7 to d968dab Compare July 12, 2026 22:41
@xytan0056 xytan0056 force-pushed the pr3-recordrequest branch from 2d79c40 to e2135eb Compare July 12, 2026 22:41
@xytan0056 xytan0056 force-pushed the pr2-trackinflight branch from d968dab to e21b75c Compare July 14, 2026 00:37
@xytan0056 xytan0056 force-pushed the pr3-recordrequest branch from e2135eb to cd577d8 Compare July 14, 2026 00:37
@xytan0056 xytan0056 force-pushed the pr3-recordrequest branch from cd577d8 to 6f3e10c Compare July 14, 2026 05:53
@xytan0056 xytan0056 force-pushed the pr2-trackinflight branch from e21b75c to 67218e4 Compare July 14, 2026 05:53
@xytan0056 xytan0056 changed the title feat(observability/metrics): add RecordRequest [PENDING RFC] feat(observability/metrics): add RecordRequest Jul 16, 2026
@xytan0056 xytan0056 changed the title [PENDING RFC] feat(observability/metrics): add RecordRequest refactor(controller): route metrics through observability/metrics Emitter Jul 16, 2026
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