Skip to content

[codex] Declare Prometheus metric types#625

Merged
winhowes merged 1 commit intomainfrom
codex/prometheus-metric-types
Apr 17, 2026
Merged

[codex] Declare Prometheus metric types#625
winhowes merged 1 commit intomainfrom
codex/prometheus-metric-types

Conversation

@winhowes
Copy link
Copy Markdown
Owner

Summary

  • declare built-in AuthTranslator metric families as Prometheus counters and histograms in the exporter output
  • assert the emitted metric type metadata in the existing metrics tests
  • update the example metrics plugin and docs so custom counters emit matching # TYPE lines too

Why

Grafana was warning on rate(authtranslator_requests_total[5m]) because the exporter emitted raw samples without Prometheus type metadata. The built-in *_total series are monotonic counters, so the fix is to declare them as counters instead of leaving them untyped.

Validation

  • go test ./app/metrics/...
  • go test -tags example ./app/metrics/plugins/example

@winhowes winhowes marked this pull request as ready for review April 17, 2026 18:29
@winhowes
Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@winhowes winhowes merged commit 92dab71 into main Apr 17, 2026
3 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.

1 participant