Skip to content

Claude/metrics improvements g zlv j#7

Merged
els0r merged 2 commits into
mainfrom
claude/metrics-improvements-GZlvJ
Mar 16, 2026
Merged

Claude/metrics improvements g zlv j#7
els0r merged 2 commits into
mainfrom
claude/metrics-improvements-GZlvJ

Conversation

@els0r

@els0r els0r commented Mar 15, 2026

Copy link
Copy Markdown
Owner

No description provided.

claude added 2 commits March 15, 2026 20:48
- Fix "reponse" typo in metrics help text
- Remove unnecessary loop variable copy in registerMetrics

https://claude.ai/code/session_011rJHSN2dVRXMtf67yy3NkF
…ort (Phase 4)

BREAKING CHANGES:
- NewPrometheus now requires a *prometheus.Registry parameter (pass nil
  for a fresh registry, or the default registry for backward compat).
  This prevents panics from duplicate metric registration in tests.
- HandlerFunc() renamed to GinHandlerFunc() to avoid confusion with
  the new net/http HandlerFunc(next) middleware.
- reqSz/resSz changed from Summary (which was useless without quantile
  objectives) to Histogram with exponential buckets.

New features:
- H7: Accept *prometheus.Registry instead of using the global registry
- H7: Add net/http middleware via HandlerFunc(next http.Handler) http.Handler
- H7: Add MetricsHandler() for serving metrics in net/http setups
- H7: Expose pathLabelFromContext via WithPathLabelFromContext option
  (was dead code with no public setter)
- H7: Fix unsafe type assertion on context value (now checks type)
- H7: responseWriter wrapper for net/http to capture status and size

https://claude.ai/code/session_011rJHSN2dVRXMtf67yy3NkF
@els0r els0r merged commit f92ddc6 into main Mar 16, 2026
4 checks passed
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.

2 participants