The Problem Nobody Talks About Enough
Have you ever opened a Python file you didn't write, stared at it for 20 minutes, and still had no idea how it actually runs?
Or maybe you've spent a full afternoon chasing a performance bug, adding print() statements like breadcrumbs through a forest, only to discover the bottleneck was buried three levels deep in a helper function you forgot existed?
We spend a lot of time talking about writing code — clean code, SOLID principles, design patterns. But we don't talk nearly enough about reading and understanding code, which is where most of your actual working hours go.
Your existing options? cProfile outputs walls of text. py-spy lives in your terminal. Manual print debugging is timeless but you know how that goes.
What if your editor just showed you how the code runs?
Enter CallFlow Tracer
CallFlow Tracer is an open-source Python library that traces function execution and renders it as an interactive call graph. The VS Code extension brings this directly into your editor — no terminal juggling, no separate tools.
Here's the simplest possible way to use it:
A side panel opens with a live, interactive network graph — function nodes, call relationships, execution times, color-coded by module. Slow functions glow red. Fast ones stay green.
Installing It
From the VS Code Marketplace: Press Ctrl+Shift+X (or Cmd+Shift+X on Mac), search "CallFlow Tracer", and click Install. The extension handles the Python package automatically.
Or install the package manually:
# Install the Python library pip install callflow-tracer # Or install from source cd /path/to/callflow-tracer/vscode-extension code --install-extension callflow-tracer-2.0.0.vsix
The Features That Actually Matter
Interactive Call Graphs
Force-directed, Hierarchical, Circular, and Timeline layouts. Filter by module, search functions, zoom and pan.
Flamegraph View
Classic performance visualization. Green = fast, Red = slow. Click any bar to drill into specific call paths.
Async / Await Support
Timeline layout shows concurrent coroutine execution. Spot sequential awaits that could be parallelized.
OpenTelemetry Export
Export traces to Jaeger, Honeycomb, Datadog — any OTel-compatible backend. Bridge local dev and production.
Trace Selected Functions
Focus on one function and everything it calls. Perfect for third-party library analysis.
Auto-Instrumentation
Traces requests, Redis, boto3, SQLAlchemy, psycopg2 automatically — no code changes needed.
Flamegraph View
If you're debugging performance specifically, switch to the Flamegraph view:
# Command Palette CallFlow: Show Flamegraph
Same view you'd get from a production APM tool, for your local code, with zero setup.
Auto-Trace on Save
For active development sessions, turn on automatic tracing in settings.json:
{
"callflowTracer.pythonPath": "python3",
"callflowTracer.defaultLayout": "force",
"callflowTracer.autoTrace": true,
"callflowTracer.enableProfiling": true,
"callflowTracer.anomalyThreshold": 2.0,
"callflowTracer.autoInstrumentation": true
}
Every save triggers a fresh trace. Instant feedback on how your changes affect call graphs and execution times.
Using It from Code
from callflow_tracer import trace_scope with trace_scope() as graph: your_function() # Export for VS Code visualization later graph.export("trace.json")
Real Scenarios Where This Shines
Legacy Codebase Onboarding
Open the main entry point, run the trace, instantly get a map of what calls what. No more reading bottom-up trying to piece together execution flow mentally.
Slow API Endpoint
Trace the handler, open the flamegraph, find the wide red bar. No more guessing which of your twelve database calls is the problem.
Async Code Debugging
Timeline layout shows concurrent coroutine execution across time. Identify sequential await patterns that should be parallelized.
Code Review Aid
Trace the PR code, export as PNG, attach to your review comment. "This function gets called 47 times per request" lands harder than a text comment.
Production Debugging
Reproduce locally, trace, export to OTel, compare against production traces. Correlation between local and production is often surprisingly close.
How It Compares
| Tool | Visualization | Interactive | Async | OTel Export | Jaeger | VS Code |
|---|---|---|---|---|---|---|
| CallFlow Tracer | ✅ Yes | ✅ Yes | ✅ Full | ✅ Yes | ⚙️ Soon | ✅ Native |
| cProfile | ❌ Text | ❌ No | ⚠️ Limited | ❌ No | ❌ No | ❌ No |
| py-spy | ⚠️ Flame | ⚠️ CLI | ✅ Yes | ❌ No | ❌ No | ❌ No |
| PyInstrument | ⚠️ Flame | ❌ No | ✅ Yes | ❌ No | ❌ No | ❌ No |
| Jaeger Client | ❌ None | ❌ No | ✅ Yes | ✅ Yes | ✅ Native | ❌ No |