Skip to content

refactor: add MetricsBackend trait with dynamic metric registration - #65

Open
tolulopedd26 wants to merge 1 commit into
Proof-Stell:mainfrom
tolulopedd26:refactor/metrics-registry
Open

refactor: add MetricsBackend trait with dynamic metric registration#65
tolulopedd26 wants to merge 1 commit into
Proof-Stell:mainfrom
tolulopedd26:refactor/metrics-registry

Conversation

@tolulopedd26

Copy link
Copy Markdown

Summary

Refactors MetricsRegistry to support dynamic metric injection and custom labels via a new MetricsBackend trait.

Changes

  • Adds MetricsBackend trait with register_counter(), register_gauge(), register_histogram() methods
  • Implements dynamic metric storage with RwLock-protected HashMaps
  • All 9 trait methods implemented: counter_inc, counter_inc_by, gauge_set, gauge_inc, gauge_dec, histogram_observe
  • 4 new unit tests verifying registration, recording, and error handling

Closes #59

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.

Refactor Metrics Registry to Support Dynamic Metrics Injection and Custom Labels

1 participant