Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update env var conventions and make consistent across language clients #1115

Merged
merged 16 commits into from
Jul 27, 2020
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion docs/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -1633,13 +1633,14 @@ end

Available options are:

- `enabled`: defines if the `tracer` is enabled or not. If set to `false` instrumentation will still run, but no spans are sent to the trace agent.
- `enabled`: defines if the `tracer` is enabled or not. If set to `false` instrumentation will still run, but no spans are sent to the trace agent. Can be configured through the `DD_TRACE_ENABLED` environment variable.
marcotc marked this conversation as resolved.
Show resolved Hide resolved
- `hostname`: set the hostname of the trace agent.
- `instance`: set to a custom `Datadog::Tracer` instance. If provided, other trace settings are ignored (you must configure it manually.)
- `partial_flush.enabled`: set to `true` to enable partial trace flushing (for long running traces.) Disabled by default. *Experimental.*
- `port`: set the port the trace agent is listening on.
- `sampler`: set to a custom `Datadog::Sampler` instance. If provided, the tracer will use this sampler to determine sampling behavior.
- `diagnostics.startup_logs.enabled`: Startup configuration and diagnostic log. Defaults to `true`. Can be configured through the `DD_TRACE_STARTUP_LOGS` environment variable.
- `diagnostics.debug`: set to true to enable debug logging. Can be configured through the `DD_TRACE_DEBUG` environment variable.
marcotc marked this conversation as resolved.
Show resolved Hide resolved

#### Custom logging

Expand Down Expand Up @@ -1687,6 +1688,15 @@ This enables you to set this value on a per application basis, so you can have f

Tags can also be set directly on individual spans, which will supersede any conflicting tags defined at the application level.

### Environment variables

Other Environment Variables:

- `DD_TRACE_AGENT_URL`: Sets the URL endpoint where traces are sent. Overrides DD_AGENT_HOST and DD_TRACE_AGENT_PORT if set. e.g. `DD_TRACE_AGENT_URL=http://localhost:8126`
marcotc marked this conversation as resolved.
Show resolved Hide resolved
- `DD_TRACE_<INTEGRATION>_ENABLED`: Disables a specific integration. Valid values are: false. e.g. `DD_TRACE_RAILS_ENABLED=false`. **Please note**, in order to **enable** automatic instrumentation for a specific integration, the integration must be configured via application code. This environment variable can only be used to disable an integration.
marcotc marked this conversation as resolved.
Show resolved Hide resolved
- `DD_TRACE_<INTEGRATION>_ANALYTICS_ENABLED`: Enables or disable App Analytics for a specific integration. Valid values are: true or false (default). e.g. `DD_TRACE_ACTION_CABLE_ANALYTICS_ENABLED=true`.
- `DD_TRACE_<INTEGRATION>_ANALYTICS_SAMPLE_RATE`: Sets the App Analytics sampling rate for a specific integration. A floating number between 0.0 and 1.0 (default). e.g. `DD_TRACE_ACTION_CABLE_ANALYTICS_SAMPLE_RATE=0.5`.

### Sampling

`ddtrace` can perform trace sampling. While the trace agent already samples traces to reduce bandwidth usage, client sampling reduces the performance overhead.
Expand Down
10 changes: 8 additions & 2 deletions lib/ddtrace/configuration/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ class Settings
end

settings :diagnostics do
option :debug, default: false
option :debug do |o|
o.default { env_to_bool(Datadog::Ext::Diagnostics::DD_TRACE_DEBUG, false) }
o.lazy
end

settings :health_metrics do
option :enabled do |o|
Expand Down Expand Up @@ -198,7 +201,10 @@ def runtime_metrics(options = nil)
end

settings :tracer do
option :enabled, default: true
option :enabled do |o|
o.default { env_to_bool(Datadog::Ext::Diagnostics::DD_TRACE_ENABLED, true) }
o.lazy
end
option :hostname # TODO: Deprecate
option :instance

