Class: Datadog::Notifications::Plugins::ActiveRecord
- Defined in:
- lib/datadog/notifications/plugins/active_record.rb
Instance Attribute Summary collapse
-
#metric_name ⇒ Object
readonly
Returns the value of attribute metric_name.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(metric_name: 'activerecord.sql', **opts) ⇒ ActiveRecord
constructor
Options:.
Constructor Details
permalink #initialize(metric_name: 'activerecord.sql', **opts) ⇒ ActiveRecord
Options:
*:metric_name
- the metric name, defaults to “activerecord.query” *:include_schema
- record schema queries, off by default *:include_generic
- record general (nameless) queries, off by default *:tags
- additional tags
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/datadog/notifications/plugins/active_record.rb', line 11 def initialize(metric_name: 'activerecord.sql', **opts) super @metric_name = metric_name @include_schema = opts[:include_schema] == true @include_generic = opts[:include_generic] == true @include_raw = opts[:include_raw] == true Datadog::Notifications.subscribe 'sql.active_record' do |reporter, event| record reporter, event end end |
Instance Attribute Details
permalink #metric_name ⇒ Object (readonly)
Returns the value of attribute metric_name.
3 4 5 |
# File 'lib/datadog/notifications/plugins/active_record.rb', line 3 def metric_name @metric_name end |