Skip to main content

Minimalist SRE metrics for FastAPI and Flask

Project description

SRE RED Metrics

PyPI

Minimalist SRE metrics for Python web frameworks.

Features

  • Default metrics on port 9090
  • Tracks individual status codes + optional grouping
  • FastAPI and Flask support
  • <5ms overhead

FastAPI Installation

pip install sre-metrics[fastapi]

FastAPI Usage

from fastapi import FastAPI
from sre-metrics import instrument_fastapi

app = FastAPI()
instrument_fastapi(app)  # Metrics on :9090 by default

# Custom port
instrument_fastapi(app, metrics_port=9091, excluded_paths=["/healthz"])

Flask Installation

pip install sre-metrics[flask]
from flask import Flask
from sre-metrics import instrument_flask

app = Flask(__name__)
instrument_flask(app)  # Metrics on :9090

# Custom options:
instrument_flask(app, metrics_port=9091, excluded_paths=["/healthz"])

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

sre_metrics-1.0.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sre_metrics-1.0.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file sre_metrics-1.0.0.tar.gz.

File metadata

  • Download URL: sre_metrics-1.0.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for sre_metrics-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c89dac05a05d3988b6c8382d47215efd782a6f9953ef8eef72552c7e1c6f580d
MD5 163ba935abfe19cb6e42a4eadd4d629b
BLAKE2b-256 138648a12ed91033664776fc6365efd78199a891e3a9fdcacbd55ae1c51f6c49

See more details on using hashes here.

File details

Details for the file sre_metrics-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: sre_metrics-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for sre_metrics-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a066acedb78e32393ab2d8c0db74ea964d605bfc090a45501cd8d4ff0a2ee6a
MD5 1e1cdcfad1f016d742f54b82f4cc9813
BLAKE2b-256 d76182f34c8601513ad578500bda411398bc7442581888dcdc58857bf35b22d2

See more details on using hashes here.

Supported by

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