Skip to main content

Generate flamecharts and error graphs from python stacktraces

Project description

pystackflame

Generate flamecharts from Python stacktraces in logs

pystackflame is a command-line tool that parses Python logs for stack traces and turns them into flamecharts or weighed graphs for performance analysis, visualization, and debugging.


Features

  • Generate FlameGraph-compatible output
  • Pickle rustworkx-based graphs
  • Build weighted execution graphs from logs using rustworkx
  • Python 3.14+ support
  • Fast and lightweight CLI built with click
  • Developer-friendly with optional linting via ruff

Installation

We recommend using uv for fast dependency management:

uv sync -p 3.14
source .venv/bin/activate
pystackflame --help

Possible applications

Web Service Error Hotspots

Aggregate Python exceptions in your web server (e.g. Flask/FastAPI/Django) logs to quickly pinpoint which request-handling paths are failing most often without any need of restarting your application.

pystackflame flame /var/log/myapp/**/*.log -o web_errors.flame

Analysis of the historical data

Identify problematic places in the codebase that require the most attention.

pystackflame flame /var/log/all_logs_we_have/**/*.log -o errors.flame
./flamegraph.pl errors.flame > example.svg

Performance Regression Detection in CI

As part of your GitHub Actions or GitLab CI pipeline, run against the previous and current test logs to compare flamecharts—spot new slow-paths introduced by recent commits.

pystackflame flame old_tests.log -o baseline.flame
pystackflame flame new_tests.log -o current.flame

Visualize of diff the two SVGs or flame files to analyze regressions

Batch-Job Profiling

For long-running data-processing jobs (ETL, ML training, batch analytics), collect stacktraces on failure or periodically dump traces, then visualize the cumulative “hot” stacks to optimize slow stages.

pystackflame flame /logs/batch_job_*.log -o batch_profile.flame

Chaos-Engineering Fault Analysis

During fault-injection experiments, collect and compare flamecharts from healthy vs. faulted runs to understand how injected errors propagate.

pystackflame flame healthy.log -o healthy.flame
pystackflame flame chaos.log   -o chaos.flame

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pystackflame-0.1.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pystackflame-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file pystackflame-0.1.0.tar.gz.

File metadata

  • Download URL: pystackflame-0.1.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for pystackflame-0.1.0.tar.gz
Algorithm Hash digest
SHA256 638d9c0698fc9f97c8b153b536573720eae0e304170ade4bef223eb15daf4c68
MD5 e33e6c91033469a650d52ad03a24befa
BLAKE2b-256 55af76f774c2488d2c8dcd5a3b812de46a494a05172c028e839151ed2d94fc56

See more details on using hashes here.

File details

Details for the file pystackflame-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pystackflame-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9f3cfffa81a66bd90a14e3e780fdacb716e1e0e49b764f961e1dfda7ab889ae
MD5 eb0faf067fd0fc1fc0c9bea66de143af
BLAKE2b-256 e336f963b5788b78bdce4d7c0141eed058fcbeb1fdb52cf86b71f4ec16d854fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page