# What changed in prometheus-fastapi-instrumentator

> 16 changes in prometheus-fastapi-instrumentator 7 to 8 from its official release notes, upgrade guides and advisories: 4 breaking, 5 new APIs and options. Each one cited. Sources checked 2026-10-23. HTML: https://unstale.sh/pypi/prometheus-fastapi-instrumentator/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## prometheus-fastapi-instrumentator 8

### Breaking changes

- The middleware app parameter type changed from Starlette to ASGIApp. (8.0.0) — [release notes](https://github.com/trallnag/prometheus-fastapi-instrumentator/releases/tag/v8.0.0)
- The minimum required Python version increased from 3.8 to 3.10. (8.0.0) — [release notes](https://github.com/trallnag/prometheus-fastapi-instrumentator/releases/tag/v8.0.0)
- The required Starlette version range changed from >=0.30.0,<1.0.0 to >=1.0.0,<2.0.0. (8.0.0) — [release notes](https://github.com/trallnag/prometheus-fastapi-instrumentator/releases/tag/v8.0.0)

### New APIs and options

- 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. (8.1.0) — [release notes](https://github.com/trallnag/prometheus-fastapi-instrumentator/releases/tag/v8.1.0)

### Fixes and other changes

- Fixes incorrect handling of nested apps and routes in some corner cases introduced with 8.0.1. (8.1.0) — [release notes](https://github.com/trallnag/prometheus-fastapi-instrumentator/releases/tag/v8.1.0)
- Fixes resolving route names when a FastAPI app has a root path set. (8.1.0) — [release notes](https://github.com/trallnag/prometheus-fastapi-instrumentator/releases/tag/v8.1.0)
- Replaces deprecated asyncio.iscoroutinefunction() with inspect.iscoroutinefunction() to avoid warnings on Python 3.12+. (8.0.2) — [release notes](https://github.com/trallnag/prometheus-fastapi-instrumentator/releases/tag/v8.0.2)
- Hitting mounts with slash redirection no longer collects the wrong handler name. (8.0.1) — [release notes](https://github.com/trallnag/prometheus-fastapi-instrumentator/releases/tag/v8.0.1)
- 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. (8.0.1) — [release notes](https://github.com/trallnag/prometheus-fastapi-instrumentator/releases/tag/v8.0.1)

## prometheus-fastapi-instrumentator 7

### Breaking changes

- Python 3.7 is no longer supported. (7.0.0) — [release notes](https://github.com/trallnag/prometheus-fastapi-instrumentator/releases/tag/v7.0.0)

### New APIs and options

- The constructor adds an opt-in flag to record duration without streaming. (7.0.0) — [release notes](https://github.com/trallnag/prometheus-fastapi-instrumentator/releases/tag/v7.0.0)
- The closure adds an opt-in flag to record duration without streaming. (7.0.0) — [release notes](https://github.com/trallnag/prometheus-fastapi-instrumentator/releases/tag/v7.0.0)
- Adds modified_duration_without_streaming, which instrumentation functions can use to set metrics. (7.0.0) — [release notes](https://github.com/trallnag/prometheus-fastapi-instrumentator/releases/tag/v7.0.0)
- The closure adds an opt-in flag to record duration without streaming. (7.0.0) — [release notes](https://github.com/trallnag/prometheus-fastapi-instrumentator/releases/tag/v7.0.0)

### Behavior and default changes

- Its argument type is relaxed to HTTPConnection, allowing the function to get websocket route names as well. (7.0.0) — [release notes](https://github.com/trallnag/prometheus-fastapi-instrumentator/releases/tag/v7.0.0)
- Instrumentator now works with Starlette applications without requiring FastAPI. (7.0.0) — [release notes](https://github.com/trallnag/prometheus-fastapi-instrumentator/releases/tag/v7.0.0)
