diff --git a/docs/sources/configure-client/grafana-agent/_index.md b/docs/sources/configure-client/grafana-agent/_index.md index 94e8eedb08..245e822990 100644 --- a/docs/sources/configure-client/grafana-agent/_index.md +++ b/docs/sources/configure-client/grafana-agent/_index.md @@ -9,11 +9,16 @@ aliases: # Grafana Agent +{{< docs/shared lookup="agent-deprecation.md" source="alloy" version="next" >}} + Grafana Agent is a powerful tool for collecting and forwarding profiling data. With the introduction of support for eBPF and continuing support for Golang in pull mode, Grafana Agent has become even more versatile in its capabilities. This document provides an overview of these two modes of profiling and guides users on setting them up. -{{< docs/shared lookup="agent-deprecation.md" source="alloy" version="next" >}} +{{< admonition type="note" >}} +Refer to [Available profiling types]({{< relref "../../view-and-analyze-profile-data/profiling-types#available-profiling-types" >}}) for a list of profile types supported. +{{< /admonition >}} + ## eBPF profiling with Grafana Agent @@ -28,9 +33,9 @@ Benefits of eBPF profiling: ### Set up eBPF profiling with Grafana Agent 1. Ensure your system runs a Linux kernel version 4.9 or newer. -1. Install Grafana Agent or Grafana Alloy on the target machine or container. -1. Configure the agent to use eBPF for profiling. Refer to the [eBPF documentation](/docs/pyroscope/latest/configure-client/grafana-agent/ebpf) for detailed steps. -1. After it's configured, the agent starts collecting eBPF profiles and sends them to the Pyroscope server. +1. Install Grafana Agent on the target machine or container. +1. Configure the Agent to use eBPF for profiling. Refer to the [eBPF documentation](/docs/pyroscope/latest/configure-client/grafana-agent/ebpf) for detailed steps. +1. The Agent collects eBPF profiles and sends them to the Pyroscope server. ## Golang profiling in pull mode with Grafana Agent @@ -45,11 +50,11 @@ In pull mode, Grafana Agent periodically retrieves profiles from Golang applicat ### Set up Golang profiling in pull mode 1. Ensure your Golang application exposes pprof endpoints. -2. Install and configure Grafana Agent on the same machine or container where your application runs. -3. Ensure the agent is set to pull mode and targeting the correct pprof endpoints. For step-by-step instructions, visit the [Go (Pull Mode)](/docs/pyroscope/latest/configure-client/grafana-agent/go_pull) docs. -4. The agent starta querying the pprof endpoints of your Golang application, collecting the profiles, and forwarding them to the Pyroscope server. +1. Install and configure the Grafana Agent on the same machine or container where your application runs. +1. Ensure the Agent is set to pull mode and targeting the correct pprof endpoints. For step-by-step instructions, visit the [Go (Pull Mode)](/docs/pyroscope/latest/configure-client/grafana-agent/go_pull) docs. +1. The Agent queries the pprof endpoints of your Golang application, collects the profiles, and forwards them to the Pyroscope server. ## Next steps -Whether using eBPF for versatile system and application profiling or relying on Golang's built-in pprof endpoints in pull mode, Grafana Agent and Grafana Alloy offer a streamlined process to gather essential profiling data. Choose the method that best fits your application and infrastructure needs. - +Whether using eBPF for versatile system and application profiling or relying on Golang's built-in pprof endpoints in pull mode, Grafana Agent and Grafana Alloy offer streamlined processes to gather essential profiling data. +Choose the method that best fits your application and infrastructure needs. diff --git a/docs/sources/configure-client/grafana-agent/ebpf/configuration/_index.md b/docs/sources/configure-client/grafana-agent/ebpf/configuration/_index.md index 1375757bef..44fb1654dd 100644 --- a/docs/sources/configure-client/grafana-agent/ebpf/configuration/_index.md +++ b/docs/sources/configure-client/grafana-agent/ebpf/configuration/_index.md @@ -6,7 +6,7 @@ weight: 30 --- -## Configuration +## Configuration reference Grafana Agent supports eBPF profiling in [Flow mode](/docs/agent/latest/flow/). The configuration file is written in the [River](/docs/agent/latest/flow/config-language/) language and is composed of components that are used to collect, transform, and send data. diff --git a/docs/sources/configure-client/language-sdks/_index.md b/docs/sources/configure-client/language-sdks/_index.md index a48ef66cf5..5b35e432d5 100644 --- a/docs/sources/configure-client/language-sdks/_index.md +++ b/docs/sources/configure-client/language-sdks/_index.md @@ -58,5 +58,9 @@ The following languages SDKs provide support for sending profiles from your appl -If you're interested in integrating other ecosystems, please reach out to us on [github](https://github.com/grafana/pyroscope/). +{{< admonition type="note" >}} +Refer to [Available profiling types]({{< relref "../../view-and-analyze-profile-data/profiling-types#available-profiling-types" >}}) for a list of profile types supported by each language. +{{< /admonition >}} + +If you're interested in integrating other ecosystems, reach out to us on [GitHub](https://github.com/grafana/pyroscope/). diff --git a/docs/sources/configure-client/language-sdks/dotnet.md b/docs/sources/configure-client/language-sdks/dotnet.md index dfd23298c4..6b7b68313c 100644 --- a/docs/sources/configure-client/language-sdks/dotnet.md +++ b/docs/sources/configure-client/language-sdks/dotnet.md @@ -11,7 +11,11 @@ aliases: Our .NET Profiler is a powerful tool designed to enhance the performance analysis and optimization of .NET applications. It seamlessly integrates with Pyroscope, offering real-time insights into the resource usage and bottlenecks within your .NET codebase. This integration empowers developers to pinpoint inefficiencies, improve application speed, and ensure resource-efficient operation. -### Supported profiling types +{{< admonition type="note" >}} +Refer to [Available profiling types]({{< relref "../../view-and-analyze-profile-data/profiling-types#available-profiling-types" >}}) for a list of profile types supported by each language. +{{< /admonition >}} + +## Supported profiling types The .NET Profiler supports the following profiling types: diff --git a/docs/sources/configure-client/language-sdks/go_push.md b/docs/sources/configure-client/language-sdks/go_push.md index b0516cf977..5d836c4305 100644 --- a/docs/sources/configure-client/language-sdks/go_push.md +++ b/docs/sources/configure-client/language-sdks/go_push.md @@ -13,7 +13,12 @@ Our Go Profiler is a cutting-edge tool designed to optimize Golang applications. By integrating with Pyroscope, the profiler offers developers an in-depth view of their Go codebase, enabling real-time performance analysis. This powerful tool is crucial for pinpointing inefficiencies, streamlining code execution, and ensuring peak performance in Go applications. -Pyroscope uses the standard `runtime/pprof` package to collect profiling data. Refer to [the official documentation](https://golang.org/doc/diagnostics#profiling) for details. +Pyroscope uses the standard `runtime/pprof` package to collect profiling data. +Refer to [the official documentation](https://golang.org/doc/diagnostics#profiling) for details. + +{{< admonition type="note" >}} +Refer to [Available profiling types]({{< relref "../../view-and-analyze-profile-data/profiling-types#available-profiling-types" >}}) for a list of profile types supported by Go. +{{< /admonition >}} ## Before you begin diff --git a/docs/sources/configure-client/language-sdks/java.md b/docs/sources/configure-client/language-sdks/java.md index 6198998654..df28cbc2db 100644 --- a/docs/sources/configure-client/language-sdks/java.md +++ b/docs/sources/configure-client/language-sdks/java.md @@ -9,8 +9,13 @@ aliases: # Java -The Java Profiler, integrated with Pyroscope, offers a comprehensive solution for performance analysis in Java applications. It provides real-time insights, enabling developers to understand and optimize their Java codebase effectively. This tool is crucial for improving application responsiveness, reducing resource consumption, and ensuring top-notch performance in Java environments. +The Java Profiler, integrated with Pyroscope, offers a comprehensive solution for performance analysis in Java applications. +It provides real-time insights, enabling developers to understand and optimize their Java codebase effectively. +This tool is crucial for improving application responsiveness, reducing resource consumption, and ensuring top-notch performance in Java environments. +{{< admonition type="note" >}} +Refer to [Available profiling types]({{< relref "../../view-and-analyze-profile-data/profiling-types#available-profiling-types" >}}) for a list of profile types supported by each language. +{{< /admonition >}} ## Before you begin @@ -28,7 +33,7 @@ Supported platforms include: * MacOS on x64 * MacOS on ARM64 -Visit our GitHub [releases](https://github.com/pyroscope-io/pyroscope-java/releases) page to download the latest version of `pyroscope.jar`. +Visit the GitHub [releases](https://github.com/pyroscope-io/pyroscope-java/releases) page to download the latest version of `pyroscope.jar`. The latest release is also available on [Maven Central](https://search.maven.org/artifact/io.pyroscope/agent). @@ -207,6 +212,26 @@ If you need to send data to Grafana Cloud, you'll have to configure HTTP Basic a If your Pyroscope server has multi-tenancy enabled, you'll need to configure a tenant ID. Replace `` with your Pyroscope tenant ID. +#### Example configurations + +The following configuration sets application name, Pyroscope format, profiling interval, event, and lock. +This example is an excerpt from the [`rideshare` Dockerfile](https://github.com/grafana/pyroscope/blob/main/examples/language-sdk-instrumentation/java/rideshare/Dockerfile#L24-L34) available in the Pyroscope repository. + +``` +ENV PYROSCOPE_APPLICATION_NAME=rideshare.java.push.app +ENV PYROSCOPE_FORMAT=jfr +ENV PYROSCOPE_PROFILING_INTERVAL=10ms +ENV PYROSCOPE_PROFILER_EVENT=itimer +ENV PYROSCOPE_PROFILER_LOCK=10ms +``` + +This configuration excerpt enables allocation and lock profiling: + +``` +PYROSCOPE_PROFILER_ALLOC=512k +PYROSCOPE_PROFILER_LOCK=10ms +``` + ## Java profiling examples Check out the following resources to learn more about Java profiling: diff --git a/docs/sources/configure-client/language-sdks/nodejs.md b/docs/sources/configure-client/language-sdks/nodejs.md index 60904cc3f4..6d48970afc 100644 --- a/docs/sources/configure-client/language-sdks/nodejs.md +++ b/docs/sources/configure-client/language-sdks/nodejs.md @@ -11,6 +11,10 @@ aliases: Enhance your Node.js application's performance with our Node.js Profiler. Seamlessly integrated with Pyroscope, it provides real-time insights into your application’s operation, helping you identify and resolve performance bottlenecks. This integration is key for Node.js developers aiming to boost efficiency, reduce latency, and maintain optimal application performance. +{{< admonition type="note" >}} +Refer to [Available profiling types]({{< relref "../../view-and-analyze-profile-data/profiling-types#available-profiling-types" >}}) for a list of profile types supported by each language. +{{< /admonition >}} + ## Before you begin To capture and analyze profiling data, you need either a hosted Pyroscope OSS server or a hosted [Pyroscope instance with Grafana Cloud Profiles](/products/cloud/profiles-for-continuous-profiling/) (requires a free Grafana Cloud account). diff --git a/docs/sources/configure-client/language-sdks/python.md b/docs/sources/configure-client/language-sdks/python.md index 98cc4ab621..decb08134b 100644 --- a/docs/sources/configure-client/language-sdks/python.md +++ b/docs/sources/configure-client/language-sdks/python.md @@ -9,7 +9,13 @@ aliases: # Python -Our Python Profiler, when integrated with Pyroscope, transforms the way you analyze and optimize Python applications. This combination provides unparalleled real-time insights into your Python codebase, allowing for precise identification of performance issues. It is an essential tool for Python developers focused on enhancing code efficiency and application speed. +The Python profiler, when integrated with Pyroscope, transforms the way you analyze and optimize Python applications. +This combination provides unparalleled real-time insights into your Python codebase, allowing for precise identification of performance issues +It's an essential tool for Python developers focused on enhancing code efficiency and application speed. + +{{< admonition type="note" >}} +Refer to [Available profiling types]({{< relref "../../view-and-analyze-profile-data/profiling-types#available-profiling-types" >}}) for a list of profile types supported by each language. +{{< /admonition >}} ## Before you begin diff --git a/docs/sources/configure-client/language-sdks/ruby.md b/docs/sources/configure-client/language-sdks/ruby.md index 9c045d0519..ed3c51b27c 100644 --- a/docs/sources/configure-client/language-sdks/ruby.md +++ b/docs/sources/configure-client/language-sdks/ruby.md @@ -9,7 +9,13 @@ aliases: # Ruby -The Ruby Profiler revolutionizes performance tuning in Ruby applications. Integrated with Pyroscope, it offers real-time performance data, allowing developers to delve deep into their Ruby codebase. This tool is essential for identifying performance issues, optimizing code efficiency, and enhancing the overall speed and reliability of Ruby applications. +The Ruby Profiler revolutionizes performance tuning in Ruby applications. +Integrated with Pyroscope, it offers real-time performance data, allowing developers to delve deep into their Ruby codebase. +This tool is essential for identifying performance issues, optimizing code efficiency, and enhancing the overall speed and reliability of Ruby applications. + +{{< admonition type="note" >}} +Refer to [Available profiling types]({{< relref "../../view-and-analyze-profile-data/profiling-types#available-profiling-types" >}}) for a list of profile types supported by Ruby. +{{< /admonition >}} ## Before you begin diff --git a/docs/sources/configure-client/language-sdks/rust.md b/docs/sources/configure-client/language-sdks/rust.md index b188d73942..ec4af02d69 100644 --- a/docs/sources/configure-client/language-sdks/rust.md +++ b/docs/sources/configure-client/language-sdks/rust.md @@ -9,7 +9,13 @@ aliases: # Rust -Optimize your Rust applications with our advanced Rust Profiler. In collaboration with Pyroscope, it offers real-time profiling capabilities, shedding light on the intricacies of your Rust codebase. This integration is invaluable for developers seeking to enhance performance, reduce resource usage, and achieve efficient code execution in Rust applications. +Optimize your Rust applications with our advanced Rust Profiler. +In collaboration with Pyroscope, it offers real-time profiling capabilities, shedding light on the intricacies of your Rust codebase. +This integration is invaluable for developers seeking to enhance performance, reduce resource usage, and achieve efficient code execution in Rust applications. + +{{< admonition type="note" >}} +Refer to [Available profiling types]({{< relref "../../view-and-analyze-profile-data/profiling-types#available-profiling-types" >}}) for a list of profile types supported by Rust. +{{< /admonition >}} ## Before you begin diff --git a/docs/sources/view-and-analyze-profile-data/profiling-types/_index.md b/docs/sources/view-and-analyze-profile-data/profiling-types/_index.md index 66d4d3c03c..97e36b016e 100644 --- a/docs/sources/view-and-analyze-profile-data/profiling-types/_index.md +++ b/docs/sources/view-and-analyze-profile-data/profiling-types/_index.md @@ -20,9 +20,12 @@ Profiling is an essential tool for understanding and optimizing application perf In Pyroscope, profiling types refer to different dimensions of application performance analysis, focusing on specific aspects like CPU usage, memory allocation, or thread synchronization. -## Available profile types +For information on auto-instrumentation and supported language SDKs, refer to [Configure the client]({{< relref "../../configure-client" >}}). -Various languages support different profiling types. Pyroscope supports the following profiling types as of `v1.4.0`: +### Available profiling types + +Various languages support different profiling types. +Pyroscope supports the following profiling types: | Profile Type | Go | Java | .NET | Ruby | Python | Rust | Node.js | eBPF (Go) | eBPF (Python) | |--------------------|-------|-------|-------|-------|--------|-------|---------|-----------|--------------| @@ -46,12 +49,14 @@ Various languages support different profiling types. Pyroscope supports the foll -CPU profiling measures the amount of CPU time consumed by different parts of your application code. High CPU usage can indicate inefficient code, leading to poor performance and increased operational costs. It's used to identify and optimize CPU-intensive functions in your application. +CPU profiling measures the amount of CPU time consumed by different parts of your application code. +High CPU usage can indicate inefficient code, leading to poor performance and increased operational costs. +It's used to identify and optimize CPU-intensive functions in your application. - **When to use**: To identify and optimize CPU-intensive functions - **Flame graph insight**: The width of blocks indicates the CPU time consumed by each function -As you can see here, the UI is showing a spike in CPU along with the flame graph associated with that spike. +As you can see here, the UI shows a spike in CPU along with the flame graph associated with that spike. Often times without profiling you may get similar insights from metrics, but with profiling you have more details into the specific cause of a spike in CPU usage at the line level ![example flame graph](https://grafana.com/static/img/pyroscope/pyroscope-ui-single-2023-11-30.png) @@ -79,14 +84,17 @@ Without profiling, this may be something that's exhibited in metrics or out-of-m ## Goroutine profiling -Goroutines are lightweight threads in Go, used for concurrent operations. Goroutine profiling measures the usage and performance of these threads. Poor management can lead to issues like deadlocks and excessive resource usage. +Goroutines are lightweight threads in Go, used for concurrent operations. +Goroutine profiling measures the usage and performance of these threads. +Poor management can lead to issues like deadlocks and excessive resource usage. - **When to use**: Especially useful in Go applications for concurrency management - **Flame graph insight**: Provides a view of goroutine distribution and issues ## Mutex profiling -Mutex profiling involves analyzing mutex (mutual exclusion) locks, used to prevent simultaneous access to shared resources. Excessive or long-duration mutex locks can cause delays and reduced application throughput. +Mutex profiling involves analyzing mutex (mutual exclusion) locks, used to prevent simultaneous access to shared resources. +Excessive or long-duration mutex locks can cause delays and reduced application throughput. - **Types**: Mutex Count, Mutex Duration - **When to use**: To optimize thread synchronization and reduce lock contention @@ -94,10 +102,9 @@ Mutex profiling involves analyzing mutex (mutual exclusion) locks, used to preve ## Block profiling -Block profiling measures the frequency and duration of blocking operations, where a thread is paused or delayed. Blocking can significantly slow down application processes, leading to performance bottlenecks. +Block profiling measures the frequency and duration of blocking operations, where a thread is paused or delayed. +Blocking can significantly slow down application processes, leading to performance bottlenecks. - **Types**: Block Count, Block Duration - **When to use**: To identify and reduce blocking delays - **Flame graph insight**: Identifies where and how long threads are blocked - -