Sha256: 5c5087e219491d72e3e163b29b228b52f2faaf81a75638eb23a96c7b9d7e2569

Contents?: true

Size: 1.14 KB

Versions: 10

Compression:

Stored size: 1.14 KB

Contents

require 'ddtrace/contrib/configuration/settings'
require 'ddtrace/ext/http'
require 'ddtrace/contrib/grape/ext'
require 'ddtrace/contrib/status_code_matcher'

module Datadog
  module Contrib
    module Grape
      module Configuration
        # Custom settings for the Grape integration
        class Settings < Contrib::Configuration::Settings
          option :enabled do |o|
            o.default { env_to_bool(Ext::ENV_ENABLED, true) }
            o.lazy
          end

          option :analytics_enabled do |o|
            o.default { env_to_bool([Ext::ENV_ANALYTICS_ENABLED, Ext::ENV_ANALYTICS_ENABLED_OLD], nil) }
            o.lazy
          end

          option :analytics_sample_rate do |o|
            o.default { env_to_float([Ext::ENV_ANALYTICS_SAMPLE_RATE, Ext::ENV_ANALYTICS_SAMPLE_RATE_OLD], 1.0) }
            o.lazy
          end

          option :service_name, default: Ext::SERVICE_NAME

          option :error_statuses, default: nil do |o|
            o.setter do |new_value, _old_value|
              Datadog::Contrib::StatusCodeMatcher.new(new_value) unless new_value.nil?
            end
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ddtrace-0.51.1 lib/ddtrace/contrib/grape/configuration/settings.rb
ddtrace-0.51.0 lib/ddtrace/contrib/grape/configuration/settings.rb
ddtrace-0.50.0 lib/ddtrace/contrib/grape/configuration/settings.rb
ddtrace-0.49.0 lib/ddtrace/contrib/grape/configuration/settings.rb
ddtrace-0.48.0 lib/ddtrace/contrib/grape/configuration/settings.rb
ddtrace-0.47.0 lib/ddtrace/contrib/grape/configuration/settings.rb
ddtrace-0.46.0 lib/ddtrace/contrib/grape/configuration/settings.rb
ddtrace-0.45.0 lib/ddtrace/contrib/grape/configuration/settings.rb
ddtrace-0.44.0 lib/ddtrace/contrib/grape/configuration/settings.rb
ddtrace-0.43.0 lib/ddtrace/contrib/grape/configuration/settings.rb