Class: Maze::Plugins::DatadogMetricsPlugin

Inherits:
Object
  • Object
show all
Defined in:
lib/maze/plugins/datadog_metrics_plugin.rb

Overview

Enables metrics to be reported to Datadog via a StatsD proxy

Class Method Summary collapse

Class Method Details

.send_gauge(metric, value, tags = []) ⇒ Object

Sends a gauge metric to Datadog

Parameters:

  • metric (String)

    The identifier of the metric

  • value (Integer)

    The value of the metric

  • tags (Array) (defaults to: [])

    An array of strings with which to tag the metric



16
17
18
19
# File 'lib/maze/plugins/datadog_metrics_plugin.rb', line 16

def send_gauge(metric, value, tags=[])
  return unless logging?
  stats_dog.gauge(metric, value, tags: tags)
end

.send_increment(metric, tags = []) ⇒ Object

Sends an increment metric to Datadog

Parameters:

  • metric (String)

    The identifier of the metric

  • tags (Array) (defaults to: [])

    An array of strings with which to tag the metric



25
26
27
28
# File 'lib/maze/plugins/datadog_metrics_plugin.rb', line 25

def send_increment(metric, tags=[])
  return unless logging?
  stats_dog.increment(metric, tags: tags)
end