Skip to content

Commit

Permalink
Swap to grouped cache_key settings
Browse files Browse the repository at this point in the history
  • Loading branch information
bouwkast committed Nov 27, 2024
1 parent c909b1a commit c9f7952
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ def on_start(span, event, _id, payload)

span.set_tag('EVENT', event)

set_cache_key(span, key, mapping[:multi_key]) if configuration[:cache_key_enabled]
if Datadog.configuration.tracing[:active_support][:cache_key].enabled
set_cache_key(span, key, mapping[:multi_key])
end
rescue StandardError => e
Datadog.logger.error(e.message)
Datadog::Core::Telemetry::Logger.report(e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def trace(action, store, key: nil, multi_key: nil)

span.set_tag(Ext::TAG_CACHE_BACKEND, store) if store

set_cache_key(span, key, multi_key) if configuration[:cache_key_enabled]
set_cache_key(span, key, multi_key) if Datadog.configuration.tracing[:active_support][:cache_key].enabled

yield
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,14 @@ class Settings < Contrib::Configuration::Settings
end
end

option :cache_key_enabled do |o|
o.type :bool
o.default true
# grouped "cache_key.*" settings
settings :cache_key do
# enable or disabling the inclusion of the cache_key in the span
option :enabled do |o|
# cache_key.enabled
o.type :bool
o.default true
end
end
end
end
Expand Down

0 comments on commit c9f7952

Please sign in to comment.