OpenTelemetry Cloud Monitoring Exporter¶
- class opentelemetry.exporter.cloud_monitoring.CloudMonitoringMetricsExporter(project_id=None, client=None, add_unique_identifier=False)[source]
Bases:
opentelemetry.sdk.metrics._internal.export.MetricExporter
Implementation of Metrics Exporter to Google Cloud Monitoring
You can manually pass in project_id and client, or else the Exporter will take that information from Application Default Credentials.
- Parameters
project_id (
Optional
[str
]) – project id of your Google Cloud project.client (
Optional
[MetricServiceClient
]) – Client to upload metrics to Google Cloud Monitoring.add_unique_identifier (
bool
) – Add an identifier to each exporter metric. This must be used when there exist two (or more) exporters that may export to the same metric name within WRITE_INTERVAL seconds of each other.
- export(metrics_data, timeout_millis=10000, **kwargs)[source]
Exports a batch of telemetry data.
- Parameters
metrics – The list of opentelemetry.sdk.metrics.export.Metric objects to be exported
- Return type
MetricExportResult
- Returns
The result of the export
- force_flush(timeout_millis=10000)[source]
Ensure that export of any metrics currently received by the exporter are completed as soon as possible.
- Return type