py-grpc-prometheus
Python gRPC Prometheus Interceptors
What it is and what it does
py-grpc-prometheus is an instrumentation library that exposes Prometheus metrics from gRPC services. It provides interceptors for both client and server sides that automatically track standard metrics: request counts (grpc_server_started_total, grpc_client_started_total), completion status (grpc_server_handled_total, grpc_client_handled_total), message volumes (grpc_server_msg_received_total, grpc_server_msg_sent_total, and client equivalents), and optionally request handling latencies via histograms (grpc_server_handling_seconds, grpc_client_handling_seconds).
The library mirrors the metric set from the Java and Go gRPC Prometheus libraries, making it a standard choice for Python gRPC observability. It integrates by wrapping gRPC channels on the client side and adding interceptors to the server at startup. Histograms and legacy metric names are opt-in to avoid high-cardinality label issues. With three runtime dependencies and a pure-Python wheel, it has low install friction, but its dormant maintenance status means it may lag behind new gRPC or Prometheus releases.
Use it for:
- Monitor gRPC service request rates, error rates, and completion status in production Prometheus instances.
- Track per-method latency distributions and SLA compliance using Prometheus histograms on gRPC handlers.
- Instrument gRPC client code to observe outbound request metrics and detect slow or failing downstream services.
- Migrate existing gRPC observability from Java or Go services to Python while reusing the same metric names and Prometheus dashboards.
- Diagnose gRPC performance issues by correlating message send/receive counts with latency histograms.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds Prometheus metrics collection to gRPC services via interceptors, tracking request counts, message volumes, and handling latencies on both client and server sides.
Yes, if you are already running gRPC services with Prometheus and need standard metrics instrumentation. The library is stable, has low install friction, and aligns with ecosystem conventions. However, verify the unclear license before use in proprietary contexts, and be aware that dormant maintenance means no active support for future gRPC or Prometheus incompatibilities—suitable for mature, stable deployments rather than greenfield projects expecting active updates.
Install
py-grpc-prometheus on PyPI
pip
pip install py-grpc-prometheusuv
uv add py-grpc-prometheuspoetry
poetry add py-grpc-prometheusInstalling py-grpc-prometheus
Before you install
Low install friction with a pure Python wheel and three straightforward runtime dependencies (setuptools, grpcio, prometheus-client). Maintenance is dormant—last release was 2024-02-29, last commit 2024-05-20, and no updates in 897 days—so expect no active support for new gRPC or Prometheus versions.
License in practice
License status is unclear; no SPDX identifier or raw license text is available in the package metadata. Verify the actual license before use in proprietary or GPL-sensitive contexts.
Quickstart
pip install py-grpc-prometheus
# Server side
import grpc
from concurrent import futures
from py_grpc_prometheus.prometheus_server_interceptor import PromServerInterceptor
from prometheus_client import start_http_server
server = grpc.server(futures.ThreadPoolExecutor(max_workers=10),
interceptors=(PromServerInterceptor(),))
start_http_server(metrics_port)
Verify before relying
- Python version compatibility is unspecified; verify support for your target Python version.
- Whether dormant status means the library is stable or at risk of incompatibility with newer gRPC/Prometheus releases.
Package facts
| License | not declared (unclear) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — setuptools, grpcio, prometheus-client |
| Maintenance | dormant — 897 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 961,295/month — #4,632 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: py_grpc_prometheus-0.8.0-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
grpc-interceptorProvides simplified server and client…
permissive · top 1,000 on PyPI
opentelemetry-instrumentation-grpcAdds automatic tracing and monitoring to gRPC…
permissive · top 5,000 on PyPI
prometheus-api-clientConnects to Prometheus monitoring systems and…
permissive · top 5,000 on PyPI
prometheus-clientInstruments Python applications to expose…
permissive · top 1,000 on PyPI
grpcio-adminExposes debugging and monitoring services for…
permissive · top 15,000 on PyPI
prometheus-asyncAdds async/await support to Prometheus metrics…
permissive · top 15,000 on PyPI
prometheus-fastapi-instrumentatorAdds Prometheus metrics collection and exposure…
permissive · top 5,000 on PyPI
django-prometheusExports Django application metrics (requests,…
permissive · top 5,000 on PyPI
starlink-grpc-coreProvides a Python module for communicating with…
permissive · top 15,000 on PyPI
prometheus-client-python-speedupsProvides optional C/Rust-compiled speedups for…
unclear · top 15,000 on PyPI