Skip to main content

A Python OpenTelemetry exporter for the OCI Monitoring Service.

Project description

opentelemetry-exporter-oci-monitoring

pipeline status latest package version supported python versions PyPI - Downloads license source files coverage pyright ruff pre-commit

A Python OpenTelemetry exporter for the OCI Monitoring Service.

pip install opentelemetry-exporter-oci-monitoring

This software is in an early development phase. Feel free to use it at your own risk.

Histograms are not yet implemented and will be skipped during export.

from oci.monitoring import MonitoringClient
from opentelemetry_exporter_oci_monitoring import MetricsSerializer
from opentelemetry_exporter_oci_monitoring.utils import make_default_exporter
from opentelemetry.sdk.metrics.export import ConsoleMetricExporter

client = MonitoringClient(service_endpoint="https://telemetry-ingestion.eu-frankfurt-1.oraclecloud.com", ...)
exporter = make_default_exporter(client, namespace="my-met-ns", resource_group="my-res-grp", compartment_id="ocid1.compartment.abc123")

# for local development, you can export the converted metrics to stdout

metrics_serializer = MetricsSerializer(exporter.converter)
console_exporter = ConsoleMetricExporter(formatter=metrics_serializer)

Remember to set the service endpoint to a telemetry-ingestion URL (e.g. https://telemetry-ingestion.eu-frankfurt-1.oraclecloud.com) when creating the metrics client. For more details refer to the OCI Documentation of PostMetricData API.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page