From 32b7a27c3ad699027089a558e9fb08a0214b9aa9 Mon Sep 17 00:00:00 2001 From: Munir Abdinur Date: Wed, 17 Apr 2024 12:44:43 -0400 Subject: [PATCH] fix: sampling decision set in span links --- lib/datadog/tracing/span_link.rb | 2 +- spec/datadog/tracing/span_link_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/datadog/tracing/span_link.rb b/lib/datadog/tracing/span_link.rb index 8194b2e1c4..637a044a12 100644 --- a/lib/datadog/tracing/span_link.rb +++ b/lib/datadog/tracing/span_link.rb @@ -46,7 +46,7 @@ def initialize( ) @span_id = digest&.span_id @trace_id = digest&.trace_id - @trace_flags = digest&.trace_flags + @trace_flags = digest&.trace_sampling_priority && digest&.trace_sampling_priority > 0 ? 1 : 0 @trace_state = digest&.trace_state && digest&.trace_state.dup @dropped_attributes = 0 @attributes = (attributes && attributes.dup) || {} diff --git a/spec/datadog/tracing/span_link_spec.rb b/spec/datadog/tracing/span_link_spec.rb index d9e1dcdce8..8edcfcb1e3 100644 --- a/spec/datadog/tracing/span_link_spec.rb +++ b/spec/datadog/tracing/span_link_spec.rb @@ -12,7 +12,7 @@ Datadog::Tracing::TraceDigest.new( span_id: span_id, trace_id: trace_id, - trace_flags: trace_flags, + trace_sampling_priority: trace_flags, trace_state: trace_state, ) end