Skip to content

Commit

Permalink
fix sentry + honeycomb tracing in conductor (#31360)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 1fd00d95bbf81ac632318a4431af4bfe4a877f35
  • Loading branch information
gautamg795 authored and Convex, Inc. committed Nov 5, 2024
1 parent 7a06980 commit 8fb7063
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/common/src/minitrace_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ pub fn get_sampled_span<R: Rng>(
let sample_ratio = get_sampling_ratio(instance_name, name);
let should_sample = rng.gen_bool(sample_ratio);
match should_sample {
true => Span::root(name.to_owned(), SpanContext::random()).with_properties(|| properties),
true => Span::root(name.to_owned(), SpanContext::random())
.with_properties(|| properties)
.with_property(|| ("dev.convex.instance_name", instance_name.to_owned())),
false => Span::noop(),
}
}
Expand All @@ -70,7 +72,9 @@ pub fn get_keyed_sampled_span<K: Hash + std::fmt::Debug>(
let threshold = ((u32::MAX as f64) * sample_ratio) as u32;
if hash < threshold {
tracing::info!("Sampling span for {key:?}: {name}");
Span::root(name.to_owned(), span_ctx).with_properties(|| properties)
Span::root(name.to_owned(), span_ctx)
.with_properties(|| properties)
.with_property(|| ("dev.convex.instance_name", instance_name.to_owned()))
} else {
tracing::info!("Not sampling span for {key:?}: {name}");
Span::noop()
Expand Down

0 comments on commit 8fb7063

Please sign in to comment.