From 7d423d5cfbe88bbc079a14afcfb4e41aedd2da5f Mon Sep 17 00:00:00 2001 From: Maria Elisabeth Schreiber Date: Fri, 3 Jan 2025 02:26:38 -0700 Subject: [PATCH] docs: update jwt authentication metric (#6502) --- docs/source/routing/security/jwt.mdx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/source/routing/security/jwt.mdx b/docs/source/routing/security/jwt.mdx index ece4d02c77..e9fc266660 100644 --- a/docs/source/routing/security/jwt.mdx +++ b/docs/source/routing/security/jwt.mdx @@ -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. + + + +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 @@ -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. + + + ## 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.