Skip to content

fix(metrics): bound HTTP method label cardinality - #225

Draft
GatewayJ wants to merge 1 commit into
rustfs:mainfrom
GatewayJ:agent/fix-1097-bound-http-method-metrics
Draft

fix(metrics): bound HTTP method label cardinality#225
GatewayJ wants to merge 1 commit into
rustfs:mainfrom
GatewayJ:agent/fix-1097-bound-http-method-metrics

Conversation

@GatewayJ

@GatewayJ GatewayJ commented Aug 5, 2026

Copy link
Copy Markdown
Member

Type of Change

  • New Feature
  • Bug Fix
  • Documentation
  • Performance Improvement
  • Test/CI
  • Refactor
  • Other:

Related Issues

Fixes rustfs/backlog#1097

Summary of Changes

  • normalize HTTP method labels at the shared record_http_request boundary
  • preserve the nine standard HTTP methods and group all custom methods as OTHER
  • keep operator and Console middleware paths on the same bounded-label rule
  • add unit and Axum middleware coverage for custom-method aggregation

Checklist

  • I have read and followed the CONTRIBUTING.md guidelines
  • Passed make pre-commit (fmt-check + clippy + test + console-lint + console-fmt-check)
  • Added/updated necessary tests
  • Documentation: N/A; the exported metric name and label keys are unchanged
  • CHANGELOG: N/A; this is a metrics cardinality hardening fix
  • CI/CD passed (pending GitHub Actions)

Impact

  • Breaking change (CRD/API compatibility)
  • Requires doc/config/deployment update
  • Other impact: custom HTTP method series are consolidated under method="OTHER"

Verification

make pre-commit

Additional Notes

Normalization happens before both the counter and duration-summary maps are updated, so untrusted method values cannot create persistent metric series. Existing standard-method labels remain unchanged.


Thank you for your contribution! Please ensure your PR follows the community standards (CODE_OF_CONDUCT.md) and sign the CLA if this is your first contribution.

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