apollographql / router

A configurable, high-performance routing runtime for Apollo Federation 🚀
https://www.apollographql.com/docs/router/
Other
807 stars 272 forks source link

Add trace id to log statements even when it is not sampled #4035

Open kira-u opened 1 year ago

kira-u commented 1 year ago

Describe the solution you'd like Currently, when sampling rate is not 100%, trace_id is not added to logs. It makes impossible to connect logs to individual requests.

Describe alternatives you've considered Having another "request-id" header moving between services, IMO, is just a duplicate - it would serve the same purpose as trace-id. If request-id and trace-id are different, it makes harder to connect traces with logs.

Maybe I'm not aware of something and there is already a way to achieve the goal?

BrynCooke commented 1 year ago

We're actively looking at this as part of #3226, which is currently in development.