Class: WideEvent::Configuration
- Inherits:
-
Object
- Object
- WideEvent::Configuration
- Defined in:
- lib/wide_event/configuration.rb
Constant Summary collapse
- DEFAULT_ERROR_HANDLER =
Reports through OTel's error handler when it's loaded; silent otherwise.
lambda do |exception, | if defined?(OpenTelemetry) && OpenTelemetry.respond_to?(:handle_error) OpenTelemetry.handle_error(exception: exception, message: "wide_event #{}") end end
- SOLID_QUEUE_DETECTOR =
Recurring (scheduled) Solid Queue executions have a RecurringExecution row pointing at the underlying job. One indexed query per execution.
lambda do |job| return false unless defined?(SolidQueue::RecurringExecution) job.provider_job_id.present? && SolidQueue::RecurringExecution.exists?(job_id: job.provider_job_id) rescue StandardError false end
Instance Attribute Summary collapse
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#error_handler ⇒ Object
Returns the value of attribute error_handler.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#max_cache_attrs ⇒ Object
Returns the value of attribute max_cache_attrs.
-
#registry_path ⇒ Object
Returns the value of attribute registry_path.
-
#scheduled_job_detector ⇒ Object
Returns the value of attribute scheduled_job_detector.
-
#sink ⇒ Object
Returns the value of attribute sink.
-
#span_scopes ⇒ Object
Returns the value of attribute span_scopes.
-
#strict ⇒ Object
Returns the value of attribute strict.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #registry ⇒ Object
- #resolved_sink ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/wide_event/configuration.rb', line 23 def initialize @enabled = !ENV["OTEL_EXPORTER_OTLP_ENDPOINT"].to_s.empty? @sink = :otel @resolved_sink = nil @max_cache_attrs = 10 @span_scopes = { "OpenTelemetry::Instrumentation::PG" => "postgres_query", "OpenTelemetry::Instrumentation::Net::HTTP" => "http_call" } @strict = false @registry_path = nil @registry = nil @logger = nil @error_handler = DEFAULT_ERROR_HANDLER @scheduled_job_detector = SOLID_QUEUE_DETECTOR end |
Instance Attribute Details
#enabled ⇒ Object
Returns the value of attribute enabled.
19 20 21 |
# File 'lib/wide_event/configuration.rb', line 19 def enabled @enabled end |
#error_handler ⇒ Object
Returns the value of attribute error_handler.
19 20 21 |
# File 'lib/wide_event/configuration.rb', line 19 def error_handler @error_handler end |
#logger ⇒ Object
Returns the value of attribute logger.
19 20 21 |
# File 'lib/wide_event/configuration.rb', line 19 def logger @logger end |
#max_cache_attrs ⇒ Object
Returns the value of attribute max_cache_attrs.
19 20 21 |
# File 'lib/wide_event/configuration.rb', line 19 def max_cache_attrs @max_cache_attrs end |
#registry_path ⇒ Object
Returns the value of attribute registry_path.
21 22 23 |
# File 'lib/wide_event/configuration.rb', line 21 def registry_path @registry_path end |
#scheduled_job_detector ⇒ Object
Returns the value of attribute scheduled_job_detector.
19 20 21 |
# File 'lib/wide_event/configuration.rb', line 19 def scheduled_job_detector @scheduled_job_detector end |
#sink ⇒ Object
Returns the value of attribute sink.
21 22 23 |
# File 'lib/wide_event/configuration.rb', line 21 def sink @sink end |
#span_scopes ⇒ Object
Returns the value of attribute span_scopes.
19 20 21 |
# File 'lib/wide_event/configuration.rb', line 19 def span_scopes @span_scopes end |
#strict ⇒ Object
Returns the value of attribute strict.
19 20 21 |
# File 'lib/wide_event/configuration.rb', line 19 def strict @strict end |