opentelemetry.sdk.metrics.export¶
-
class
opentelemetry.sdk.metrics.export.
MetricsExportResult
[source]¶ Bases:
enum.Enum
An enumeration.
-
SUCCESS
= 0¶
-
FAILURE
= 1¶
-
-
class
opentelemetry.sdk.metrics.export.
MetricRecord
(aggregator, labels, metric)[source]¶ Bases:
object
-
class
opentelemetry.sdk.metrics.export.
MetricsExporter
[source]¶ Bases:
object
Interface for exporting metrics.
Interface to be implemented by services that want to export recorded metrics in its own format.
-
export
(metric_records)[source]¶ Exports a batch of telemetry data.
- Parameters
metric_records (
Sequence
[MetricRecord
]) – A sequence ofMetricRecord
s. AMetricRecord
contains the metric to be exported, the labels associated with that metric, as well as the aggregator used to export the current checkpointed value.- Return type
- Returns
The result of the export
-
-
class
opentelemetry.sdk.metrics.export.
ConsoleMetricsExporter
[source]¶ Bases:
opentelemetry.sdk.metrics.export.MetricsExporter
Implementation of
MetricsExporter
that prints metrics to the console.This class can be used for diagnostic purposes. It prints the exported metrics to the console STDOUT.
-
export
(metric_records)[source]¶ Exports a batch of telemetry data.
- Parameters
metric_records (
Sequence
[MetricRecord
]) – A sequence ofMetricRecord
s. AMetricRecord
contains the metric to be exported, the labels associated with that metric, as well as the aggregator used to export the current checkpointed value.- Return type
- Returns
The result of the export
-