Module: Hermes

Defined in:
lib/hermes.rb,
lib/hermes/rb.rb,
lib/hermes/checks.rb,
lib/hermes/logger.rb,
lib/hermes/tracers.rb,
lib/hermes/publisher.rb,
lib/hermes/retryable.rb,
lib/hermes/base_event.rb,
lib/hermes/rb/version.rb,
lib/hermes/rpc_client.rb,
lib/hermes/serializer.rb,
lib/hermes/configuration.rb,
lib/hermes/event_handler.rb,
lib/hermes/trace_context.rb,
lib/hermes/event_producer.rb,
lib/hermes/event_processor.rb,
lib/hermes/tracers/datadog.rb,
lib/hermes/consumer_builder.rb,
lib/hermes/distributed_trace.rb,
lib/hermes/publisher_factory.rb,
lib/hermes/checks/health_check.rb,
lib/hermes/logger/params_filter.rb,
lib/hermes/database_error_handler.rb,
lib/hermes/dependencies_container.rb,
lib/hermes/producer_error_handler.rb,
lib/hermes/publisher/hutch_adapter.rb,
lib/hermes/distributed_trace/mapper.rb,
lib/hermes/retryable_event_producer.rb,
lib/hermes/publisher/in_memory_adapter.rb,
lib/hermes/distributed_trace_repository.rb,
lib/hermes/b_3_propagation_model_headers.rb,
lib/hermes/null_error_notification_service.rb,
lib/hermes/producer_error_handler/null_handler.rb,
lib/hermes/producer_error_handler/safe_handler.rb

Defined Under Namespace

Modules: Checks, ProducerErrorHandler, Rb, Tracers Classes: B3PropagationModelHeaders, BaseEvent, Configuration, ConsumerBuilder, DatabaseErrorHandler, DependenciesContainer, DistributedTrace, DistributedTraceRepository, EventHandler, EventProcessor, EventProducer, Logger, NullErrorNotificationService, NullInstrumenter, Publisher, PublisherFactory, Retryable, RetryableEventProducer, RpcClient, Serializer, TraceContext

Class Method Summary collapse

Class Method Details

.clear_origin_headersObject



54
55
56
# File 'lib/hermes.rb', line 54

def self.clear_origin_headers
  DependenciesContainer["global_store"].delete(ORIGIN_HEADERS_KEY)
end

.configurationObject



35
36
37
# File 'lib/hermes.rb', line 35

def self.configuration
  @configuration ||= Hermes::Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



39
40
41
# File 'lib/hermes.rb', line 39

def self.configure
  yield configuration
end

.origin_headersObject



46
47
48
# File 'lib/hermes.rb', line 46

def self.origin_headers
  DependenciesContainer["global_store"][ORIGIN_HEADERS_KEY].to_h
end

.origin_headers=(headers) ⇒ Object



50
51
52
# File 'lib/hermes.rb', line 50

def self.origin_headers=(headers)
  DependenciesContainer["global_store"][ORIGIN_HEADERS_KEY] = headers.to_h
end

.with_origin_headers(headers) ⇒ Object



58
59
60
61
62
# File 'lib/hermes.rb', line 58

def self.with_origin_headers(headers)
  self.origin_headers = headers

  yield.tap { clear_origin_headers }
end