Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Steepfile
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,13 @@ target :datadog do
ignore 'lib/datadog/profiling/scheduler.rb'
ignore 'lib/datadog/profiling/tag_builder.rb'
ignore 'lib/datadog/profiling/tasks/setup.rb'
ignore 'lib/datadog/tracing.rb'
ignore 'lib/datadog/tracing/buffer.rb'
ignore 'lib/datadog/tracing/client_ip.rb'
ignore 'lib/datadog/tracing/component.rb'
ignore 'lib/datadog/tracing/configuration/ext.rb'
ignore 'lib/datadog/tracing/configuration/settings.rb'
ignore 'lib/datadog/tracing/context.rb'
ignore 'lib/datadog/tracing/contrib/'
ignore 'lib/datadog/tracing/correlation.rb'
ignore 'lib/datadog/tracing/diagnostics/environment_logger.rb'
ignore 'lib/datadog/tracing/diagnostics/health.rb'
ignore 'lib/datadog/tracing/distributed/datadog.rb'
Expand Down
4 changes: 2 additions & 2 deletions lib/datadog/tracing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ def active_span
# @public_api
def keep!
trace = active_trace
active_trace.keep! if trace
trace.keep! if trace
end

# (see Datadog::Tracing::TraceSegment#reject!)
# If no trace is active, no action is taken.
# @public_api
def reject!
trace = active_trace
active_trace.reject! if trace
trace.reject! if trace
end

# (see Datadog::Tracing::Tracer#active_correlation)
Expand Down
22 changes: 17 additions & 5 deletions sig/datadog/tracing.rbs
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
module Datadog
module Tracing
def self.continue_trace!: (TraceDigest) ? { (untyped) -> untyped } -> untyped
type on_error = ^(SpanOperation span_op, Exception error) -> void

def self.active_trace: -> TraceSegment?
def self.active_span: -> SpanOperation?
def self.trace: (untyped name, ?continue_from: untyped?, ?on_error: untyped?, ?resource: untyped?, ?service: untyped?, ?start_time: untyped?, ?tags: untyped?, ?type: untyped?, ?id: untyped?) { (?) -> untyped } -> untyped
def self.continue_trace!: (TraceDigest digest) ?{ (?) -> untyped } -> untyped
def self.logger: () -> untyped
def self.active_trace: () -> TraceSegment?
def self.active_span: () -> SpanOperation?
def self.keep!: () -> untyped
def self.reject!: () -> untyped
def self.correlation: () -> Correlation::Identifier
def self.log_correlation: () -> ("" | untyped)
def self.baggage: () -> untyped
def self.shutdown!: () -> (nil | untyped)
def self.before_flush: (*untyped processors) { (?) -> untyped } -> untyped
def self.enabled?: () -> bool

def self.enabled?: -> bool
private
def self.components: () -> untyped

type on_error = ^(SpanOperation span_op, Exception error) -> void
def self.tracer: () -> untyped
end
end
46 changes: 43 additions & 3 deletions sig/datadog/tracing/correlation.rbs
Original file line number Diff line number Diff line change
@@ -1,10 +1,50 @@
module Datadog
module Tracing
module Correlation
Identifier: Struct[untyped]
class Identifier
@env: String?

def self?.identifier_from_context: (untyped context) -> Struct[untyped] # Identifier
@service: String

@span_id: String

@trace_id: String

@version: String

@to_h: untyped

@log_format: untyped

LOG_ATTR_ENV: "dd.env"

LOG_ATTR_SERVICE: "dd.service"

LOG_ATTR_SPAN_ID: "dd.span_id"

LOG_ATTR_TRACE_ID: "dd.trace_id"

LOG_ATTR_VERSION: "dd.version"

LOG_ATTR_SOURCE: "ddsource"

attr_reader env: String?

attr_reader service: String

attr_reader span_id: String

attr_reader version: String
def initialize: (?env: untyped?, ?service: untyped?, ?span_id: untyped?, ?trace_id: untyped?, ?version: untyped?) -> void

