You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose Codex reset-credit metrics and provide monitoring examples #622
The optional authenticated /metrics endpoint is in main, and Codex already fetches /wham/rate-limit-reset-credits for its informational UI window. Today the reset-credit request runs on each successful usage fetch, the count and expiry are absent from Prometheus, and the repository has no importable Chinese Grafana dashboard or Prometheus alert examples.
Requested behavior
Expose codexbar_reset_credits_available{provider="codex"} with nonnegative counts (0 means exhausted) and -1 when unavailable or in PAT mode.
Expose codexbar_reset_credits_next_expiry_timestamp_seconds{provider="codex"} only for the earliest future expiry among available credits. Do not expose credit IDs or unbounded labels.
Cache both successful and unavailable reset-credit observations for 10 minutes, scoped by account, credential, and API base URL. Keep independent observations for suspicious weekly-reset confirmation.
Provide an importable Chinese Grafana dashboard (weekly by default, single/all-node selection) and sample authenticated Prometheus scrape and alert rules using the current fixed ratio metric names.
Document the metric semantics, especially -1 versus 0, and verify the metrics and cache behavior with tests.
The existing dashboard snapshot and non-blocking /metrics collection architecture should remain intact.
Activity
Finesssee commentedon Sep 29, 2026
Thanks for the report, I will fix this ASAP.