<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Introduction on Grafana Labs</title><link>https://grafana.com/docs/pyroscope/v1.4.x/introduction/</link><description>Recent content in Introduction on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/pyroscope/v1.4.x/introduction/index.xml" rel="self" type="application/rss+xml"/><item><title>Profiling fundamentals</title><link>https://grafana.com/docs/pyroscope/v1.4.x/introduction/profiling/</link><pubDate>Wed, 07 Feb 2024 18:32:03 +0000</pubDate><guid>https://grafana.com/docs/pyroscope/v1.4.x/introduction/profiling/</guid><content><![CDATA[&lt;h1 id=&#34;profiling-fundamentals&#34;&gt;Profiling fundamentals&lt;/h1&gt;
&lt;p&gt;Profiling is a technique used in software development to measure and analyze the runtime behavior of a program.
By profiling a program, developers can identify which parts of the program consume the most resources, such as CPU time, memory, or I/O operations.
This information can then be used to optimize the program, making it run faster or use fewer resources.&lt;/p&gt;
&lt;p&gt;Pyroscope can be used for both traditional and continuous profiling.&lt;/p&gt;
&lt;h2 id=&#34;traditional-profiling-non-continuous&#34;&gt;Traditional profiling (non-continuous)&lt;/h2&gt;
&lt;p&gt;Traditional profiling, often referred to as &amp;ldquo;sample-based&amp;rdquo; or &amp;ldquo;instrumentation-based&amp;rdquo; profiling, has its roots in the early days of computing. Back then, the primary challenge was understanding how a program utilized the limited computational resources available.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Sample-based profiling&lt;/strong&gt;: In this method, the profiler interrupts the program at regular intervals, capturing the program&amp;rsquo;s state each time. By analyzing these snapshots, developers can deduce the frequency at which parts of the code execute.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Instrumentation-based profiling&lt;/strong&gt;: Here, developers insert additional code into the program that records information about its execution. This approach provides detailed insights but can alter the program&amp;rsquo;s behavior due to the added code overhead.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;benefits&#34;&gt;Benefits&lt;/h3&gt;
&lt;p&gt;Traditional profiling provides:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Precision&lt;/strong&gt;: Offers a deep dive into specific sections of the code.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Control&lt;/strong&gt;: Developers can initiate profiling sessions at their discretion, allowing for targeted optimization efforts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Detailed reports&lt;/strong&gt;: Provides granular data about program execution, making it easier to pinpoint bottlenecks.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;continuous-profiling&#34;&gt;Continuous profiling&lt;/h2&gt;
&lt;p&gt;As software systems grew in complexity and scale, the limitations of traditional profiling became evident. Issues could arise in production that weren&amp;rsquo;t apparent during limited profiling sessions in the development or staging environments.&lt;/p&gt;
&lt;p&gt;This led to the development of continuous profiling, a method where the profiling data is continuously collected in the background with minimal overhead. By doing so, developers gain a more comprehensive view of a program&amp;rsquo;s behavior over time, helping to identify sporadic or long-term performance issues.&lt;/p&gt;
&lt;h3 id=&#34;benefits-1&#34;&gt;Benefits&lt;/h3&gt;
&lt;p&gt;Continuous profiling provides:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Consistent monitoring&lt;/strong&gt;: Unlike traditional methods that offer snapshots, continuous profiling maintains an uninterrupted view, exposing both immediate and long-term performance issues.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Proactive bottleneck detection&lt;/strong&gt;: By consistently capturing data, performance bottlenecks are identified and addressed before they escalate, reducing system downtime and ensuring smoother operations.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Broad performance landscape&lt;/strong&gt;: Provides insights across various platforms, from varied technology stacks to different operating systems, ensuring comprehensive coverage.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bridging the Dev-Prod gap&lt;/strong&gt;: Continuous profiling excels in highlighting differences between development and production:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Hardware discrepancies&lt;/strong&gt;: Unearths issues stemming from differences in machine specifications.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Software inconsistencies&lt;/strong&gt;: Sheds light on variations in software components that might affect performance.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Real-world workload challenges&lt;/strong&gt;: Highlights potential pitfalls when real user interactions and loads don&amp;rsquo;t align with development simulations.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Economical advantages&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Resource optimization&lt;/strong&gt;: Continual monitoring ensures resources aren&amp;rsquo;t wasted, leading to cost savings.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rapid problem resolution&lt;/strong&gt;: Faster troubleshooting means reduced time and monetary investment in issue rectification, letting developers channel their efforts into productive endeavors.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Unintrusive operation&lt;/strong&gt;: Specifically designed to work quietly in the background, continuous profiling doesn&amp;rsquo;t compromise the performance of live environments.&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start=&#34;7&#34;&gt;
&lt;li&gt;&lt;strong&gt;Real-time response&lt;/strong&gt;: It equips teams with the ability to act instantly, addressing issues as they arise rather than post-occurrence, which is crucial for maintaining high system availability.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;how-to-choose-between-traditional-and-continuous-profiling&#34;&gt;How to choose between traditional and continuous profiling&lt;/h2&gt;
&lt;p&gt;In many modern development workflows, both methods are useful.&lt;/p&gt;
&lt;h3 id=&#34;traditional-profiling&#34;&gt;Traditional profiling&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;When&lt;/strong&gt;: During development or testing phases.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Advantages&lt;/strong&gt;: Offers detailed insights that can target specific parts of code.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Disadvantages&lt;/strong&gt;: Higher overhead provides only a snapshot in time.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;continuous-profiling-1&#34;&gt;Continuous profiling&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;When&lt;/strong&gt;: In production environments or during extended performance tests.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Advantages&lt;/strong&gt;: Provides a continuous view of system performance, often with minimal overhead, making it suitable for live environments.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Disadvantages&lt;/strong&gt;: It might be less detailed than traditional profiling due to the need to minimize impact on the running system.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="profiling-fundamentals">Profiling fundamentals&lt;/h1>
&lt;p>Profiling is a technique used in software development to measure and analyze the runtime behavior of a program.
By profiling a program, developers can identify which parts of the program consume the most resources, such as CPU time, memory, or I/O operations.
This information can then be used to optimize the program, making it run faster or use fewer resources.&lt;/p></description></item><item><title>When to use continuous profiling</title><link>https://grafana.com/docs/pyroscope/v1.4.x/introduction/continuous-profiling/</link><pubDate>Mon, 17 Mar 2025 08:44:48 +0100</pubDate><guid>https://grafana.com/docs/pyroscope/v1.4.x/introduction/continuous-profiling/</guid><content><![CDATA[&lt;h2 id=&#34;when-to-use-continuous-profiling&#34;&gt;When to use continuous profiling&lt;/h2&gt;
&lt;p&gt;Continuous profiling is a systematic method of collecting and analyzing performance data from production systems.&lt;/p&gt;
&lt;p&gt;Traditionally, profiling is used as an ad-hoc debugging tool in languages like Go and Java.
You are probably used to running a benchmark tool locally and getting a pprof file in Go or maybe connecting into a misbehaving prod instance and pulling a flamegraph from a JFR file in Java.
This is great for debugging but not so great for production.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;https://grafana.com/static/img/pyroscope/pyroscope-ui-single-2023-11-30.png&#34;
  alt=&#34;example flamegraph&#34; width=&#34;1599&#34;
     height=&#34;836&#34;/&gt;&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;To learn more about flamegraphs, refer to &lt;a href=&#34;../../view-and-analyze-profile-data/flamegraphs/&#34;&gt;Flamegraphs: Visualizing performance data&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Continuous profiling is a modern approach which is safer and more scalable for production environments.
