Skip to content

wip: track access token usage - #4126

Draft
msmithstubbs wants to merge 4 commits into
Logflare:mainfrom
msmithstubbs:feat/track-access-token-usage
Draft

msmithstubbs wants to merge 4 commits into
Logflare:mainfrom
msmithstubbs:feat/track-access-token-usage

Conversation

@msmithstubbs

@msmithstubbs msmithstubbs commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

This PR implements API access token usage based on the usage model in #3592

  • Access token usage is tracked in LogflareWeb.Plugs.VerifyApiAccess once the access token is identified as valid
  • Usage is initially recorded in a local node cache
  • Every 5 minutes AccessTokenUsageSyncWorker polls each node and fetches access token timestamps and persists them in the table oauth_access_token_usages. A separate table is used so updating the last_used_at field won't trigger a cache eviction for the access token
  • Last used timestamp is displayed in the AccessTokensLive UI table. Access tokens without a last used record show Unknown: never would be misleading for access tokens accessed before tracking was implemented.

Small UI refactor for AccessTokensLive:

  • Extract table HTML into CoreComponents.table/1
  • Last used and created timestamps are displayed in the table in the user's local timezone
  • Action buttons are aligned vertically

Closes O11Y-2479

CleanShot 2026-10-09 at 14 55 24@2x

@msmithstubbs
msmithstubbs force-pushed the feat/track-access-token-usage branch from 91a0cab to 6425552 Compare October 9, 2026 06:08
@msmithstubbs
msmithstubbs force-pushed the feat/track-access-token-usage branch from 6425552 to 09a02f0 Compare October 9, 2026 06:48

This branch has not been deployed

No deployments
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