cosmo
cosmo copied to clipboard
Attach a unique request ID in a header such as `X-Request-Id` and pass to subgraphs
Component(s)
No response
Is your feature request related to a problem? Please describe.
We have a need to be able to associate federated subgraph requests in a common place -- in shared logs, in particular. When subgraph services all log to a common place, it would be very helpful to associate them with a single client-server operation for debugging and other purposes.
Describe the solution you'd like
To achieve this, the proposal is to add a request ID that is unique per GraphQL operation on the supergraph, and passed along to each of the subgraphs in the form of an HTTP header such as X-Request-Id
. (I'm not strongly opinionated about this specific header, so if you have a more standard name that'd be fine, as long as it is documented.). This request ID needs to be unique and maintained across the entire client -> server response. (It might be a good idea to pass this ID back in the response as well, although that's optional with respect to our specific need.)
Describe alternatives you've considered
It has been suggested that we use the Traceparent header which contains a trace ID and other information. I think that X-Request-Id
is a simpler alternative.
Additional context
No response
WunderGraph commits fully to Open Source and we want to make sure that we can help you as fast as possible. The roadmap is driven by our customers and we have to prioritize issues that are important to them. You can influence the priority by becoming a customer. Please contact us here.