Module: OpenTelemetry::SDK::Trace::Export::MetricsReporter
- Extended by:
- MetricsReporter
- Included in:
- MetricsReporter
- Defined in:
- lib/opentelemetry/sdk/trace/export/metrics_reporter.rb
Overview
MetricsReporter defines an interface used for reporting metrics from span processors (like the BatchSpanProcessor) and exporters. It can be used to report metrics such as dropped spans, and successful and failed export attempts. This exists to decouple the Trace SDK from the unstable OpenTelemetry Metrics API. An example implementation in terms of StatsD is:
module MetricsReporter def add_to_counter(metric, increment: 1, labels: {}) StatsD.increment(metric, increment, labels, no_prefix: true) end def record_value(metric, value:, labels: {}) StatsD.distribution(metric, value, labels, no_prefix: true) end def observe_value(metric, value:, labels: {}) StatsD.gauge(metric, value, labels, no_prefix: true) end end
Instance Method Summary collapse
-
#add_to_counter(metric, increment: 1, labels: {}) ⇒ Object
Adds an increment to a metric with the provided labels.
-
#observe_value(metric, value:, labels: {}) ⇒ Object
Observes a value for a metric with the provided labels.
-
#record_value(metric, value:, labels: {}) ⇒ Object
Records a value for a metric with the provided labels.
Instance Method Details
#add_to_counter(metric, increment: 1, labels: {}) ⇒ Object
Adds an increment to a metric with the provided labels.
38 |
# File 'lib/opentelemetry/sdk/trace/export/metrics_reporter.rb', line 38 def add_to_counter(metric, increment: 1, labels: {}); end |
#observe_value(metric, value:, labels: {}) ⇒ Object
Observes a value for a metric with the provided labels.
54 |
# File 'lib/opentelemetry/sdk/trace/export/metrics_reporter.rb', line 54 def observe_value(metric, value:, labels: {}); end |
#record_value(metric, value:, labels: {}) ⇒ Object
Records a value for a metric with the provided labels.
46 |
# File 'lib/opentelemetry/sdk/trace/export/metrics_reporter.rb', line 46 def record_value(metric, value:, labels: {}); end |