diff --git a/.changesets/exp_njm_operation_error_metrics.md b/.changesets/exp_njm_operation_error_metrics.md index ad75e66cea..202de4987f 100644 --- a/.changesets/exp_njm_operation_error_metrics.md +++ b/.changesets/exp_njm_operation_error_metrics.md @@ -1,14 +1,15 @@ ### Experimental per-operation error metrics ([PR #6443](https://github.com/apollographql/router/pull/6443), [PR #6666](https://github.com/apollographql/router/pull/6666)) Adds a new experimental OpenTelemetry metric that includes error counts at a per-operation and per-client level. These metrics contain the following attributes: -* Operation name -* Operation type (query/mutation/subscription) -* Apollo operation ID -* Client name -* Client version -* Error code -* Path -* Source (subgraph name) + +- Operation name +- Operation type (query/mutation/subscription) +- Apollo operation ID +- Client name +- Client version +- Error code +- Path +- Service (subgraph name) This metric is currently only sent to GraphOS and is not available in 3rd-party OTel destinations. The metric can be enabled using the configuration `telemetry.apollo.errors.experimental_otlp_error_metrics: enabled`. diff --git a/apollo-router/src/services/router/service.rs b/apollo-router/src/services/router/service.rs index 338acab397..9c78cbc549 100644 --- a/apollo-router/src/services/router/service.rs +++ b/apollo-router/src/services/router/service.rs @@ -897,7 +897,7 @@ impl RouterService { "apollo.client.version" = client_version.clone(), "graphql.error.extensions.code" = code_str, "graphql.error.path" = path, - "apollo.router.error.source" = service + "apollo.router.error.service" = service ); } } diff --git a/apollo-router/src/services/router/tests.rs b/apollo-router/src/services/router/tests.rs index 7bfedfd547..4dc9a48bb3 100644 --- a/apollo-router/src/services/router/tests.rs +++ b/apollo-router/src/services/router/tests.rs @@ -697,7 +697,7 @@ async fn it_stores_operation_error_when_config_is_enabled() { KeyValue::new("apollo.client.version", client_version), KeyValue::new("graphql.error.extensions.code", "SOME_ERROR_CODE"), KeyValue::new("graphql.error.path", "/obj/field"), - KeyValue::new("apollo.router.error.source", "mySubgraph"), + KeyValue::new("apollo.router.error.service", "mySubgraph"), ] ); assert_counter!( @@ -711,7 +711,7 @@ async fn it_stores_operation_error_when_config_is_enabled() { KeyValue::new("apollo.client.version", client_version), KeyValue::new("graphql.error.extensions.code", "SOME_OTHER_ERROR_CODE"), KeyValue::new("graphql.error.path", "/obj/arr/@/firstElementField"), - KeyValue::new("apollo.router.error.source", "myOtherSubgraph"), + KeyValue::new("apollo.router.error.service", "myOtherSubgraph"), ] ); }