Sha256: 0d44e51bb574d5af464b5bdec751600e13e3a802fc78065b01bf99959dc2ece2
Contents?: true
Size: 623 Bytes
Versions: 38
Compression:
Stored size: 623 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! config.logger = Logger.new(File::NULL) if in_rake_task? end end def self.in_rake_task? Rails.const_defined?(:Rake) && Rake.application.top_level_tasks.any? end end
Version data entries
38 entries across 38 versions & 1 rubygems