Module: Datadog::Tracing::Contrib::ActiveSupport::Cache::Instrumentation::Delete

Defined in:
lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb

Overview

Defines instrumentation for ActiveSupport cache deleting

Instance Method Summary collapse

Instance Method Details

#delete(*args, &block) ⇒ Object



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb', line 252

def delete(*args, &block)
  payload = {
    action: Ext::RESOURCE_CACHE_DELETE,
    key: args[0],
    tracing_context: {}
  }

  begin
    # process and catch cache exceptions
    Instrumentation.start_trace_cache(payload)
    super
  rescue Exception => e
    payload[:exception] = [e.class.name, e.message]
    payload[:exception_object] = e
    raise e
  end
ensure
  Instrumentation.finish_trace_cache(payload)
end