Skip to content

Commit

Permalink
Environment variable service_name for dalli
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyCTHsu committed Dec 2, 2022
1 parent 06343e7 commit b620137
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/datadog/tracing/contrib/dalli/configuration/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ class Settings < Contrib::Configuration::Settings
o.lazy
end

option :service_name, default: Ext::DEFAULT_PEER_SERVICE_NAME
option :service_name do |o|
o.default do
ENV.fetch(Ext::ENV_SERVICE_NAME) do
Ext::DEFAULT_PEER_SERVICE_NAME
end
end
o.lazy
end
end
end
end
Expand Down
1 change: 1 addition & 0 deletions lib/datadog/tracing/contrib/dalli/ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module Ext
ENV_ENABLED = 'DD_TRACE_DALLI_ENABLED'.freeze
ENV_ANALYTICS_ENABLED = 'DD_TRACE_DALLI_ANALYTICS_ENABLED'.freeze
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_DALLI_ANALYTICS_SAMPLE_RATE'.freeze
ENV_SERVICE_NAME = 'DD_TRACE_DALLI_SERVICE_NAME'.freeze
QUANTIZE_MAX_CMD_LENGTH = 100
DEFAULT_PEER_SERVICE_NAME = 'memcached'.freeze
SPAN_COMMAND = 'memcached.command'.freeze
Expand Down

0 comments on commit b620137

Please sign in to comment.