# trallnag/prometheus-fastapi-instrumentator

Instrument your FastAPI with Prometheus metrics.

Repository: https://github.com/trallnag/prometheus-fastapi-instrumentator
Canonical: https://ross.abutalabs.com/products/prometheus-fastapi-instrumentator
Language: Python
License: ISC
License Family: permissive
Topics: prometheus, fastapi, metrics, exporter, instrumentation
Last push: 2026-08-01T05:34:02+00:00

## Health v2 (maintenance only)
Score: 92/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 95, release rhythm 83, longevity 100
- inputs: {"age_days": 2246, "days_push": 32, "days_rel": 38, "gap_med": 33, "n_releases_24m": 6}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1482, forks 117 (observed 2026-08-28T04:04:51.259290+00:00)

## What it is
A configurable, modular Python library that instruments FastAPI applications with Prometheus metrics. It exposes default HTTP request metrics and supports custom metric functions via a simple one-line setup.

## Use cases
- add prometheus metrics to a fastapi app
- track http request latency and counts in fastapi
- expose a /metrics endpoint for prometheus scraping
- monitor request and response sizes in fastapi
- create custom prometheus metrics for fastapi endpoints
- reduce metric cardinality with grouped status codes

## When to choose
- you run a FastAPI service and want Prometheus observability with minimal setup
- you need sensible default HTTP metrics plus the ability to customize metrics
- you want a maintained, widely used instrumentation library

## When to avoid
- your app is not built on FastAPI
- you need a full metrics/monitoring stack rather than just instrumentation
- you require metrics for frameworks other than FastAPI

## Facets
- artifact type: library
- maturity: active
- function: monitoring, middleware, web-framework
- domain: monitoring, web-development, backend
- platform: python
- tags: prometheus, fastapi, metrics, instrumentation, exporter, devops, web-server

## Member repositories
- trallnag/prometheus-fastapi-instrumentator (main) score 92

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:51.259290+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:34:09.179140+00:00, confidence not recorded.
  - readme: https://github.com/trallnag/prometheus-fastapi-instrumentator (fetched 2026-08-28T04:04:51.259290+00:00, sha 6d82fba8089b)
  - registry_pypi: https://pypi.org/pypi/prometheus-fastapi-instrumentator/json (fetched 2026-08-29T11:40:50.635346+00:00, sha 70417fc5a7bd)
- Data as of 2026-08-30T08:39:29.467469+00:00.
