Skip to content

Commit

Permalink
[DOC] Add links to supported profile types in SDKs (#3228)
Browse files Browse the repository at this point in the history
* Add links to supported profile types in SDKs

* Update doc

* Fix validator issues with links

* Second fix for relrefs

* Add java config examples

* Apply suggestions from code review

* Apply suggestions from code review

* Added link to configure-client from profiling types

* Fix heading

* Fix links to updated heading

* Apply suggestions from code review

Co-authored-by: Bryan Huhta <32787160+bryanhuhta@users.noreply.github.com>

---------

Co-authored-by: Bryan Huhta <32787160+bryanhuhta@users.noreply.github.com>
  • Loading branch information
knylander-grafana and bryanhuhta authored Apr 19, 2024
1 parent 589b4c5 commit ecc6374
Show file tree
Hide file tree
Showing 11 changed files with 99 additions and 27 deletions.
23 changes: 14 additions & 9 deletions docs/sources/configure-client/grafana-agent/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 5 additions & 1 deletion docs/sources/configure-client/language-sdks/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,9 @@ The following languages SDKs provide support for sending profiles from your appl
</tr>
</table>

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/).

6 changes: 5 additions & 1 deletion docs/sources/configure-client/language-sdks/dotnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
7 changes: 6 additions & 1 deletion docs/sources/configure-client/language-sdks/go_push.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
29 changes: 27 additions & 2 deletions docs/sources/configure-client/language-sdks/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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).

Expand Down Expand Up @@ -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 `<TenantID>` 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:
Expand Down
4 changes: 4 additions & 0 deletions docs/sources/configure-client/language-sdks/nodejs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
8 changes: 7 additions & 1 deletion docs/sources/configure-client/language-sdks/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 7 additions & 1 deletion docs/sources/configure-client/language-sdks/ruby.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 7 additions & 1 deletion docs/sources/configure-client/language-sdks/rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
|--------------------|-------|-------|-------|-------|--------|-------|---------|-----------|--------------|
Expand All @@ -46,12 +49,14 @@ Various languages support different profiling types. Pyroscope supports the foll

<!-- We can link to each of these from within the Pyroscope UI in the little (i) icon. -->

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)
Expand Down Expand Up @@ -79,25 +84,27 @@ 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
- **Flame graph insight**: Shows frequency and duration of mutex operations

## 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

<!-- # Next Steps: Exploring Pyroscope's UI(link to ui analysis docs) -->

0 comments on commit ecc6374

Please sign in to comment.