Skip to content

Commit

Permalink
Add cache_key_enabled option for ActiveSupport
Browse files Browse the repository at this point in the history
  • Loading branch information
bouwkast committed Oct 23, 2024
1 parent 38f6cc1 commit e8188fc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def on_start(span, event, _id, payload)

span.set_tag('EVENT', event)

set_cache_key(span, key, mapping[:multi_key])
set_cache_key(span, key, mapping[:multi_key]) if Datadog.configuration.tracing[:active_support][:cache_key_enabled]
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 @@ -58,7 +58,8 @@ def trace(action, store, key: nil, multi_key: nil)
end

span.set_tag(Ext::TAG_CACHE_BACKEND, store) if store
set_cache_key(span, key, multi_key)

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 @@ -39,6 +39,11 @@ class Settings < Contrib::Configuration::Settings
)
end
end

option :cache_key_enabled do |o|
o.type :bool
o.default true
end
end
end
end
Expand Down

0 comments on commit e8188fc

Please sign in to comment.