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.

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
starlette_prometheus-0.10.0.tar.gz 15.7 kB Details

Built distribution (wheel)

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

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

Release history Release notifications | RSS feed

This release

0.10.0 This release

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

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