Class: ScoutApm::Utils::TransactionId

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 transaction. The ‘trans` 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

#initializeTransactionId

Returns a new instance of TransactionId.



19
20
21
# File 'lib/scout_apm/utils/unique_id.rb', line 19

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

Instance Method Details

#to_sObject



23
24
25
# File 'lib/scout_apm/utils/unique_id.rb', line 23

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