Skip to content

Commit

Permalink
finish cut off docs for sampled trace filter
Browse files Browse the repository at this point in the history
  • Loading branch information
KodrAus committed Jan 6, 2025
1 parent 2ae52d4 commit 389ee87
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion traceparent/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ fn main() {
```
Note that other events emitted within an unsampled trace will still be emitted.
You can
You can add the [`in_sampled_trace`] filter to filter out events in unsampled traces:
```
use std::sync::atomic::{AtomicUsize, Ordering};
Expand All @@ -191,6 +191,9 @@ fn main() {
rt.blocking_flush(std::time::Duration::from_secs(30));
}
```
The `true` parameter passed to `in_sampled_trace` here includes events that aren't in any trace.
Passing `false` will also filter out events that aren't part of any trace.
*/
pub fn setup_with_sampler<S: Fn(&SpanCtxt) -> bool + Send + Sync + 'static>(
sampler: S,
Expand Down

0 comments on commit 389ee87

Please sign in to comment.