Sha256: 0e8b48ff7c04f9b4dbf01083bfbd492c3b13cd9e0d371db60867268f4fa21ee8

Contents?: true

Size: 456 Bytes

Versions: 7

Compression:

Stored size: 456 Bytes

Contents

module GovukOpenTelemetry
  def self.should_configure?
    ENV["ENABLE_OPEN_TELEMETRY"] == "true"
  end

  def self.configure(service_name)
    return unless should_configure?

    require "opentelemetry/sdk"
    require "opentelemetry/exporter/otlp"
    require "opentelemetry/instrumentation/all"

    OpenTelemetry::SDK.configure do |config|
      config.service_name = service_name
      config.use_all # enables all instrumentation!
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
govuk_app_config-9.0.4 lib/govuk_app_config/govuk_open_telemetry.rb
govuk_app_config-9.0.3 lib/govuk_app_config/govuk_open_telemetry.rb
govuk_app_config-9.0.2 lib/govuk_app_config/govuk_open_telemetry.rb
govuk_app_config-9.0.1 lib/govuk_app_config/govuk_open_telemetry.rb
govuk_app_config-9.0.0 lib/govuk_app_config/govuk_open_telemetry.rb
govuk_app_config-8.1.1 lib/govuk_app_config/govuk_open_telemetry.rb
govuk_app_config-8.1.0 lib/govuk_app_config/govuk_open_telemetry.rb