Module: Loggable::OpenTelemetryConfig

Defined in:
lib/loggable/opentelemetry_config.rb

Overview

The OpenTelemetryConfig module provides a method to configure OpenTelemetry for Rails applications. It sets up the instrumentation and tracing with a specified service name, relying on environment variables for exporter configuration, such as sending traces to a remote backend like Grafana Cloud.

Class Method Summary collapse

Class Method Details

.configure(service_name) ⇒ Object

Configures OpenTelemetry for the application



13
14
15
16
17
18
# File 'lib/loggable/opentelemetry_config.rb', line 13

def self.configure(service_name)
  ::OpenTelemetry::SDK.configure do |c|
    c.use_all
    c.service_name = service_name
  end
end