Skip to main content

Starlette Prometheus

Build Status Package Version PyPI Version

Introduction

Prometheus integration for Starlette.

Requirements

  • Python 3.8+
  • Starlette 0.12+

Installation

$ pip install starlette-prometheus

Usage

A complete example that exposes prometheus metrics endpoint under /metrics/ path.

from starlette.applications import Starlette
from starlette_prometheus import metrics, PrometheusMiddleware

app = Starlette()

app.add_middleware(PrometheusMiddleware)
app.add_route("/metrics/", metrics)

Metrics for paths that do not match any Starlette route can be filtered by passing filter_unhandled_paths=True argument to add_middleware method. Note that not turning on this filtering can lead to unbounded memory use when lots of different routes are called.

Contributing

This project is absolutely open to contributions so if you have a nice idea, create an issue to let the community discuss it.

Metadata

Release files for starlette-prometheus 0.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for starlette-prometheus 0.10.0
File Size Uploaded Provenance Actions
starlette_prometheus-0.10.0.tar.gz 15.7 kB Without provenance Details for starlette_prometheus-0.10.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for starlette-prometheus 0.10.0
File Interpreter ABI Platform Actions
starlette_prometheus-0.10.0-py3-none-any.whl Python 3 none any Details for starlette_prometheus-0.10.0-py3-none-any.whl

Total release size: 32.0 kB

Release files / starlette_prometheus-0.10.0.tar.gz

Download URL starlette_prometheus-0.10.0.tar.gz
Size 15.7 kB
Tags Source
SHA-256 checksum
How to use checksums
77d1e9cfad572206e8de242975bd00a62e33685eb330389f2add04e4d719d47d
BLAKE2b-256 checksum
How to use checksums
89f203fc6b3c10fb436c81ee567ac46c49418819d6901101ece7bd45be465162
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.4 Darwin/23.6.0

Release files / starlette_prometheus-0.10.0-py3-none-any.whl

Download URL starlette_prometheus-0.10.0-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b2f997495f809f01387378dad5476b2a1cf2fb2d9b96164394effdecb2d8380
BLAKE2b-256 checksum
How to use checksums
1040244a5eba1a1d0393b9eea768afee74ab8e0d7d0e99299edbcafe22ef65f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.4 Darwin/23.6.0

Security for starlette-prometheus 0.10.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page