diff --git a/.changesets/docs_wrapper_snowstorm_dungeon_kerosene.md b/.changesets/docs_wrapper_snowstorm_dungeon_kerosene.md new file mode 100644 index 0000000000..dd7eaab112 --- /dev/null +++ b/.changesets/docs_wrapper_snowstorm_dungeon_kerosene.md @@ -0,0 +1,5 @@ +### Docs: Document http_client span attribute limitations ([PR #8967](https://github.com/apollographql/router/pull/8967)) + +Document that `http_client` span attributes do not support conditions or the `static` selector, causing a router startup failure when attempted. + +By [@mabuyo](https://github.com/mabuyo) in https://github.com/apollographql/router/pull/8967 \ No newline at end of file diff --git a/docs/source/routing/observability/router-telemetry-otel/enabling-telemetry/selectors.mdx b/docs/source/routing/observability/router-telemetry-otel/enabling-telemetry/selectors.mdx index b79f952297..acbcf7a0c4 100644 --- a/docs/source/routing/observability/router-telemetry-otel/enabling-telemetry/selectors.mdx +++ b/docs/source/routing/observability/router-telemetry-otel/enabling-telemetry/selectors.mdx @@ -113,6 +113,12 @@ The subgraph service executes multiple times during query execution, with each e The HTTP client service also executes multiple times. Each execution represents an HTTP request to a single subgraph or REST service. This service executes after any Rhai scripts that modify subgraph requests, so these selectors can observe headers added by scripts. + + +The `http_client` service supports the `request_header` and `response_header` selectors. Conditions and the `static` selector are currently unavailable for this service. If you attempt to configure them, your router fails to start. + + + | Selector | Defaultable | Values | Description | |--------------------|-------------|--------|-------------------------------| | `request_header` | Yes | | The name of a request header | diff --git a/docs/source/routing/observability/router-telemetry-otel/enabling-telemetry/spans.mdx b/docs/source/routing/observability/router-telemetry-otel/enabling-telemetry/spans.mdx index 89c7c651e1..2ec913036f 100644 --- a/docs/source/routing/observability/router-telemetry-otel/enabling-telemetry/spans.mdx +++ b/docs/source/routing/observability/router-telemetry-otel/enabling-telemetry/spans.mdx @@ -71,6 +71,8 @@ telemetry: You can also have [conditions](/router/configuration/telemetry/instrumentation/conditions) on custom attributes using [selectors](/router/configuration/telemetry/instrumentation/selectors). You can only have conditions on a selector at the same execution level. Example you can't have a condition on `response_header` if you want to set an attribute from `request_header`. +Conditions and the `static` selector are supported for the `router`, `supergraph`, `subgraph`, and `connector` services. They are not supported for `http_client` span attributes. For details, see the [http_client span attributes](#http_client-span-attributes) section. + ```yaml title="desc.router.yaml" telemetry: instrumentation: @@ -270,6 +272,16 @@ telemetry: The `http_client` span is created for each HTTP request to a subgraph or REST service. It executes after any [Rhai scripts](/router/customizations/rhai) that modify subgraph requests, so its selectors can observe headers added by scripts. + + +`http_client` span attributes support the `request_header` and `response_header` selectors. Use these selectors to configure your attributes. If you attempt to use conditions or the `static` selector, the router fails to start with an error similar to: + +``` +could not create router: failed to parse attribute '...': unknown field '...', there are no fields +``` + + + Extract custom attributes from request and response headers using the `request_header` and `response_header` [selectors](/router/configuration/telemetry/instrumentation/selectors). ```yaml title="router.yaml"