Sha256: 7ee0ab8d49a96981c305c57b1f77b975a1a7145b026899fc3ea1fb8458cc5e49

Contents?: true

Size: 675 Bytes

Versions: 1

Compression:

Stored size: 675 Bytes

Contents

# frozen_string_literal: true

require 'opentelemetry/sdk'
require 'opentelemetry/instrumentation/all'

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

1 entries across 1 versions & 1 rubygems

Version Path
researchable_loggable-1.2.0 lib/loggable/opentelemetry_config.rb