Sha256: 55aae7e6166d97165984ea5bba21f12fc598a08447969b1ca6f9005e4e60b94e

Contents?: true

Size: 713 Bytes

Versions: 3

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

3 entries across 3 versions & 1 rubygems

Version Path
researchable_loggable-1.4.0 lib/loggable/opentelemetry_config.rb
researchable_loggable-1.3.1 lib/loggable/opentelemetry_config.rb
researchable_loggable-1.3.0 lib/loggable/opentelemetry_config.rb