Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
marcotc committed Jun 5, 2024
1 parent 45d6ef0 commit 2675f58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/datadog/tracing/trace_operation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def initialize(
sampled: nil,
sampling_priority: nil,
service: nil,
default_service: nil,
profiling_enabled: nil,
tags: nil,
metrics: nil,
Expand Down Expand Up @@ -97,6 +98,7 @@ def initialize(
@sample_rate = sample_rate
@sampling_priority = sampling_priority
@service = service
@default_service = default_service
@profiling_enabled = profiling_enabled
@trace_state = trace_state
@trace_state_unknown_fields = trace_state_unknown_fields
Expand Down Expand Up @@ -171,7 +173,7 @@ def resource_override?
end

def service
@service || (root_span && root_span.service)
@service || (root_span && root_span.service) || @default_service
end

def measure(
Expand Down
4 changes: 2 additions & 2 deletions lib/datadog/tracing/tracer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -323,21 +323,21 @@ def build_trace(digest = nil)
id: digest.trace_id,
origin: digest.trace_origin,
parent_span_id: digest.span_id,
service: @default_service,
sampling_priority: digest.trace_sampling_priority,
# Distributed tags are just regular trace tags with special meaning to Datadog
tags: digest.trace_distributed_tags,
trace_state: digest.trace_state,
trace_state_unknown_fields: digest.trace_state_unknown_fields,
remote_parent: digest.span_remote,
default_service: @default_service,
_inherit_parent_service: @_inherit_parent_service,
)
else
TraceOperation.new(
hostname: hostname,
profiling_enabled: profiling_enabled,
service: @default_service,
remote_parent: false,
default_service: @default_service,
_inherit_parent_service: @_inherit_parent_service,
)
end
Expand Down

0 comments on commit 2675f58

Please sign in to comment.