Class: ScoutApm::Utils::SpanId

Inherits:
Object
  • Object
show all
Defined in:
lib/scout_apm/utils/unique_id.rb

Overview

Represents a random ID that we can use to track a certain span. The ‘span` prefix is only for ease of reading logs - it should not be interpreted to convey any sort of meaning.

Instance Method Summary collapse

Constructor Details

#initializeSpanId

Returns a new instance of SpanId.



32
33
34
# File 'lib/scout_apm/utils/unique_id.rb', line 32

def initialize
  @random = SecureRandom.hex(16)
end

Instance Method Details

#to_sObject



36
37
38
# File 'lib/scout_apm/utils/unique_id.rb', line 36

def to_s
  "span-#{@random}"
end