MPP-4012 - feat(glean): log API access as Glean server event #5500
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TODO
- https://bugzilla.mozilla.org/show_bug.cgi?id=1882565#c16
Introduce a new
api.accessed
Glean event to capture accesses to Relay API endpoints. This includes the HTTP method and endpoint path, and logs events for all/api/
prefixed routes via a new middleware component.record_api_accessed()
toEventsServerEventLogger
RelayGleanLogger
withlog_api_accessed()
for easier integrationGleanApiAccessMiddleware
to log access for all API routesrelay-server-metrics.yaml
to define theapi.accessed
metricThis PR fixes #MPP-4012 and #MPP-4014.
How to test:
pytest
should test that glean logging is working- https://app.circleci.com/pipelines/github/mozilla/fx-private-relay/21940/workflows/94f38d67-3f2c-4c0a-baac-19fb47402351/jobs/251876
- https://github.com/mozilla/fx-private-relay/actions/runs/14453273732/job/40530682690?pr=5500
l10n changes have been submitted to the l10n repository, if any.I've added or updated relevant docs in the docs/ directory.All UI revisions follow the coding standards, and use Protocol / Nebula colors where applicable (see/frontend/src/styles/colors.scss
).