1. Introduction to continuous profiling #
Continuous profiling with Pyroscope.
The fourth signal #
Available in: ✓ OSS ✓ Enterprise ✓ Cloud
Metrics say that the service consumes too much, traces say where the request loses time, and profiles say which function is responsible. A profile samples what the program does: call stack on the CPU, memory allocations, goroutines.
| Signal | Question | Example answer |
|---|---|---|
| Metric | Is there a problem? | CPU at 90% |
| Trace | Which step is slow? | Cart calculation: 800 ms |
| Profile | Which line of code? | calculTVA(): 60% of CPU |
Why “continuous”? #
Classic profiling is started by hand once the problem is spotted, and it is often too late to reproduce it. Continuous profiling records all the time, with low overhead. You can then compare yesterday's version with today's, or examine an incident from last night.
Profile types #
| Type | Measures | To find |
|---|---|---|
| CPU | Time spent per function | Expensive computations, loops |
| Memory (allocations) | What gets allocated | Garbage collector pressure |
| Memory (in use) | What stays in memory | Leaks |
| Goroutines, threads | Count and stacks | Deadlocks, goroutine leaks |
| Mutex, block | Waiting time | Contention |
Reading a flame graph #
Pyroscope displays profiles as a flame graph: each rectangle is a function, its width shows its share of the total. Look for wide rectangles: those are the ones to optimize. The horizontal axis is not time.
Pyroscope is the successor to Grafana Phlare. See the dedicated Grafana Pyroscope course to go further.
My progress
Sign in to track your progress and take notes. Sign in
💬 Recent discussions about this course
- Alloy : recevoir de l'OTLP et l'envoyer vers Tempo et Mimir✓ solved · 1 reply(ies)
Ask a question about this lesson →See all discussions about this course
Course Glossary
Grafana Alloy
An open-source, vendor-neutral telemetry collector designed to replace Grafana Agent, fully compatible with OpenTelemetry (OTel).
Recommended Articles
Continuous profiling with Grafana Pyroscope: why and how
The fourth signal of observability: what continuous profiling is, profile types (CPU, memory, loc...
Profiles, OpenTelemetry's fourth signal: continuous profiling and correlation with traces
Understand OpenTelemetry's new profile signal: continuous profiling, flame graphs, data model and...
Continuous profiling with eBPF: Parca, Pyroscope and the OpenTelemetry profiler
Continuously profile every process on a host with eBPF: principle, Parca and parca-agent, Pyrosco...
Grafana Pyroscope best practices: collection, labels, analysis and costs
Production checklist for continuous profiling with Pyroscope: choosing the collection mode, label...
Linking traces and profiles: span profiles with Tempo and Pyroscope
Go from a slow trace to the exact CPU profile of that span: span profiles in Go and Java, configu...
Grafana Alloy: The importance of Self-Monitoring
Discover why and how to configure Grafana Alloy so that it monitors itself, collecting its own lo...
The LGTM stack (Loki, Grafana, Tempo, Mimir): architecture and setup
Grafana Labs' LGTM stack: Loki for logs, Grafana for visualization, Tempo for traces, Mimir for m...
Grafana Alloy: collecting system metrics and local logs
Learn how to configure Grafana Alloy to monitor the server it runs on, with a focus on configurat...
Grafana Alloy: collecting and transforming telemetry
Learn how to use Grafana Alloy to collect, transform and route logs, metrics and traces. Discover...