Prometheus shows counters from your gunicorn app jumping up and down between scrapes.
AdvancedTroubleshootingConcurrency, async, tests, services & containers
Answer
Likely causes → Multiple gunicorn workers each keep their own metrics; each scrape hits a different worker.
Diagnose → Compare /metrics output from repeated curls; values differ per request.
Fix → Enable prometheus_client multiprocess mode: set PROMETHEUS_MULTIPROC_DIR (empty, writable) before startup, serve metrics through MultiProcessCollector, call multiprocess.mark_process_dead(worker.pid) in gunicorn's child_exit hook.
Prevent → Use the multiprocess setup in your service template whenever workers > 1.
More on Concurrency, async, tests, services & containers
`RuntimeError: asyncio.run() cannot be called from a running event loop` in a Jupyter notebook or inside an async framework.Intermediate`RuntimeWarning: coroutine 'fetch' was never awaited` and nothing happens.BeginnerAn asyncio health-checker is no faster than a sequential loop.Advanced`Task was destroyed but it is pending!` at shutdown.Advanced`OSError: [Errno 24] Too many open files` from an asyncio scanner with 20,000 targets.IntermediateA `ThreadPoolExecutor` job finishes "successfully" but half the work is missing, with no errors logged.Intermediate