Skip to content

Commit

Permalink
trace_digest and ext
Browse files Browse the repository at this point in the history
  • Loading branch information
ZStriker19 committed Feb 11, 2025
1 parent 9d38187 commit eee20a9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/datadog/tracing/configuration/ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@ module Distributed
# W3C Trace Context
PROPAGATION_STYLE_TRACE_CONTEXT = 'tracecontext'

# W3C Baggage
# @see https://www.w3.org/TR/baggage/
PROPAGATION_STYLE_BAGGAGE = 'baggage'

PROPAGATION_STYLE_SUPPORTED = [PROPAGATION_STYLE_DATADOG, PROPAGATION_STYLE_B3_MULTI_HEADER,
PROPAGATION_STYLE_B3_SINGLE_HEADER, PROPAGATION_STYLE_TRACE_CONTEXT].freeze
PROPAGATION_STYLE_B3_SINGLE_HEADER, PROPAGATION_STYLE_TRACE_CONTEXT,
PROPAGATION_STYLE_BAGGAGE].freeze

# Sets both extract and inject propagation style tho the provided value.
# Has lower precedence than `DD_TRACE_PROPAGATION_STYLE_INJECT` or
Expand Down
2 changes: 2 additions & 0 deletions lib/datadog/tracing/contrib/grpc/distributed/propagation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def initialize(
Tracing::Distributed::Datadog.new(fetcher: Fetcher),
Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_TRACE_CONTEXT =>
Tracing::Distributed::TraceContext.new(fetcher: Fetcher),
Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_BAGGAGE =>
Tracing::Distributed::Baggage.new(fetcher: Fetcher),
Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_NONE => Tracing::Distributed::None.new
},
propagation_style_inject: propagation_style_inject,
Expand Down
1 change: 1 addition & 0 deletions sig/datadog/tracing/configuration/ext.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module Datadog
PROPAGATION_STYLE_B3_MULTI_HEADER: "b3multi"
PROPAGATION_STYLE_B3_SINGLE_HEADER: "b3"
PROPAGATION_STYLE_TRACE_CONTEXT: "tracecontext"
PROPAGATION_STYLE_BAGGAGE: "baggage"
ENV_PROPAGATION_STYLE: "DD_TRACE_PROPAGATION_STYLE"

ENV_PROPAGATION_STYLE_INJECT: "DD_TRACE_PROPAGATION_STYLE_INJECT"
Expand Down
3 changes: 2 additions & 1 deletion sig/datadog/tracing/trace_digest.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ module Datadog
attr_reader trace_state: untyped
attr_reader trace_state_unknown_fields: untyped
attr_reader span_remote: untyped
attr_reader baggage: untyped

def initialize: (?span_id: untyped?, ?span_name: untyped?, ?span_resource: untyped?, ?span_service: untyped?, ?span_type: untyped?, ?trace_distributed_tags: untyped?, ?trace_hostname: untyped?, ?trace_id: untyped?, ?trace_name: untyped?, ?trace_origin: untyped?, ?trace_process_id: untyped?, ?trace_resource: untyped?, ?trace_runtime_id: untyped?, ?trace_sampling_priority: untyped?, ?trace_service: untyped?, ?trace_distributed_id: untyped?, ?trace_flags: untyped?, ?trace_state: untyped?, ?trace_state_unknown_fields: untyped?, ?span_remote: untyped?) -> void
def initialize: (?span_id: untyped?, ?span_name: untyped?, ?span_resource: untyped?, ?span_service: untyped?, ?span_type: untyped?, ?trace_distributed_tags: untyped?, ?trace_hostname: untyped?, ?trace_id: untyped?, ?trace_name: untyped?, ?trace_origin: untyped?, ?trace_process_id: untyped?, ?trace_resource: untyped?, ?trace_runtime_id: untyped?, ?trace_sampling_priority: untyped?, ?trace_service: untyped?, ?trace_distributed_id: untyped?, ?trace_flags: untyped?, ?trace_state: untyped?, ?trace_state_unknown_fields: untyped?, ?span_remote: untyped?, ?baggage: untyped?) -> void
end
end
end

0 comments on commit eee20a9

Please sign in to comment.