Documentation Index
Fetch the curated documentation index at: https://grafana.com/llms.txt
Fetch the complete documentation index at: https://grafana.com/llms-full.txt
Use this file to discover all available pages before exploring further.
STOP! If you are an AI agent or LLM, read this before continuing. This is the HTML version of a Grafana documentation page. Always request the Markdown version instead - HTML wastes context. Get this page as Markdown: https://grafana.com/docs/grafana-cloud/connect-externally-hosted/data-sources/pyroscope/profiling-and-tracing.md (append .md) or send Accept: text/markdown to https://grafana.com/docs/grafana-cloud/connect-externally-hosted/data-sources/pyroscope/profiling-and-tracing/. For the curated documentation index, use https://grafana.com/llms.txt. For the complete documentation index, use https://grafana.com/llms-full.txt.
How profiling and tracing work together
Profiles, continuous profiling, and distributed traces are all tools that can be used to improve the performance and reliability of applications. However, each tool has its own strengths and weaknesses, and it is important to choose the right tool for the job as well as understand when to use both.
Profiling
Profiling offers a deep-dive into an application’s performance at the code level, highlighting resource usage and performance hotspots.
| Usage | During development, major releases, or upon noticing performance quirks. |
|---|---|
| Benefits |
|
| Example | A developer uses profiling upon noting slow app performance, identifies a CPU-heavy function, and optimizes it. |
Continuous profiling
Continuous profiling provides ongoing performance insights, capturing long-term trends and intermittent issues.
| Usage | Mainly in production, especially for high-priority applications. |
|---|---|
| Benefits |
|
| Example | A month-long data from continuous profiling suggests increasing memory consumption, hinting at a memory leak. |
Distributed tracing
Traces requests as they cross multiple services, revealing interactions and service dependencies.
| Usage | Essential for systems like microservices where requests touch multiple services. |
|---|---|
| Benefits |
|
| Example | In e-commerce, a user's checkout request might involve various services. Tracing depicts this route, pinpointing where time is most spent. |
Combined power of tracing and profiling
When used together, tracing and profiling provide a powerful tool for understanding system and application performance.
| Usage | For comprehensive system-to-code insights, especially when diagnosing complex issues spread across services and codebases. |
|---|---|
| Benefits |
|
| Example | Tracing reveals latency in a payment service. Combined with profiling, it's found that a particular function, making third-party validation calls, is the culprit. This insight guides optimization, refining system efficiency. |
Was this page helpful?
Related resources from Grafana Labs


