Platform
Using OpenTelemetry Exporter for Prometheus Remote Write
Use OpenTelemetry Prometheus Exporter package in Python applications to send data to Prometheus-compatible systems such as Last9
You can push custom metrics to Prometheus-compatible backends, such as Last9, using OpenTelemetry Exporter for Prometheus Remote Write.
This tutorial shows how to use the Otel Exporter with a Python application to send metrics to a Prometheus-compatible backend.
Here is a sample Python application that includes the package for Otel Expoter for Remote Write.
The script accepts the following CLI arguments.
- Remote Write URL
- Username
- Password
- Metric name
- Labels
A complete example is as follows:
This will insert the metric into the Remote Write backend, and we can confirm this by looking into Grafana.
The complete code example can be found here.