It uses low-overhead sampling to collect profiles from production systems and stores the profiles in a database for later analysis.
Using continuous profiling gives you a more holistic view of your application and how it behaves in production.&lt;/p&gt;
&lt;h2 id=&#34;benefits&#34;&gt;Benefits&lt;/h2&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;https://grafana.com/static/img/pyroscope/profiling-use-cases-diagram.png&#34;
  alt=&#34;Diagram showing 3 benefits of continuous profiling&#34; width=&#34;2186&#34;
     height=&#34;1224&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Why prioritize continuous profiling?&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;In-depth code insights:&lt;/strong&gt; It provides granular, line-level insights into how application code utilizes resources, offering the most detailed view of application performance.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Complements other observability tools:&lt;/strong&gt; Continuous profiling fills critical gaps left by metrics, logs, and tracing, creating a more comprehensive observability strategy.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Proactive performance optimization:&lt;/strong&gt; Regular profiling enables teams to proactively identify and resolve performance bottlenecks, leading to more efficient and reliable applications.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;use-cases&#34;&gt;Use cases&lt;/h2&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;https://grafana.com/static/img/pyroscope/cost-cutting-diagram.png&#34;
  alt=&#34;Infographic illustrating key business benefits&#34; width=&#34;2196&#34;
     height=&#34;1234&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Adopting continuous profiling with tools like Pyroscope can lead to significant business advantages:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Reduced operational costs:&lt;/strong&gt; Optimization of resource usage can significantly cut down cloud and infrastructure expenses&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reduced latency:&lt;/strong&gt; Identifying and addressing performance bottlenecks leads to faster and more efficient applications&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Enhanced incident management:&lt;/strong&gt; Faster problem identification and resolution, reducing Mean Time to Resolution (MTTR) and improving end-user experience&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;reduce-operational-costs&#34;&gt;Reduce operational costs&lt;/h3&gt;
