pypi / prometheus-fastapi-instrumentator
prometheus-fastapi-instrumentator
What changed in prometheus-fastapi-instrumentator 7 to 8, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-23.
4 breaking5 new APIs and options2 behavior and defaults5 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initprometheus-fastapi-instrumentator 89 changes
Breaking changes 3
The middleware app parameter type changed from Starlette to ASGIApp.
The minimum required Python version increased from 3.8 to 3.10.
The required Starlette version range changed from >=0.30.0,<1.0.0 to >=1.0.0,<2.0.0.
New APIs and options 1
Adds an optional Instrumentator constructor parameter that includes the FastAPI app's effective root_path in the handler label of default exported Prometheus metrics when set to True; defaults to False.
Fixes and other changes 5
Fixes incorrect handling of nested apps and routes in some corner cases introduced with 8.0.1.
Fixes resolving route names when a FastAPI app has a root path set.
Replaces deprecated asyncio.iscoroutinefunction() with inspect.iscoroutinefunction() to avoid warnings on Python 3.12+.
Hitting mounts with slash redirection no longer collects the wrong handler name.
Route names for routers registered via include_router() on FastAPI 0.116+ now resolve through included routers to the leaf endpoint, preventing AttributeError on every request and reflecting the leaf endpoint in the Prometheus label.
prometheus-fastapi-instrumentator 77 changes
Breaking changes 1
Python 3.7 is no longer supported.
New APIs and options 4
The constructor adds an opt-in flag to record duration without streaming.
The closure adds an opt-in flag to record duration without streaming.
Adds modified_duration_without_streaming, which instrumentation functions can use to set metrics.
The closure adds an opt-in flag to record duration without streaming.
Behavior and default changes 2
Its argument type is relaxed to HTTPConnection, allowing the function to get websocket route names as well.
Instrumentator now works with Starlette applications without requiring FastAPI.