Skip to content

Commit

Permalink
update span operation
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdinur committed Apr 15, 2024
1 parent 5c386ab commit 1abf37f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
17 changes: 6 additions & 11 deletions lib/datadog/tracing/span_operation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,8 @@ class SpanOperation

# Span attributes
# NOTE: In the future, we should drop the me
attr_reader \
:end_time,
:id,
:name,
:parent_id,
:resource,
:service,
:start_time,
:trace_id,
:type
attr_accessor :links
attr_reader :end_time, :id, :name, :parent_id, :resource, :service, :start_time, :trace_id, :type

attr_accessor \
:status
Expand All @@ -49,7 +41,8 @@ def initialize(
start_time: nil,
tags: nil,
trace_id: nil,
type: nil
type: nil,
links: nil
)
# Ensure dynamically created strings are UTF-8 encoded.
#
Expand All @@ -66,6 +59,7 @@ def initialize(
@trace_id = trace_id || Tracing::Utils::TraceId.next_id

@status = 0
@links = links

# start_time and end_time track wall clock. In Ruby, wall clock
# has less accuracy than monotonic clock, so if possible we look to only use wall clock
Expand Down Expand Up @@ -452,6 +446,7 @@ def build_span
status: @status,
type: @type,
trace_id: @trace_id,
links: @links,
service_entry: parent.nil? || (service && parent.service != service)
)
end
Expand Down
4 changes: 3 additions & 1 deletion sig/datadog/tracing/span_operation.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ module Datadog
include Metadata::Errors
prepend Metadata::Analytics

attr_reader links: untyped

attr_reader end_time: untyped

attr_reader id: untyped
Expand All @@ -26,7 +28,7 @@ module Datadog

attr_accessor status: untyped

def initialize: (untyped name, ?child_of: untyped?, ?events: untyped?, ?on_error: untyped?, ?parent_id: ::Integer, ?resource: untyped, ?service: untyped?, ?start_time: untyped?, ?tags: untyped?, ?trace_id: untyped?, ?type: untyped?) -> void
def initialize: (untyped name, ?child_of: untyped?, ?events: untyped?, ?on_error: untyped?, ?parent_id: ::Integer, ?resource: untyped, ?service: untyped?, ?start_time: untyped?, ?tags: untyped?, ?trace_id: untyped?, ?type: untyped?, ?links: untyped?) -> void

def name=: (untyped name) -> untyped

Expand Down

0 comments on commit 1abf37f

Please sign in to comment.