&lt;p&gt;Pyroscope&amp;rsquo;s low-overhead profiling enables precise optimization of resource usage, directly impacting various cost centers in technology infrastructure.
By providing in-depth insights into application performance, Pyroscope allows teams to identify and eliminate inefficiencies, leading to significant savings in areas like observability, incident management, messaging/queuing, deployment tools, and infrastructure.&lt;/p&gt;
&lt;p&gt;By using sampling profilers, Pyroscope is able to collect data with minimal overhead (~2-5% depending on a few factors).
The &lt;a href=&#34;../../reference-pyroscope-architecture/about-grafana-pyroscope-architecture/&#34;&gt;custom storage engine&lt;/a&gt; compresses and stores the data efficiently.
Some advantages of this are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Low CPU overhead thanks to sampling profiler technology&lt;/li&gt;
&lt;li&gt;Control over profiling data granularity (10s to multiple years)&lt;/li&gt;
&lt;li&gt;Efficient compression, low disk space requirements and cost&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;reduced-latency&#34;&gt;Reduced latency&lt;/h3&gt;
&lt;p&gt;Pyroscope plays a pivotal role in reducing application latency by identifying performance bottlenecks at the code level.
This granular insight allows for targeted optimization, leading to faster application response times, improved user experience, and consequently, better business outcomes like increased customer satisfaction and revenue.&lt;/p&gt;
&lt;h3 id=&#34;enhanced-incident-management&#34;&gt;Enhanced incident management&lt;/h3&gt;
&lt;p&gt;Pyroscope streamlines incident management by offering immediate, actionable insights into application performance issues.
With continuous profiling, teams can quickly pinpoint the root cause of an incident, reducing the mean time to resolution (MTTR) and enhancing overall system reliability and user satisfaction.&lt;/p&gt;
]]></content><description>&lt;h2 id="when-to-use-continuous-profiling">When to use continuous profiling&lt;/h2>
&lt;p>Continuous profiling is a systematic method of collecting and analyzing performance data from production systems.&lt;/p>
&lt;p>Traditionally, profiling is used as an ad-hoc debugging tool in languages like Go and Java.
You are probably used to running a benchmark tool locally and getting a pprof file in Go or maybe connecting into a misbehaving prod instance and pulling a flamegraph from a JFR file in Java.
This is great for debugging but not so great for production.&lt;/p></description></item><item><title>Pyroscope and profiling in Grafana</title><link>https://grafana.com/docs/pyroscope/v1.4.x/introduction/pyroscope-in-grafana/</link><pubDate>Wed, 07 Feb 2024 18:32:03 +0000</pubDate><guid>https://grafana.com/docs/pyroscope/v1.4.x/introduction/pyroscope-in-grafana/</guid><content><![CDATA[&lt;!-- This is placeholder page while we get the content written.  --&gt;
&lt;h1 id=&#34;pyroscope-and-profiling-in-grafana&#34;&gt;Pyroscope and profiling in Grafana&lt;/h1&gt;
&lt;p&gt;Pyroscope can be used alongside the other Grafana tools such as Loki, Tempo, Mimir, and k6.
You can use Pyroscope to get the most granular insight into your application and how you can use it to fix issues that you may have identified via metrics, logs, traces, or anything else.&lt;/p&gt;
&lt;p&gt;You can use Pyroscope within Grafana by using the Pyroscope data source plugin.
This plugin lets you query Pyroscope data from within Grafana and visualize it alongside your other Grafana data.&lt;/p&gt;
&lt;h2 id=&#34;visualize-traces-and-profiles-data&#34;&gt;Visualize traces and profiles data&lt;/h2&gt;
&lt;p&gt;Here is a screenshot of the &lt;strong&gt;Explore&lt;/strong&gt; page where combined traces and profiles to be able to see granular line-level detail when available for a trace span. This allows you to see the exact function that&amp;rsquo;s causing a bottleneck in your application as well as a specific request.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;https://grafana.com/static/img/pyroscope/pyroscope-trace-profiler-view-2023-11-30.png&#34;
  alt=&#34;trace-profiler-view&#34; width=&#34;1421&#34;
     height=&#34;652&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;integrate-profiles-into-dashboards&#34;&gt;Integrate profiles into dashboards&lt;/h2&gt;
&lt;p&gt;Here is an example of how you can integrate profiles into your dashboards. In this case, the screenshot shows memory profiles alongside panels for logs and metrics to be able to debug OOM errors alongside the associated logs and metrics.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;https://grafana.com/static/img/pyroscope/grafana-pyroscope-dashboard-2023-11-30.png&#34;
  alt=&#34;dashboard&#34; width=&#34;1919&#34;
     height=&#34;936&#34;/&gt;&lt;/p&gt;
]]></content><description>&lt;!-- This is placeholder page while we get the content written. -->
&lt;h1 id="pyroscope-and-profiling-in-grafana">Pyroscope and profiling in Grafana&lt;/h1>
&lt;p>Pyroscope can be used alongside the other Grafana tools such as Loki, Tempo, Mimir, and k6.
You can use Pyroscope to get the most granular insight into your application and how you can use it to fix issues that you may have identified via metrics, logs, traces, or anything else.&lt;/p></description></item></channel></rss>