Expand Down
4 changes: 2 additions & 2 deletions lib/ddtrace/contrib/action_cable/configuration/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ module Configuration
# Custom settings for the ActionCable integration
class Settings < Contrib::Configuration::Settings
option :analytics_enabled do |o|
o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, false) }
o.default { env_to_bool([Ext::ENV_ANALYTICS_ENABLED, Ext::ENV_ANALYTICS_ENABLED_OLD], false) }
o.lazy
end

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

Expand Down
6 changes: 4 additions & 2 deletions lib/ddtrace/contrib/action_cable/ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ module ActionCable
# ActionCable integration constants
module Ext
APP = 'action_cable'.freeze
ENV_ANALYTICS_ENABLED = 'DD_ACTION_CABLE_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_SAMPLE_RATE = 'DD_ACTION_CABLE_ANALYTICS_SAMPLE_RATE'.freeze
ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTION_CABLE_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_ENABLED_OLD = 'DD_ACTION_CABLE_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTION_CABLE_ANALYTICS_SAMPLE_RATE'.freeze
ENV_ANALYTICS_SAMPLE_RATE_OLD = 'DD_ACTION_CABLE_ANALYTICS_SAMPLE_RATE'.freeze
SERVICE_NAME = 'action_cable'.freeze
SPAN_ACTION = 'action_cable.action'.freeze
SPAN_BROADCAST = 'action_cable.broadcast'.freeze
Expand Down
4 changes: 2 additions & 2 deletions lib/ddtrace/contrib/action_pack/configuration/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ module Configuration
# Custom settings for the ActionPack integration
class Settings < Contrib::Configuration::Settings
option :analytics_enabled do |o|
o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, nil) }
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, 1.0) }
o.default { env_to_float([Ext::ENV_ANALYTICS_SAMPLE_RATE, Ext::ENV_ANALYTICS_SAMPLE_RATE_OLD], 1.0) }
o.lazy
end

Expand Down
6 changes: 4 additions & 2 deletions lib/ddtrace/contrib/action_pack/ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ module ActionPack
# ActionPack integration constants
module Ext
APP = 'action_pack'.freeze
ENV_ANALYTICS_ENABLED = 'DD_ACTION_PACK_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_SAMPLE_RATE = 'DD_ACTION_PACK_ANALYTICS_SAMPLE_RATE'.freeze
ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTION_PACK_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_ENABLED_OLD = 'DD_ACTION_PACK_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTION_PACK_ANALYTICS_SAMPLE_RATE'.freeze
ENV_ANALYTICS_SAMPLE_RATE_OLD = 'DD_ACTION_PACK_ANALYTICS_SAMPLE_RATE'.freeze
SERVICE_NAME = 'action_pack'.freeze
SPAN_ACTION_CONTROLLER = 'rails.action_controller'.freeze
TAG_ROUTE_ACTION = 'rails.route.action'.freeze
Expand Down
4 changes: 2 additions & 2 deletions lib/ddtrace/contrib/action_view/configuration/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ module Configuration
# Custom settings for the ActionView integration
class Settings < Contrib::Configuration::Settings
option :analytics_enabled do |o|
o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, false) }
o.default { env_to_bool([Ext::ENV_ANALYTICS_ENABLED, Ext::ENV_ANALYTICS_ENABLED_OLD], false) }
o.lazy
end

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

Expand Down
6 changes: 4 additions & 2 deletions lib/ddtrace/contrib/action_view/ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ module ActionView
# ActionView integration constants
module Ext
APP = 'action_view'.freeze
ENV_ANALYTICS_ENABLED = 'DD_ACTION_VIEW_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_SAMPLE_RATE = 'DD_ACTION_VIEW_ANALYTICS_SAMPLE_RATE'.freeze
ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTION_VIEW_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_ENABLED_OLD = 'DD_ACTION_VIEW_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTION_VIEW_ANALYTICS_SAMPLE_RATE'.freeze
ENV_ANALYTICS_SAMPLE_RATE_OLD = 'DD_ACTION_VIEW_ANALYTICS_SAMPLE_RATE'.freeze
SERVICE_NAME = 'action_view'.freeze
SPAN_RENDER_PARTIAL = 'rails.render_partial'.freeze
SPAN_RENDER_TEMPLATE = 'rails.render_template'.freeze
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ module Configuration
# Custom settings for the ActiveModelSerializers integration
class Settings < Contrib::Configuration::Settings
option :analytics_enabled do |o|
o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, false) }
o.default { env_to_bool([Ext::ENV_ANALYTICS_ENABLED, Ext::ENV_ANALYTICS_ENABLED_OLD], false) }
o.lazy
end

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

