Class: Hermes::DistributedTraceRepository

Inherits:
Object
  • Object
show all
Defined in:
lib/hermes/distributed_trace_repository.rb

Instance Method Summary collapse

Constructor Details

#initialize(config:, distributed_trace_database:, distributes_tracing_mapper:, database_error_handler:) ⇒ DistributedTraceRepository

Returns a new instance of DistributedTraceRepository.



6
7
8
9
10
11
# File 'lib/hermes/distributed_trace_repository.rb', line 6

def initialize(config:, distributed_trace_database:, distributes_tracing_mapper:, database_error_handler:)
  @config = config
  @distributed_trace_database = distributed_trace_database
  @distributes_tracing_mapper = distributes_tracing_mapper
  @database_error_handler = database_error_handler
end

Instance Method Details

#create(event) ⇒ Object



13
14
15
16
17
18
# File 'lib/hermes/distributed_trace_repository.rb', line 13

def create(event)
  if config.store_distributed_traces?
    attributes = attributes_for_trace_context(event, event.trace_context)
    store_trace(attributes)
  end
end