Skip to content

refactor: reduce metrics cardinality and set protocol via middleware#34

Merged
wolfeidau merged 2 commits into
mainfrom
refactor_metrics
Feb 15, 2026
Merged

refactor: reduce metrics cardinality and set protocol via middleware#34
wolfeidau merged 2 commits into
mainfrom
refactor_metrics

Conversation

@wolfeidau
Copy link
Copy Markdown
Member

@wolfeidau wolfeidau commented Feb 15, 2026

  • Split HTTP metrics into shared SLO counters (protocol, status_class, cache_result) and a detail counter that includes endpoint
  • Add WithProtocol middleware to set protocol at route mount time, replacing path-based derivation in RecordHTTP
  • Drop method label from all metrics and move endpoint out of shared metrics
  • Default cache_result to "bypass", add "na" for internal routes
  • Remove dead alreadyInitialized code from InitMetrics
  • Add local dev stack: Grafana dashboards, Prometheus config, Procfile

  - Split HTTP metrics into shared SLO counters (protocol, status_class, cache_result) and a detail counter that includes endpoint
  - Add WithProtocol middleware to set protocol at route mount time, replacing path-based derivation in RecordHTTP
  - Drop method label from all metrics and move endpoint out of shared metrics
  - Default cache_result to "bypass", add "na" for internal routes
  - Remove dead alreadyInitialized code from InitMetrics
  - Add local dev stack: Grafana dashboards, Prometheus config, Procfile
- Add tags_test.go covering InjectTags defaults, setter round-trips, and pointer visibility
- Add metrics_test.go covering RecordHTTP shared vs detail metric split and StatusClass
- Remove TLS from dev Procfile, Prometheus, and Grafana for Docker container access
@wolfeidau wolfeidau merged commit 032d5d6 into main Feb 15, 2026
1 check passed
@wolfeidau wolfeidau deleted the refactor_metrics branch February 15, 2026 00:49
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