TriageProf is a modular profiling and bottleneck-analysis tool for Go applications. It collects pprof profiles from a live service, runs deterministic analysis, then enriches findings with Mistral AI to explain why things are slow and exactly what to fix — producing a beautiful, self-contained HTML report.
# Clone the repository
git clone https://github.com/lsanarchist/Mistral-Hackathon.git
cd Mistral-Hackathon
# Build the binary and plugins (single step)
make build
# List available plugins
./bin/triageprof plugins# Profile a live Go service and get an AI-powered report
export MISTRAL_API_KEY="your-key-here"
./bin/triageprof run \
--plugin go-pprof-http \
--target-url http://localhost:6060 \
--duration 15 \
--outdir ./analysis \
--llm
# After the run, triageprof will offer to open the report in your browser automatically- 🔍 Comprehensive Profiling: CPU, heap, allocation, block, and mutex profiling
- 🤖 Deterministic Analysis: 8+ rule-based patterns, no LLM required for findings
- 🧠 Mistral AI Enrichment:
mistral-large-latestexplains root causes, suggests fixes, estimates effort - 📊 Self-contained HTML Report: Interactive dark-theme report — charts, hotspot bars, per-finding AI cards
- 🌐 Auto Browser Serve: After each run, offers to serve the report and open it in your browser
- 🔌 Plugin Architecture: Extensible via JSON-RPC plugin SDK
- CPU Hotpath Dominance: Detects functions consuming CPU time
- Allocation Churn: Identifies high mallocgc/memmove patterns
- JSON Hotspots: Finds encoding/json bottlenecks
- String Churn: Analyzes strings.Builder/bytes.Buffer usage
- GC Pressure: Measures runtime.gcBgMarkWorker impact
- Mutex Contention: Detects sync.(*Mutex).Lock issues
- Heap Allocation: Identifies memory allocation hotspots
- Block Contention: Analyzes runtime.chan/select patterns
- Score gauge — overall health at a glance
- Severity breakdown — donut chart + filter by critical / high / medium / low
- AI Executive Summary — Mistral's verdict with confidence score and key themes
- Top Risks — what will blow up under load
- Recommendations — prioritized actions with effort, complexity, code examples, validation metrics
- Per-finding AI cards — root causes ↔ suggestions, next measurements ↔ caveats, before/after metrics
export MISTRAL_API_KEY="your-api-key"
./bin/triageprof run \
--plugin go-pprof-http \
--target-url http://localhost:6060 \
--outdir ./analysis \
--llm \
--llm-model mistral-large-latest \
--llm-timeout 90| Flag | Default | Description |
|---|---|---|
--llm |
off | Enable Mistral AI enrichment |
--llm-model |
mistral-large-latest |
Model to use |
--llm-provider |
mistral |
mistral or openai |
--llm-timeout |
20 |
API timeout in seconds |
# Full pipeline: collect → analyze → AI enrich → HTML report
./bin/triageprof run --plugin go-pprof-http --target-url <url> --outdir <dir> [--llm]
# Just collect profiles into a bundle
./bin/triageprof collect --plugin go-pprof-http --target-url <url> --out bundle.json
# Analyze an existing bundle
./bin/triageprof analyze --in bundle.json --out findings.json
# Generate LLM insights from findings
./bin/triageprof llm --bundle bundle.json --findings findings.json --out insights.json
# List plugins
./bin/triageprof pluginsanalysis/
├── report.html # Self-contained interactive HTML report (~300KB)
├── index.html # Alias for report.html (same content)
├── findings.json # Structured performance findings
├── insights.json # Mistral AI analysis (if --llm enabled)
├── report.md # Markdown report
└── bundle.json # Raw collected profiles bundle
Profilers are separate executables communicating via JSON-RPC over stdio. The go-pprof-http plugin is included and works out of the box for any Go service with net/http/pprof enabled.
# List available plugins
./bin/triageprof plugins list
# Your service just needs this import:
import _ "net/http/pprof"See API Documentation for the plugin development guide.
- User Guide: Complete usage guide with examples
- CLI Reference: Detailed command reference
- API Documentation: Plugin SDK and JSON-RPC API
- Contributing Guide: Development and contribution guidelines
- Issues: Report bugs and request features
- Pull Requests: Contributions welcome!
See CONTRIBUTING.md for guidelines.
TriageProf is licensed under the MIT License.
TriageProf — built for the Mistral AI Hackathon 🚀