def to_h: () -> untyped
def to_log_format: () -> untyped

def trace_id: () -> untyped
end
def self?.identifier_from_digest: (untyped digest) -> untyped

def self?.format_trace_id: (untyped trace_id) -> untyped
end
end
end

99 changes: 95 additions & 4 deletions sig/datadog/tracing/trace_segment.rbs
Original file line number Diff line number Diff line change
@@ -1,73 +1,164 @@
module Datadog
module Tracing
class TraceSegment
TAG_NAME: ::String
TAG_RESOURCE: ::String
TAG_SERVICE: ::String
@id: untyped

@root_span_id: untyped

@spans: untyped
@meta: untyped

@metrics: untyped
@agent_sample_rate: untyped

@hostname: untyped

@lang: untyped

@name: untyped

@origin: untyped

@process_id: untyped

@rate_limiter_rate: untyped

@resource: untyped

@rule_sample_rate: untyped

@runtime_id: untyped

@sample_rate: untyped

@sampling_decision_maker: untyped

@sampling_priority: untyped

@service: untyped

@profiling_enabled: untyped

@apm_tracing_enabled: untyped

TAG_NAME: "name"

TAG_RESOURCE: "resource"

TAG_SERVICE: "service"

attr_reader id: untyped

attr_reader spans: untyped

attr_reader agent_sample_rate: untyped

attr_reader hostname: untyped

attr_reader lang: untyped

attr_reader name: untyped

attr_reader origin: untyped

attr_reader process_id: untyped

attr_reader rate_limiter_rate: untyped

attr_reader resource: untyped

attr_reader rule_sample_rate: untyped

attr_reader runtime_id: untyped

attr_reader sample_rate: untyped

attr_reader sampling_decision_maker: untyped

attr_reader sampling_priority: untyped

attr_reader service: untyped

attr_reader profiling_enabled: untyped
attr_reader apm_tracing_enabled: untyped

attr_reader apm_tracing_enabled: untyped
def initialize: (untyped spans, ?agent_sample_rate: untyped?, ?hostname: untyped?, ?id: untyped?, ?lang: untyped?, ?name: untyped?, ?origin: untyped?, ?process_id: untyped?, ?rate_limiter_rate: untyped?, ?resource: untyped?, ?root_span_id: untyped?, ?rule_sample_rate: untyped?, ?runtime_id: untyped?, ?sample_rate: untyped?, ?sampling_priority: untyped?, ?service: untyped?, ?tags: untyped?, ?metrics: untyped?, ?profiling_enabled: untyped?, ?apm_tracing_enabled: untyped?) -> void

def any?: () -> untyped

def count: () -> untyped

def empty?: () -> untyped

def length: () -> untyped

def size: () -> untyped

def keep!: () -> void
def reject!: () -> void
def sampled?: () -> untyped
def high_order_tid: () -> untyped

attr_reader root_span_id: untyped

attr_reader meta: untyped

attr_reader metrics: untyped

private

attr_writer agent_sample_rate: untyped

attr_writer hostname: untyped

attr_writer lang: untyped

attr_writer name: untyped

attr_writer origin: untyped

attr_writer process_id: untyped

attr_writer rate_limiter_rate: untyped

attr_writer resource: untyped

attr_writer rule_sample_rate: untyped

attr_writer runtime_id: untyped

attr_writer sample_rate: untyped

attr_writer sampling_priority: untyped

attr_writer service: untyped

def agent_sample_rate_tag: () -> untyped

def hostname_tag: () -> untyped

def lang_tag: () -> untyped

def name_tag: () -> untyped

def origin_tag: () -> untyped

def process_id_tag: () -> untyped

def rate_limiter_rate_tag: () -> untyped

def resource_tag: () -> untyped

def rule_sample_rate_tag: () -> untyped

def runtime_id_tag: () -> untyped

def sample_rate_tag: () -> untyped

def sampling_decision_maker_tag: () -> untyped

def sampling_priority_tag: () -> untyped

def service_tag: () -> untyped
end
end
Expand Down
Loading