Skip to content

feat(fx-api): add request duration histogram - #6875

Draft
GregHilstonMozilla wants to merge 2 commits into
mainfrom
mntor-5347
Draft

GregHilstonMozilla wants to merge 2 commits into
mainfrom
mntor-5347

Conversation

@GregHilstonMozilla

@GregHilstonMozilla GregHilstonMozilla commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

References:

Jira: MNTOR-5347

Description

Adds firefox_api_request_duration_seconds, a histogram timing every request to the Firefox API endpoints in openapi.yml. It's recorded in withFxaUser, so auth failures (401) and rate limited requests (429) are timed too, not just the handler.

Historically, I had some downtime, so some work from the ticket already landed in #6862, #6869, #6873 and #6874.

Observability

Latency panels (p50/p95/p99 by endpoint) and alerts are coming in later via MNTOR-5348.

How to test

npx vitest run src/app/api/utils/withFxaUser.test.ts src/app/api/firefox

Checklist (Definition of Done)

  • Commits in this PR are minimal and have descriptive commit messages.
  • I've added or updated the relevant sections in readme and/or code comments
  • I've added a unit test to test for potential regressions of this bug.
  • Jira ticket has been updated (if needed) to match changes made during the development process.

Time every Firefox API request in withFxaUser, auth and rate
limit included, as firefox_api_request_duration_seconds, labelled
by endpoint and status_code.
@GregHilstonMozilla GregHilstonMozilla self-assigned this Oct 21, 2026
gate catches every error itself, so the outer try/finally and its
500 default never ran.

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