prometheus-remote-writer
A Python package to send data using Prometheus remote write protocol.
What it is and what it does
prometheus-remote-writer is a Python client library that implements the Prometheus Remote Write protocol, allowing you to push time-series metrics directly to Prometheus-compatible storage backends (such as Prometheus itself, Mimir, or other remote storage systems). It abstracts away the protocol details and HTTP communication, letting you focus on preparing and sending your metric data.
The library handles authentication (bearer tokens, basic auth), custom headers, SSL certificate verification, proxy configuration, request retries, and automatic timestamp conversion. It supports batching multiple time series per request and allows configuration of batch sizes and timeouts. The API is straightforward: create a RemoteWriter instance with your endpoint URL and optional auth/headers, then call send() with your metric data.
Use it for:
- Push application metrics from a Python service to a centralized Prometheus or Mimir instance for monitoring and alerting.
- Export custom time-series data from data processing pipelines to Prometheus-compatible storage for visualization and analysis.
- Integrate metrics collection into a Python application without running a local Prometheus scraper.
- Send batch metrics from periodic jobs or cron tasks to a remote Prometheus endpoint.
- Forward metrics through corporate proxies or to endpoints requiring custom authentication headers.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Sends time-series metrics to Prometheus-compatible remote storage backends using the Prometheus Remote Write protocol, with support for authentication, batching, and custom headers.
Yes, if you need to push metrics to Prometheus-compatible storage from Python and want a straightforward, low-friction client. The library is permissively licensed, has no known vulnerabilities, and supports current Python versions. The aging maintenance status is a minor concern—verify that the package still works with your target Prometheus endpoint and that the maintainer responds to issues before committing to a production dependency.
Install
prometheus-remote-writer on PyPI
pip
pip install prometheus-remote-writeruv
uv add prometheus-remote-writerpoetry
poetry add prometheus-remote-writerInstalling prometheus-remote-writer
Before you install
Low friction installation with three runtime dependencies (grpcio-tools, requests, python-snappy). Package is aging (201 days since last release), so maintenance activity is limited but not abandoned.
License in practice
Licensed under Apache License 2.0 (permissive), so you can use, modify, and distribute the package freely in commercial and open-source projects with minimal restrictions.
Quickstart
pip install prometheus-remote-writer
from prometheus_remote_writer import RemoteWriter
writer = RemoteWriter(
url='https://prometheus-server/api/v1/write',
headers={'Authorization': 'Bearer TOKEN'}
)
writer.send([{
'metric': {'__name__': 'cpu_usage', 'host': 'server1'},
'values': [23.5],
'timestamps': [1609459200000]
}])
Requires Python 3.9 or higher; grpcio-tools, requests, and python-snappy must be installable in your environment.
Verify before relying
- Whether grpcio-tools, requests, and python-snappy are lightweight or have their own heavy transitive dependencies that could increase install friction in practice.
- Actual maintenance status and responsiveness to issues, since 'aging' status (201 days) may indicate either stable maturity or dormancy.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<4,>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — grpcio-tools, requests, python-snappy |
| Maintenance | aging — 201 days since the last release |
| First released | |
| Downloads | 184,472/month — #10,036 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: prometheus_remote_writer-1.1.3-py3-none-any.whl
Tags
More Monitoring packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
opentelemetry-semantic-conventionsProvides generated Python code for…
permissive · top 100 on PyPI
opentelemetry-sdkProvides the reference implementation of the…
permissive · top 100 on PyPI
opentelemetry-apiProvides the abstract API and interfaces for…
permissive · top 100 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,000 on PyPI
prometheus-api-clientConnects to Prometheus monitoring systems and…
permissive · top 5,000 on PyPI
opentelemetry-exporter-prometheus-remote-writeExports metrics from OpenTelemetry Python SDK…
permissive · top 5,000 on PyPI
opentelemetry-exporter-prometheusExports OpenTelemetry metrics to Prometheus for…
permissive · top 1,000 on PyPI
py-grpc-prometheusAdds Prometheus metrics collection to gRPC…
unclear · top 5,000 on PyPI
redfishA Python library for interacting with…
permissive · top 15,000 on PyPI
prometheus-clientInstruments Python applications to expose…
permissive · top 1,000 on PyPI
django-prometheusExports Django application metrics (requests,…
permissive · top 5,000 on PyPI
prometheus-flask-exporterExports HTTP request metrics from Flask…
permissive · top 5,000 on PyPI
aioprometheusA Prometheus client library for asyncio…
permissive · top 15,000 on PyPI
airflow-exporterExposes Airflow DAG and task metrics to…
permissive · top 15,000 on PyPI