router
router copied to clipboard
Add subgraph span attribute for http status code
Is your feature request related to a problem? Please describe.
In Router 1.35.0+ you can now configure which span attributes are included. For the router layer we have the following options which includes http.response.status_code
However for subgraph attributes we only have access to the GraphQL metadata like subgraph.graphql.operation.name and so I can't see the HTTP status code of my subgraph calls. The status code was the primarly data needed by a customer but all the HTTP info is also useful.
Describe the solution you'd like Add the same http options to subgraph span attributes to configure the http information. Some of these maybe should be off by default but allow enabling if needed
telemetry:
instrumentation:
spans:
router:
attributes:
# Exists today
http.response.status_code: true
subgraph:
attributes:
# New features
http.request.body.size: true
http.response.status_code: true
http.response.body.size: true
Describe alternatives you've considered I can look at the span generated by my subgraph Otel library but Router has this info already, we are just not exposing it
Additional context This would allow users to more easily build dashboards to help find subgraph errors like auth problems. This is probably an extension of the megaissue https://github.com/apollographql/router/issues/3226