Class: Datadog::Notifications::Plugins::ActiveJob

Inherits:
Base
  • Object
show all
Defined in:
lib/datadog/notifications/plugins/active_job.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#tags

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ ActiveJob

Options:

*:metric_name - the metric name, defaults to “activejob.perform” *:tags - additional tags



10
11
12
13
14
15
16
17
# File 'lib/datadog/notifications/plugins/active_job.rb', line 10

def initialize(opts = {})
  super
  @metric_name = opts[:metric_name] || "activejob.perform"

  Datadog::Notifications.subscribe 'perform.active_job' do |reporter, event|
    record reporter, event
  end
end

Instance Attribute Details

#metric_nameObject (readonly)

Returns the value of attribute metric_name.



4
5
6
# File 'lib/datadog/notifications/plugins/active_job.rb', line 4

def metric_name
  @metric_name
end