Version 3.0.0 (#201)

* chore: remove deprecated code

* docs: update v3 migration guide

* fix: pytest warnings

* Version 3.0.0

* fix: docs workflows
This commit is contained in:
d3vyce
2026-04-02 11:21:31 +02:00
committed by GitHub
parent 0b17c77dee
commit bbe63edc46
10 changed files with 98 additions and 49 deletions

View File

@@ -1,6 +1,6 @@
"""Prometheus metrics endpoint for FastAPI applications."""
import asyncio
import inspect
import os
from fastapi import FastAPI
@@ -55,10 +55,10 @@ def init_metrics(
# Partition collectors and cache env check at startup — both are stable for the app lifetime.
async_collectors = [
c for c in registry.get_collectors() if asyncio.iscoroutinefunction(c.func)
c for c in registry.get_collectors() if inspect.iscoroutinefunction(c.func)
]
sync_collectors = [
c for c in registry.get_collectors() if not asyncio.iscoroutinefunction(c.func)
c for c in registry.get_collectors() if not inspect.iscoroutinefunction(c.func)
]
multiprocess_mode = _is_multiprocess()