aiocop
Non-intrusive monitoring for Python asyncio and uvloop. Detects, pinpoints, and logs blocking IO and CPU calls that freeze your event loop.
Decision gist · record as of 2026-08-14
Yes. It solves a real problem (finding blocking calls in asyncio code) with low overhead, no runtime dependencies, and a permissive license. Active maintenance, Production/Stable status, and zero known vulnerabilities. Suitable for both development debugging and production monitoring. Install if you run asyncio or uvloop and want to catch event loop freezes early.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later (sys.audit hooks are the foundation).
- Low friction: pure Python wheel with no runtime dependencies.
- Active maintenance (last commit 2026-07-20, first release 2026-01-05) and marked Production/Stable.
License · maintenance · safety
MIT (permissive) — MIT license (permissive) — you can use, modify, and distribute freely with minimal restrictions.
last release 2026-07-20 (25 days) · last repo commit 2026-07-20 · 19 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 145,017 downloads/mo, #11,138 on PyPI
Alternatives
Verify before relying
pip install aiocop
import asyncio
import aiocop
def on_slow_task(event):
print(f"Blocking detected: {event.elapsed_ms}ms")
async def main():
aiocop.patch_audit_functions()
aiocop.start_blocking_io_detection()
aiocop.detect_slow_tasks(threshold_ms=10, on_slow_task=on_slow_task)
aiocop.activate()
# your async code here
asyncio.run(main())- Whether the ~13 microseconds overhead claim holds across different workload patterns and Python versions.
- Compatibility with other instrumentation tools beyond APMs (e.g., profilers, tracing libraries).
- How well context propagation works with libraries that use contextvars in non-standard ways.
What it is and what it does
aiocop is a non-intrusive monitoring tool for asyncio and uvloop that catches blocking I/O and CPU calls that freeze your event loop. It wraps the event loop's scheduling methods and uses Python's sys.audit hooks to detect when blocking functions like open(), network calls, or subprocess operations run in async code, then captures the full stack trace to show you exactly where the problem is.
The tool is designed for production use with minimal overhead (approximately 13 microseconds per task). You register callbacks to handle detected blocking events, can enable or disable monitoring at runtime, and optionally raise exceptions on high-severity violations during development or testing. It works with both standard asyncio and uvloop, and integrates into ASGI frameworks like FastAPI.
Use it for
- Detect blocking file I/O (open, read, write) in async handlers before they reach production.
- Monitor long-running async tasks in web services to find where event loop delays originate.
- Enforce async best practices in CI/CD by raising exceptions on blocking calls during test runs.
- Debug performance issues in uvloop-based applications by pinpointing blocking calls with stack traces.
- Integrate with monitoring systems (Datadog, Prometheus) to track blocking events and severity over time.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
It solves a real problem (finding blocking calls in asyncio code) with low overhead, no runtime dependencies, and a permissive license. Active maintenance, Production/Stable status, and zero known vulnerabilities. Suitable for both development debugging and production monitoring. Install if you run asyncio or uvloop and want to catch event loop freezes early.
Install
aiocop on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Active maintenance (last commit 2026-07-20, first release 2026-01-05) and marked Production/Stable.
Requires Python 3.10 or later (sys.audit hooks are the foundation).
License in practice
MIT license (permissive) — you can use, modify, and distribute freely with minimal restrictions.
Quickstart
pip install aiocop
import asyncio
import aiocop
def on_slow_task(event):
print(f"Blocking detected: {event.elapsed_ms}ms")
async def main():
aiocop.patch_audit_functions()
aiocop.start_blocking_io_detection()
aiocop.detect_slow_tasks(threshold_ms=10, on_slow_task=on_slow_task)
aiocop.activate()
# your async code here
asyncio.run(main())
Verify before relying
- Whether the ~13 microseconds overhead claim holds across different workload patterns and Python versions.
- Compatibility with other instrumentation tools beyond APMs (e.g., profilers, tracing libraries).
- How well context propagation works with libraries that use contextvars in non-standard ways.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 25 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 145,017 / month, #11,138 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: ConsoleFramework :: AsyncIOIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Software Development :: DebuggersTopic :: Software Development :: Quality AssuranceTopic :: System :: MonitoringTyping :: Typed |
Evidence: aiocop-1.1.5-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “asyncio blocking io detection”
- aiocopDetects and logs blocking I/O and CPU calls in asyncio code using…
- blockbusterBlockbuster detects and prevents blocking calls within an asyncio…
- aiofilesProvides non-blocking file I/O for asyncio applications by delegating…
Give your agent the search over MCP, or paste the wish link into any chat.
More Monitoring packages
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
Provides generated Python code for OpenTelemetry semantic conventions, enabling standardized attribute naming and constant definitions for instrumentation and telemetry collection.
Install it if you are using OpenTelemetry and want to follow semantic conventions correctly.
Provides the reference implementation of the OpenTelemetry API for collecting and exporting traces, metrics, and logs from Python applications.
Provides the abstract API and interfaces for OpenTelemetry instrumentation in Python, defining how to emit traces, metrics, and logs without tying code to a specific SDK implementation.
Exports OpenTelemetry observability data to an OpenTelemetry Collector using Protobuf-encoded messages over HTTP.
Install it if you are using OpenTelemetry in Python and need to send data to a Collector over HTTP.
Provides automatic instrumentation commands and programmatic APIs to inject distributed tracing into Python applications without code changes, detecting and instrumenting packages used by your program.
Install it if you need distributed tracing without code changes and have compatible instrumented packages in your environment.
See also blockbuster · pyleak · uvloop · winloop · pyccolo · safe-init · aiosignal · aiodebug · aiomonitor · aioprocessing