Module: Datadog::Tracing::Contrib::ActiveSupport::Cache::Instrumentation::FetchMulti
- Defined in:
- lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb
Overview
Defines instrumentation for ActiveSupport cache fetching of multiple keys
Instance Method Summary collapse
Instance Method Details
#fetch_multi(*args, &block) ⇒ Object
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
# File 'lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb', line 181 def fetch_multi(*args, &block) # extract options hash keys = args[-1].instance_of?(Hash) ? args[0..-2] : args payload = { action: Ext::RESOURCE_CACHE_MGET, keys: keys, tracing_context: {} } begin # process and catch cache exceptions Instrumentation.start_trace_cache(payload) super rescue Exception => e payload[:exception] = [e.class.name, e.] payload[:exception_object] = e raise e end ensure Instrumentation.finish_trace_cache_multi(payload) end |