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

Defined in:
lib/ddtrace/contrib/active_support/cache/instrumentation.rb

Overview

Defines instrumentation for ActiveSupport cache deleting

Instance Method Summary collapse

Instance Method Details

#delete(*args, &block) ⇒ Object



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/ddtrace/contrib/active_support/cache/instrumentation.rb', line 133

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