Class: Attio::Observability::Metrics::Datadog
- Inherits:
-
Object
- Object
- Attio::Observability::Metrics::Datadog
- Defined in:
- lib/attio/observability.rb
Overview
Datadog metrics
Instance Method Summary collapse
- #format_tags(tags) ⇒ Object private
- #gauge(metric, value, tags: {}) ⇒ Object
- #histogram(metric, value, tags: {}) ⇒ Object
- #increment(metric, tags: {}) ⇒ Object
-
#initialize ⇒ Datadog
constructor
A new instance of Datadog.
Constructor Details
#initialize ⇒ Datadog
Returns a new instance of Datadog.
248 249 250 251 252 253 |
# File 'lib/attio/observability.rb', line 248 def initialize require "datadog/statsd" @client = ::Datadog::Statsd.new("localhost", 8125) rescue LoadError raise "Please add 'dogstatsd-ruby' to your Gemfile" end |
Instance Method Details
#format_tags(tags) ⇒ Object (private)
267 268 269 |
# File 'lib/attio/observability.rb', line 267 private def () .map { |k, v| "#{k}:#{v}" } end |
#gauge(metric, value, tags: {}) ⇒ Object
259 260 261 |
# File 'lib/attio/observability.rb', line 259 def gauge(metric, value, tags: {}) @client.gauge(metric, value, tags: ()) end |
#histogram(metric, value, tags: {}) ⇒ Object
263 264 265 |
# File 'lib/attio/observability.rb', line 263 def histogram(metric, value, tags: {}) @client.histogram(metric, value, tags: ()) end |
#increment(metric, tags: {}) ⇒ Object
255 256 257 |
# File 'lib/attio/observability.rb', line 255 def increment(metric, tags: {}) @client.increment(metric, tags: ()) end |