# frozen_string_literal: true require 'opentelemetry/sdk' require 'opentelemetry/instrumentation/all' require 'opentelemetry/exporter/otlp' module Loggable # 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. module OpenTelemetryConfig # Configures OpenTelemetry for the application def self.configure(service_name) ::OpenTelemetry::SDK.configure do |c| c.use_all c.service_name = service_name end end end end