cloudflare / foundations

Cloudflare's Rust service foundations library.
https://blog.cloudflare.com/introducing-foundations-our-open-source-rust-service-foundation-library
BSD 3-Clause "New" or "Revised" License
1.25k stars 51 forks source link

chore: add passive sampling option to tracing #63

Closed lbarthon closed 3 weeks ago

lbarthon commented 1 month ago

When we have many services in the same flow, we want to defer the sampling logic to the parent service (which will defer to the root service in the end).

The PassiveSampler is really good for that, as it will only sample traces that have one external reference. This assumes that the parent service will send the trace info to stitch, if we should keep it, and won't, if we should discard it. This is what some of our services do already today, and it would really help us onboard to foundations!

This needs https://github.com/cloudflare/rustracing/pull/2 merged & cf-rustracing bumped in order to compile and work fine.