Skip to main content

Prometheus integration for Starlette

Project description

Starlette Prometheus

Build Status Package Version PyPI Version

:warning: This repository is a fork of the original starlette_prometheus middleware, using upgraded dependencies.

Introduction

Prometheus integration for Starlette.

Requirements

  • Python 3.6+
  • Starlette 0.9+

Installation

$ pip install starlette-prometheus-middleware

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.

Contributing

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

starlette-prometheus-middleware-0.9.0.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file starlette-prometheus-middleware-0.9.0.tar.gz.

File metadata

File hashes

Hashes for starlette-prometheus-middleware-0.9.0.tar.gz
Algorithm Hash digest
SHA256 c662e19b6c03b18f449ad5a3958406a9730368c6b7bae20fec13f1520046b398
MD5 4ddcfb05dea230af1c4034e175573773
BLAKE2b-256 f5f1648bd46a49240125b809aac0c2fee231c6364b7f0d3cd210f0232acd33c8

See more details on using hashes here.

File details

Details for the file starlette_prometheus_middleware-0.9.0-py3-none-any.whl.

File metadata

File hashes

Hashes for starlette_prometheus_middleware-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4dfe23bfd6696c391c4326221f5ef8e6d2ac07b235b9fbaf6df8d86cf9261ea4
MD5 cd2d0889c7472028fe498a3ad3adbc3e
BLAKE2b-256 d7fde7708809dfce036bdec0481ed44094366be312cc5ae3984cab04c4249151

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page