diff --git a/lib/request_queue_time/middleware.rb b/lib/request_queue_time/middleware.rb index d631c19..4eabec4 100644 --- a/lib/request_queue_time/middleware.rb +++ b/lib/request_queue_time/middleware.rb @@ -14,10 +14,12 @@ def call(env) unless metrics.ignore? tags = ["request_method:#{env["REQUEST_METHOD"]}"] - if Object.const_defined?(:StatsdDdog) - StatsdDdog.timing("rails.request.queue_time", metrics.queue_time, tags:) - StatsdDdog.timing("rails.request.queue_time.network_time", metrics.network_time, tags:) - end + + ActiveSupport::Notifications.instrument("request_queue_time.timings", extra: { + tags: tags, + queue_time: metrics.queue_time, + network_time: metrics.network_time + }) env["request_queue_time"] = metrics.queue_time env["request_network_time"] = metrics.network_time