Skip to content

Commit

Permalink
docs: update jwt authentication metric (#6502)
Browse files Browse the repository at this point in the history
  • Loading branch information
Meschreiber authored Jan 3, 2025
1 parent 3bdcacd commit 7d423d5
Showing 1 changed file with 10 additions and 2 deletions.
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

0 comments on commit 7d423d5

Please sign in to comment.