Monitoring glossary
What is a flame graph?
A flame graph shows where a program spends CPU time. Wide boxes are expensive; the widest box at the top of a tower is usually the function to optimize.
3 min read8 sectionsUpdated
On this page
How it is built
A profiler samples the call stack many times per second. Identical stacks are merged; each function becomes a box whose width is proportional to how often it appeared in samples. Boxes are stacked so each sits on top of the function that called it. Colour usually has no meaning beyond distinguishing boxes.
Reading one
- Find wide boxes near the top of each tower: functions that are on CPU themselves.
- Follow down to see which caller paths lead there.
- Ignore order left to right: boxes are sorted alphabetically or by frame, not by time.
- Compare before and after a change; differential flame graphs colour what grew or shrank.
Flame graphs and traces
A trace waterfall looks similar but shows one request over wall-clock time, including waiting on databases and other services. A CPU flame graph aggregates many samples and shows only where CPU was spent. Use traces to find which endpoint and which call is slow, then a profile when the time is in your own code. VitalRix APM provides traces; profiling uses your runtime's own tools as above.
Related reading
- How to monitor DigitalOcean: How to monitor apps on DigitalOcean: droplet CPU, memory and disk, App Platform services, managed databases, load balancers, uptime checks and alerts.
- Python performance monitoring: Monitor Python web apps: request latency per route, worker saturation, the GIL and CPU-bound code, database time, Celery queues and memory.
- Error: read ECONNRESET: What read ECONNRESET means, common causes such as keep-alive timeout mismatches, proxies and crashing servers, how to find which side reset, and safe retries.
- Kubernetes pod stuck in Pending: how to fix it: Fix Kubernetes pods stuck in Pending: insufficient CPU or memory, taints, node selectors and unbound PersistentVolumeClaims, using scheduler events.
- Python memory usage: find what uses memory: Measure and reduce Python memory usage: RSS vs allocated objects, tracemalloc snapshots, finding leaks in long-running workers.
- Infrastructure monitoring: See every host, container and pod on a map coloured by CPU, memory or disk. Drill into Kubernetes, alert on CPU and memory, and start with a one-file agent.
Watch your own site and services with VitalRix
Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.