Registry / observability / blackfire

blackfire

JSON →
library2026.5.0pypypiunverified

The Blackfire Python SDK enables profiling and performance monitoring of Python applications with Blackfire.io. It supports automatic instrumentation, manual probe API, and integration with frameworks like Django, Flask, Symfony, and more. Current version: 2026.3.0. Released on a regular cadence following Blackfire updates.

pip install blackfire
INSTALL
IMPORT
SIG · BLACKFIRE
B
blackfire
observabilitypythonv2026.5.0
Install
1.8s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2026.5.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.4MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.8s · import 0.000s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BlackfireProbe
from blackfire import BlackfireProbe
from blackfire import BlackfireProbe

Basic profiling using BlackfireProbe as a context manager. Replace client ID and token with your Blackfire credentials.

from blackfire import BlackfireProbe, generate_instrumentation # Set environment variables or config keys import os os.environ['BLACKFIRE_CLIENT_ID'] = 'your-client-id' os.environ['BLACKFIRE_CLIENT_TOKEN'] = 'your-client-token' # Start profiling a block with BlackfireProbe() as probe: # Your code to profile result = sum(range(1000000)) print(result)
Debug
Known issues
breakingBlackfire dropped support for Python 2.7 and 3.5 in version 2022.x. Ensure you are using Python 3.6+.
fix
Upgrade to Python 3.6+ and install blackfire>=2022.0.0.
affects: <2022.0.0
gotchaThe 'blackfire' package must be installed in the Python environment being profiled. For profiling web frameworks, use the framework-specific middleware (e.g., DjangoMiddleware) which may require additional configuration.
fix
Always install blackfire in the same environment as your application. For web apps, add the middleware and set the 'BLACKFIRE_AGENT_SOCKET' environment variable if using a local agent.
affects: all
deprecatedThe 'blackfire.sdk' module is deprecated. All functionality is now in top-level 'blackfire'.
fix
Replace 'from blackfire.sdk import ...' with 'from blackfire import ...'.
affects: >=2022.0.0
gotchaWhen using the 'generate_instrumentation' function, ensure your environment has the BLACKFIRE_AGENT_SOCKET set if you are using a local agent, otherwise profiling may not start.
fix
Set environment variable 'BLACKFIRE_AGENT_SOCKET' to the path of the Blackfire agent socket (e.g., '/var/run/blackfire/agent.sock').
affects: all
Upgrade
Version history
2026.5.0latest on PyPI · released May 22, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
22 hits · last 30 days
node
20
OpenAI (training)
1
Resources