Expand Down
6 changes: 4 additions & 2 deletions lib/ddtrace/contrib/active_model_serializers/ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ module ActiveModelSerializers
# ActiveModelSerializers integration constants
module Ext
APP = 'active_model_serializers'.freeze
ENV_ANALYTICS_ENABLED = 'DD_ACTIVE_MODEL_SERIALIZERS_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_SAMPLE_RATE = 'DD_ACTIVE_MODEL_SERIALIZERS_ANALYTICS_SAMPLE_RATE'.freeze
ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTIVE_MODEL_SERIALIZERS_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_ENABLED_OLD = 'DD_ACTIVE_MODEL_SERIALIZERS_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTIVE_MODEL_SERIALIZERS_ANALYTICS_SAMPLE_RATE'.freeze
ENV_ANALYTICS_SAMPLE_RATE_OLD = 'DD_ACTIVE_MODEL_SERIALIZERS_ANALYTICS_SAMPLE_RATE'.freeze
SERVICE_NAME = 'active_model_serializers'.freeze
SPAN_RENDER = 'active_model_serializers.render'.freeze
SPAN_SERIALIZE = 'active_model_serializers.serialize'.freeze
Expand Down
4 changes: 2 additions & 2 deletions lib/ddtrace/contrib/active_record/configuration/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ module Configuration
# Custom settings for the ActiveRecord integration
class Settings < Contrib::Configuration::Settings
option :analytics_enabled do |o|
o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, false) }
o.default { env_to_bool([Ext::ENV_ANALYTICS_ENABLED, Ext::ENV_ANALYTICS_ENABLED_OLD], false) }
o.lazy
end

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

Expand Down
6 changes: 4 additions & 2 deletions lib/ddtrace/contrib/active_record/ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ module ActiveRecord
# ActiveRecord integration constants
module Ext
APP = 'active_record'.freeze
ENV_ANALYTICS_ENABLED = 'DD_ACTIVE_RECORD_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_SAMPLE_RATE = 'DD_ACTIVE_RECORD_ANALYTICS_SAMPLE_RATE'.freeze
ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTIVE_RECORD_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_ENABLED_OLD = 'DD_ACTIVE_RECORD_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTIVE_RECORD_ANALYTICS_SAMPLE_RATE'.freeze
ENV_ANALYTICS_SAMPLE_RATE_OLD = 'DD_ACTIVE_RECORD_ANALYTICS_SAMPLE_RATE'.freeze
SERVICE_NAME = 'active_record'.freeze
SPAN_INSTANTIATION = 'active_record.instantiation'.freeze
SPAN_SQL = 'active_record.sql'.freeze
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ module Configuration
# Custom settings for the ActiveSupport integration
class Settings < Contrib::Configuration::Settings
option :analytics_enabled do |o|
o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, false) }
o.default { env_to_bool([Ext::ENV_ANALYTICS_ENABLED, Ext::ENV_ANALYTICS_ENABLED_OLD], false) }
o.lazy
end

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

