opentelemetry.exporter.cloud_monitoring.CloudMonitoringMetricsExporter¶
- class opentelemetry.exporter.cloud_monitoring.CloudMonitoringMetricsExporter(project_id=None, client=None, add_unique_identifier=False, prefix='workload.googleapis.com')[source]¶
Bases:
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.prefix (
Optional
[str
]) – the prefix of the metric. It is “workload.googleapis.com” by default if not specified.
Methods
Exports a batch of telemetry data.
Ensure that export of any metrics currently received by the exporter are completed as soon as possible.
Shuts down the exporter.
- 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:
- Returns:
The result of the export