User token metrics - #2085
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5ad1cd2e4
ℹ️ 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".
|
🚅 Deployed to the anticapture-pr-2085 environment in anticapture-infra
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a7730fc8d7
ℹ️ 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".
|
🔍 Vercel preview: https://anticapture-o6v8jyv3r-ful.vercel.app |
- serve before initial metrics refresh so slow Authful can't keep /health down - publish DB counts independently of Authful in metrics refresh - derive daily-active from usage records, not lastUsedAt (survives Gateful cache hits) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f231dbec87
ℹ️ 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".
- export user_api_keys_created_total as a real counter incremented on creation instead of a mutable row count (cascade delete on account removal read as a counter reset / false increase() spike) - guard MetricsSnapshotService.refresh against overlapping runs so a slow Authful can't clobber a newer snapshot or pile up fetches Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9f6d3996a9
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d1e5e39ab6
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d0dcc8be4
ℹ️ 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".
Save-key modal: default width on both steps, no key name or em-dash in the description, 'Key' and 'MCP' titles at the same font size, no 'waiting for the first call' status, and animated code-block height when switching client tabs. Keys table truncates long names with an ellipsis. Usage section: key switcher is a dropdown with a max width, blank slate for the empty state, and reduced height. Connect section retitled 'MCP' with 'connect your AI agent' in the description. Modal close button uses the small icon-button size. ClickUp: 86ajr888u Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…erflow Long API key names are truncated to 24 chars in the usage chart series (tooltip and legend), with the id suffix disambiguating names that collapse to the same truncated label. The stacked-bar-chart legend now scrolls instead of wrapping, so many/long series names no longer overflow into the x-axis on narrow screens. ClickUp: 86ajr888u Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 77becf7808
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const res = await fetch( | ||
| `${this.baseUrl}/tokens/active?since=${encodeURIComponent(since.toISOString())}`, | ||
| { headers: this.headers() }, |
There was a problem hiding this comment.
When Authful accepts the connection but never finishes /tokens/active, this fetch has no abort signal or timeout. With the current serialized MetricsSnapshotService.refresh() path, that single pending promise keeps refreshing true and every later interval tick returns immediately, so the User API's validation metrics can remain frozen until the process restarts; add a bounded AbortSignal.timeout(...) like the other Authful clients use for internal calls.
Useful? React with 👍 / 👎.
🎨 UI Review
API Keys page — Save-key modalValidated against the ClickUp checklist, no change needed on any of these:
Keys tableNice-to-have — full-name-on-hover uses the browser's native tooltip instead of the DS Truncation itself ( Usage sectionValidated against the ClickUp checklist, no change needed on any of these:
Mobile
MCP section (formerly "Connect your AI agent")Validated against the ClickUp checklist, no change needed:
Design-system adherenceNo new hand-rolled primitives — the diff only reconfigures existing Scope noteThis is a UI-only review (visual fidelity, DS adherence, UX, copy, responsive behavior) — architecture, hook structure, and other code-quality concerns are left to the code reviewer. Generated by Claude Code |
Note
Medium Risk
Touches metrics exposure (optional bearer on /metrics), periodic DB + Authful calls at startup, and a new Authful listing API; misconfigured tokens could block scrapes or leak metrics if left unset in prod.
Overview
Adds low-cardinality validation observability for the self-service User API: account totals, live/created API keys, and “active today” users bucketed by newest key age (
0-1d…30d+), using a minute refresh that joins User API DB counts with Authful’s notion of tokens used since São Paulo midnight (GMT-3).Authful exposes
GET /tokens/active?since=(provisioning scope) returning onlyuser:*token IDs withlastUsedAtat or aftersince, excluding ops tenants; covered by integration tests.User API wires
MetricsSnapshotService+registerValidationMetricswhen Authful provisioning is configured, calls Authful viaactiveTokenIds, and optionally protects/metricswithUSER_API_METRICS_TOKEN(public when unset).Monitoring: Prometheus scrapes User API with bearer auth; new Grafana User API Validation dashboard; TSDB retention bumped to 180d / 40GB; PR-environment NOOP deploy overrides removed from Grafana/Prometheus Railway configs.
Reviewed by Cursor Bugbot for commit a7730fc. Configure here.