Expand Down
6 changes: 4 additions & 2 deletions lib/ddtrace/contrib/active_support/ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ module ActiveSupport
# ActiveSupport integration constants
module Ext
APP = 'active_support'.freeze
ENV_ANALYTICS_ENABLED = 'DD_ACTIVE_SUPPORT_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_SAMPLE_RATE = 'DD_ACTIVE_SUPPORT_ANALYTICS_SAMPLE_RATE'.freeze
ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTIVE_SUPPORT_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_ENABLED_OLD = 'DD_ACTIVE_SUPPORT_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTIVE_SUPPORT_ANALYTICS_SAMPLE_RATE'.freeze
ENV_ANALYTICS_SAMPLE_RATE_OLD = 'DD_ACTIVE_SUPPORT_ANALYTICS_SAMPLE_RATE'.freeze
QUANTIZE_CACHE_MAX_KEY_SIZE = 300
RESOURCE_CACHE_DELETE = 'DELETE'.freeze
RESOURCE_CACHE_GET = 'GET'.freeze
Expand Down
4 changes: 2 additions & 2 deletions lib/ddtrace/contrib/aws/configuration/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ module Configuration
# Custom settings for the AWS integration
class Settings < Contrib::Configuration::Settings
option :analytics_enabled do |o|
o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, false) }
o.default { env_to_bool([Ext::ENV_ANALYTICS_ENABLED, Ext::ENV_ANALYTICS_ENABLED_OLD], false) }
o.lazy
end

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

Expand Down
6 changes: 4 additions & 2 deletions lib/ddtrace/contrib/aws/ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ module Aws
# AWS integration constants
module Ext
APP = 'aws'.freeze
ENV_ANALYTICS_ENABLED = 'DD_AWS_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_SAMPLE_RATE = 'DD_AWS_ANALYTICS_SAMPLE_RATE'.freeze
ENV_ANALYTICS_ENABLED = 'DD_TRACE_AWS_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_ENABLED_OLD = 'DD_AWS_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_AWS_ANALYTICS_SAMPLE_RATE'.freeze
ENV_ANALYTICS_SAMPLE_RATE_OLD = 'DD_AWS_ANALYTICS_SAMPLE_RATE'.freeze
SERVICE_NAME = 'aws'.freeze
SPAN_COMMAND = 'aws.command'.freeze
TAG_AGENT = 'aws.agent'.freeze
Expand Down
4 changes: 2 additions & 2 deletions lib/ddtrace/contrib/dalli/configuration/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ module Configuration
# Custom settings for the Dalli integration
class Settings < Contrib::Configuration::Settings
option :analytics_enabled do |o|
o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, false) }
o.default { env_to_bool([Ext::ENV_ANALYTICS_ENABLED, Ext::ENV_ANALYTICS_ENABLED_OLD], false) }
o.lazy
end

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

Expand Down
6 changes: 4 additions & 2 deletions lib/ddtrace/contrib/dalli/ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ module Dalli
# Dalli integration constants
module Ext
APP = 'dalli'.freeze
ENV_ANALYTICS_ENABLED = 'DD_DALLI_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_SAMPLE_RATE = 'DD_DALLI_ANALYTICS_SAMPLE_RATE'.freeze
ENV_ANALYTICS_ENABLED = 'DD_TRACE_DALLI_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_ENABLED_OLD = 'DD_DALLI_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_DALLI_ANALYTICS_SAMPLE_RATE'.freeze
ENV_ANALYTICS_SAMPLE_RATE_OLD = 'DD_DALLI_ANALYTICS_SAMPLE_RATE'.freeze
QUANTIZE_MAX_CMD_LENGTH = 100
SERVICE_NAME = 'memcached'.freeze
SPAN_COMMAND = 'memcached.command'.freeze
Expand Down
4 changes: 2 additions & 2 deletions lib/ddtrace/contrib/delayed_job/configuration/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ module Configuration
# Custom settings for the DelayedJob integration
class Settings < Contrib::Configuration::Settings
option :analytics_enabled do |o|
o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, false) }
o.default { env_to_bool([Ext::ENV_ANALYTICS_ENABLED, Ext::ENV_ANALYTICS_ENABLED_OLD], false) }
o.lazy
end

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

