Sha256: 76adfe2fb494e9ac3e3d2b05983dee3e1b00a70852c8d25dfad7ebf031638d0d

Contents?: true

Size: 713 Bytes

Versions: 2

Compression:

Stored size: 713 Bytes

Contents

# 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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
researchable_loggable-1.5.1 lib/loggable/opentelemetry_config.rb
researchable_loggable-1.5.0 lib/loggable/opentelemetry_config.rb