apollographql / router

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

Add ability to limit the number/type of trace spans created. #3211

Open tmc opened 1 year ago

tmc commented 1 year ago

Some trace span storage systems charge by span event and right now this project produces quite a few spans (at least when used as a federating proxy).

Adding some configuration knobs to reduce the number of spans created would be nice.

BrynCooke commented 1 year ago

@tmc The only option we have at the moment in otel is using sampling rate. Potentially you could use otel collector as an intermediary to try and implement this functionality?

ekafeel commented 1 year ago

We are facing a problem where the number of spans generated by the router is significantly higher than the number generated by the apollo-server, which we previously used as a gateway. This is a concern for us as we use an observability tool that charges based on the amount of data ingested. Sampling is not an option as we want to monitor all the requests. Can you elaborate on how running an intermediary otel collector can help? Also, can rhai script help here in someway?