Expand Down
6 changes: 4 additions & 2 deletions lib/ddtrace/contrib/delayed_job/ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ module DelayedJob
# DelayedJob integration constants
module Ext
APP = 'delayed_job'.freeze
ENV_ANALYTICS_ENABLED = 'DD_DELAYED_JOB_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_SAMPLE_RATE = 'DD_DELAYED_JOB_ANALYTICS_SAMPLE_RATE'.freeze
ENV_ANALYTICS_ENABLED = 'DD_TRACE_DELAYED_JOB_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_ENABLED_OLD = 'DD_DELAYED_JOB_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_DELAYED_JOB_ANALYTICS_SAMPLE_RATE'.freeze
ENV_ANALYTICS_SAMPLE_RATE_OLD = 'DD_DELAYED_JOB_ANALYTICS_SAMPLE_RATE'.freeze
SERVICE_NAME = 'delayed_job'.freeze
SPAN_JOB = 'delayed_job'.freeze
TAG_ATTEMPTS = 'delayed_job.attempts'.freeze
Expand Down
4 changes: 2 additions & 2 deletions lib/ddtrace/contrib/elasticsearch/configuration/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ module Configuration
# Custom settings for the Elasticsearch integration
class Settings < Contrib::Configuration::Settings
option :analytics_enabled do |o|
o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, false) }
o.default { env_to_bool([Ext::ENV_ANALYTICS_ENABLED, Ext::ENV_ANALYTICS_ENABLED_OLD], false) }
o.lazy
end

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

Expand Down
6 changes: 4 additions & 2 deletions lib/ddtrace/contrib/elasticsearch/ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ module Elasticsearch
# Elasticsearch integration constants
module Ext
APP = 'elasticsearch'.freeze
ENV_ANALYTICS_ENABLED = 'DD_ELASTICSEARCH_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_SAMPLE_RATE = 'DD_ELASTICSEARCH_ANALYTICS_SAMPLE_RATE'.freeze
ENV_ANALYTICS_ENABLED = 'DD_TRACE_ELASTICSEARCH_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_ENABLED_OLD = 'DD_ELASTICSEARCH_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ELASTICSEARCH_ANALYTICS_SAMPLE_RATE'.freeze
ENV_ANALYTICS_SAMPLE_RATE_OLD = 'DD_ELASTICSEARCH_ANALYTICS_SAMPLE_RATE'.freeze
SERVICE_NAME = 'elasticsearch'.freeze
SPAN_QUERY = 'elasticsearch.query'.freeze
SPAN_TYPE_QUERY = 'elasticsearch'.freeze
Expand Down
4 changes: 2 additions & 2 deletions lib/ddtrace/contrib/ethon/configuration/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ module Configuration
# Custom settings for the Ethon integration
class Settings < Contrib::Configuration::Settings
option :analytics_enabled do |o|
o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, false) }
o.default { env_to_bool([Ext::ENV_ANALYTICS_ENABLED, Ext::ENV_ANALYTICS_ENABLED_OLD], false) }
o.lazy
end

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

Expand Down
6 changes: 4 additions & 2 deletions lib/ddtrace/contrib/ethon/ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ module Ethon
# Ethon integration constants
module Ext
APP = 'ethon'.freeze
ENV_ANALYTICS_ENABLED = 'DD_ETHON_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_SAMPLE_RATE = 'DD_ETHON_ANALYTICS_SAMPLE_RATE'.freeze
ENV_ANALYTICS_ENABLED = 'DD_TRACE_ETHON_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_ENABLED_OLD = 'DD_ETHON_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ETHON_ANALYTICS_SAMPLE_RATE'.freeze
ENV_ANALYTICS_SAMPLE_RATE_OLD = 'DD_ETHON_ANALYTICS_SAMPLE_RATE'.freeze
SERVICE_NAME = 'ethon'.freeze
SPAN_REQUEST = 'ethon.request'.freeze
SPAN_MULTI_REQUEST = 'ethon.multi.request'.freeze
Expand Down
4 changes: 2 additions & 2 deletions lib/ddtrace/contrib/excon/configuration/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ module Configuration
# Custom settings for the Excon integration
class Settings < Contrib::Configuration::Settings
option :analytics_enabled do |o|
o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, false) }
o.default { env_to_bool([Ext::ENV_ANALYTICS_ENABLED, Ext::ENV_ANALYTICS_ENABLED_OLD], false) }
o.lazy
end

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

Expand Down
Loading