Skip to content

Commit

Permalink
ensure link ids have the correct type
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdinur committed Apr 19, 2024
1 parent 374d5e9 commit 7e9fe1e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions lib/datadog/opentelemetry/sdk/span_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ def start_datadog_span(span)
unless span.links.nil?
datadog_span.links = span.links.map do |link|
Datadog::Tracing::SpanLink.new(
attributes: link.attributes,
digest: Datadog::Tracing::TraceDigest.new(
trace_id: link.span_context.trace_id,
span_id: link.span_context.span_id,
Datadog::Tracing::TraceDigest.new(
trace_id: link.span_context.trace_id.unpack1('Q'),
span_id: link.span_context.span_id.unpack1('Q'),
trace_flags: (link.span_context.trace_flags&.sampled? ? 1 : 0),
trace_state: link.span_context.tracestate&.to_s,
span_remote: link.span_context.remote?,
)
),
attributes: link.attributes
)
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/datadog/opentelemetry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@
let(:sc1) { OpenTelemetry::Trace::SpanContext.new(trace_id: 36893488147419103231, span_id: 2) }
let(:sc2) do
OpenTelemetry::Trace::SpanContext.new(
trace_id: 1234534,
span_id: 67890,
trace_id: [1234534].pack('Q'),
span_id: [67890].pack('Q'),
trace_flags: OpenTelemetry::Trace::TraceFlags::SAMPLED,
tracestate: OpenTelemetry::Trace::Tracestate.from_string('otel=blahxd')
)
Expand Down

0 comments on commit 7e9fe1e

Please sign in to comment.