lib/sidekiq/middleware/server/datadog.rb in sidekiq-datadog-0.4.0 vs lib/sidekiq/middleware/server/datadog.rb in sidekiq-datadog-0.4.1
- old
+ new
@@ -59,10 +59,10 @@
ms = ((Time.now - start) * 1000).round
if job["enqueued_at"]
queued_ms = ((start - Time.at(job["enqueued_at"])) * 1000).round
end
name = underscore(job['wrapped'] || worker.class.to_s)
- tags = @tags.map do |tag|
+ tags = @tags.flat_map do |tag|
case tag when String then tag when Proc then tag.call(worker, job, queue, error) end
end
tags.push "name:#{name}"
tags.push "queue:#{queue}" if queue