--- id: py-grpc-prometheus version: "0.8.0" license: unclear license_treatment: unclear maintenance: dormant --- # py-grpc-prometheus — Python gRPC Prometheus Interceptors License: unclear · Maintenance: dormant · Downloads: 961.3K/mo ## 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 above — 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 pip install py-grpc-prometheus uv add py-grpc-prometheus poetry add py-grpc-prometheus ## Installing 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: unspecified - Install friction: low - Maintenance: dormant - Downloads: 961.3K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags grpc prometheus metrics, grpc monitoring interceptor, grpc observability, prometheus grpc instrumentation, grpc latency tracking, grpc request metrics, grpc performance monitoring, grpc-instrumentation, prometheus-metrics, observability [View on SkillFed](https://skillfed.io/packages/py-grpc-prometheus) · [View on PyPI](https://pypi.org/project/py-grpc-prometheus/)