-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trace sampling #228
Comments
Following up on the tests in #224 and #237, and after discussing it, the idea of adapting the sampling rate on the result (example: aggressive sampling for successful queries, no sampling for failed ones so we can receive them all) has tradeoffs we might not want to make yet: this requires that we do tail sampling, where we store all of the spans until the end of the query, and then decide if we want to send the trace. This can result in high memory usage, especially with long running queries. This will also be difficult to get right. |
Hi @Geal, I saw your issue link and thought I'd drop a note here. We ended up implementing a proof-of-concept tail sampling for To utilize the tail sampling layer, we internally added an extension method to the fn drop_this_trace(&self) {
dispatcher::get_default(|d| {
let registry = d
.downcast_ref::<Registry>()
.expect("Subscriber is not Registry; this is a bug.");
let span = d.current_span();
let spanref = registry.span(&span.id().unwrap()).unwrap();
let extensions = spanref.extensions();
let trace_context = extensions.get::<TraceContext>().unwrap();
let mut trace_ext = trace_context.trace.extensions_mut();
trace_ext.insert(SampleDecision {
record_trace: false,
});
});
} For now we are just calling this in our application code, but it should be possible to write a tracing layer to be inserted before the tracing-opentelemetry layer to look for span attributes having a particular status code (if I'm understanding your use case correctly) and adding the If you want to try it out, I'd be happy to answer any questions or take feedback you may have. Cheers! |
# [v0.1.0-alpha.3] 2022-01-11 ## 🚀🌒 Public alpha release > An alpha or beta release is in volatile, active development. The release might not be feature-complete, and breaking API changes are possible between individual versions. ## ✨ Features - Trace sampling [#228](#228): Tracing each request can be expensive. The router now supports sampling, which allows us to only send a fraction of the received requests. - Health check [#54](#54) ## 🐛 Fixes - Schema parse errors [#136](#136): The router wouldn't display what went wrong when parsing an invalid Schema. It now displays exactly where a the parsing error occurred, and why. - Various tracing and telemetry fixes [#237](#237): The router wouldn't display what went wrong when parsing an invalid Schema. It now displays exactly where a the parsing error occurred, and why. - Query variables validation [#62](#62): Now that we have a schema parsing feature, we can validate the variables and their types against the schemas and queries.
there was an issue with recent attempted publishes due to a bad secret rotation. this PR temporarily disables cargo publishes in our CI pipelines while we create GitHub releases. It will be enabled once the packages are properly released.
related:
request tracing can be expensive, we should have a way to select which traces should be sent to jaeger or opentelemetry.
The text was updated successfully, but these errors were encountered: