Module: Sentry::Metrics
- Defined in:
- lib/sentry/metrics.rb
Class Method Summary collapse
-
.count(name, value: 1, attributes: nil) ⇒ void
Increments a counter metric.
-
.distribution(name, value, unit: nil, attributes: nil) ⇒ void
Records a distribution metric.
-
.gauge(name, value, unit: nil, attributes: nil) ⇒ void
Records a gauge metric.
Class Method Details
.count(name, value: 1, attributes: nil) ⇒ void
This method returns an undefined value.
Increments a counter metric
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/sentry/metrics.rb', line 13 def count(name, value: 1, attributes: nil) return unless Sentry.initialized? Sentry.get_current_hub.capture_metric( name: name, type: :counter, value: value, attributes: attributes ) end |
.distribution(name, value, unit: nil, attributes: nil) ⇒ void
This method returns an undefined value.
Records a distribution metric
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/sentry/metrics.rb', line 48 def distribution(name, value, unit: nil, attributes: nil) return unless Sentry.initialized? Sentry.get_current_hub.capture_metric( name: name, type: :distribution, value: value, unit: unit, attributes: attributes ) end |
.gauge(name, value, unit: nil, attributes: nil) ⇒ void
This method returns an undefined value.
Records a gauge metric
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/sentry/metrics.rb', line 30 def gauge(name, value, unit: nil, attributes: nil) return unless Sentry.initialized? Sentry.get_current_hub.capture_metric( name: name, type: :gauge, value: value, unit: unit, attributes: attributes ) end |