Skip to content

Commit

Permalink
Fix traceflags impl
Browse files Browse the repository at this point in the history
Signed-off-by: Caleb Schoepp <[email protected]>
  • Loading branch information
calebschoepp committed Sep 11, 2024
1 parent 698712a commit b89bf92
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion crates/world/src/conversions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,16 @@ mod observe {
}
}

impl From<opentelemetry::trace::TraceFlags> for traces::TraceFlags {
fn from(flags: opentelemetry::trace::TraceFlags) -> Self {
if flags.is_sampled() {
traces::TraceFlags::SAMPLED
} else {
traces::TraceFlags::empty()
}
}
}

impl TryFrom<traces::SpanContext> for opentelemetry::trace::SpanContext {
type Error = wasmtime::Error;

Expand Down Expand Up @@ -286,7 +296,7 @@ mod observe {
((whole >> 64) as u64, whole as u64)
},
span_id: u64::from_le_bytes(sc.span_id().to_bytes()),
trace_flags: traces::TraceFlags::all(), // TODO(Caleb): This is broken
trace_flags: sc.trace_flags().into(),
is_remote: sc.is_remote(),
trace_state: sc
.trace_state()
Expand Down

0 comments on commit b89bf92

Please sign in to comment.