Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update jwt authentication metric #6502

Merged
merged 2 commits into from
Jan 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions docs/source/routing/security/jwt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -745,12 +745,16 @@ If you _do_ need to pass entire JWTs to subgraphs, you can do so via the GraphOS

If your router enables [tracing](/router/configuration/telemetry/exporters/tracing/overview), the JWT authentication plugin has its own tracing span: `authentication_plugin`

If your router enables [metrics collection via Prometheus](/router/configuration/telemetry/exporters/metrics/prometheus), the JWT authentication plugin provides and exports the following metrics:
If your router [exports metrics](/router/configuration/telemetry/exporters/metrics), the JWT authentication plugin exports the `apollo.router.operations.authentication.jwt` metric. You can use the metric's `authentication.jwt.failed` attribute to count failed authentications. If the `authentication.jwt.failed` attribute is absent or `false`, the authentication succeeded.

<Note>

Before [v1.59.0](https://github.com/apollographql/router/releases/tag/v1.59.0), the JWT authentication exported the following metrics:

- `apollo_authentication_failure_count`
- `apollo_authentication_success_count`

Those metrics have the following shapes:
These metrics have the following shapes:

```
# HELP apollo_authentication_failure_count apollo_authentication_failure_count
Expand All @@ -762,6 +766,10 @@ apollo_authentication_failure_count{kind="JWT",service_name="apollo-router"} 1
apollo_authentication_success_count{kind="JWT",service_name="apollo-router"} 11
```

These metrics are [deprecated](graphos/reference/router/telemetry/instrumentation/standard-instruments#deprecated). Please update to the most recent router version to use the updated `apollo.router.operations.authentication.jwt` metric.

</Note>

## Additional resources

You can use the Apollo Solutions [router JWKS generator](https://github.com/apollosolutions/router-jwks-generator) to create a router configuration file for use with the authentication plugin.
Expand Down
Loading