feat(metrics): Add core/metrics utility package#107
Merged
Conversation
fdfb9a4 to
48ae569
Compare
sbalabanov
approved these changes
Mar 3, 2026
manjari25
approved these changes
Mar 3, 2026
Add reusable metrics helpers for tally.Scope that standardize metric
emission across controllers. Includes Op lifecycle (Begin/Complete) for
operation tracking with automatic counters, timers, histograms, and
error-aware tagging via core/errs integration. Named helpers provide
consistent {name}.{sub} sub-scope patterns for ad-hoc counters, timers,
histograms, and gauges.
3010fd6 to
1455bdc
Compare
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
core/metricspackage with reusable helpers fortally.Scopethat standardize metric emission across controllersOplifecycle type (Begin/Complete) tracks operations with automaticcalled,succeeded/failedcounters,latencytimer, andlatency_histogram— with error-aware tagging viacore/errsintegrationNamed*helpers (NamedCounter,NamedTimer,NamedHistogram,NamedGauge) provide consistent{name}.{sub}sub-scope patterns for ad-hoc metricsLatencyBucketsfrom 5ms to 4h for both fast RPCs and long-running operationsTest plan
make testpasses (all 21 tests including newcore/metrics:metrics_test)make gazelleshows no diff (BUILD files in sync)Begin/Completelifecycle with nil, generic, retryable, user, and dependency errors