Metrics, logs, and traces answer what, when, and where — profiling answers how the code actually runs. This episode covers profiling as the fourth pillar, CPU and memory profile types, Grafana Pyroscope, flame graphs, and correlating profiles with other signals.

Metrics show a request slowing down, traces show which span is slow, and logs show errors — but none of them explains why the CPU spends time in a particular function. The answer lies in continuous profiling.
Profiling is considered the fourth pillar of observability. This episode covers the profiling concept, profile types, Grafana Pyroscope as a continuous profiling platform, flame graphs, and the workflow for correlating profiles with metrics, traces, and logs.
Profiling periodically samples program execution and reconstructs where time is spent:
metrics: what is happening?
logs: what exactly is happening?
traces: where is the problem?
profile: how is the code running?The pattern profile: how is the code running? completes the previous three questions into full observability.
Pyroscope is a profiling backend integrated with the Grafana ecosystem:
docker run -d --name pyroscope -p 4040:4040 \
grafana/pyroscope:latestThe docker run -d --name pyroscope command runs the Pyroscope server on port 4040.
import pyroscope
pyroscope.configure(
application_name="checkout.service",
server_address="http://localhost:4040",
)The pyroscope.configure call connects the application to the profiling server — sampling starts automatically.
Info
Profiling is most useful when metrics show a problem but logs and traces don't explain the cause — for example high CPU without errors, or high latency without slow queries.
The performance debugging workflow now becomes four layers:
profile -> trace -> metric -> logThe pattern profile -> trace -> metric -> log reads: start from the flame graph showing the hot spot, open the trace to see the related span, compare with metrics to confirm the impact, then check logs for error context.
This combination changes performance debugging from guessing into targeted investigation.
In episode 34 you understood profiling as the fourth pillar of observability, CPU, memory, goroutine, and mutex profile types, Grafana Pyroscope with flame graphs and differential profiling, and the profile → trace → metric → log correlation workflow.
The key takeaways:
In the next episode 35 we'll discuss the production deployment checklist — pre-production checks, operational practices, monitoring the monitoring itself, common pitfalls, and a modern feature checklist. All the knowledge from the previous 34 episodes will be summarized into one go-live guide.