Menu
Open source

Grafana Agent

Caution

Grafana Alloy is the new name for our distribution of the OTel collector. Grafana Agent has been deprecated and is in Long-Term Support (LTS) through October 31, 2025. Grafana Agent will reach an End-of-Life (EOL) on November 1, 2025. Read more about why we recommend migrating to Grafana Alloy.

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.

Note

Refer to Available profiling types for a list of profile types supported.

eBPF profiling with Grafana Agent

eBPF (Extended Berkeley Packet Filter) is a modern Linux kernel technology that allows for safe, efficient, and customizable tracing of system and application behaviors without modifying the source code or restarting processes.

Benefits of eBPF profiling:

  • Low overhead: eBPF collects data with minimal impact on performance.
  • Versatile: eBPF can trace system calls, network packets, and even user-space application logic.
  • Dynamic: No need to recompile or restart applications. eBPF allows for live tracing.

Set up eBPF profiling with Grafana Agent

  1. Ensure your system runs a Linux kernel version 4.9 or newer.
  2. Install Grafana Agent on the target machine or container.
  3. Configure the Agent to use eBPF for profiling. Refer to the eBPF documentation for detailed steps.
  4. The Agent collects eBPF profiles and sends them to the Pyroscope server.

Golang profiling in pull mode with Grafana Agent

In pull mode, Grafana Agent periodically retrieves profiles from Golang applications, specifically targeting the pprof endpoints.

Benefits of Golang profiling in pull mode

  • Non-intrusive: No need to modify your application’s source code.
  • Centralized profiling: Suitable for environments with multiple Golang applications or microservices.
  • Automatic: The agent handles the pulling and sending of profiles, requiring minimal configuration.

Set up Golang profiling in pull mode

  1. Ensure your Golang application exposes pprof endpoints.
  2. Install and configure the 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.
  4. 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 streamlined processes to gather essential profiling data. Choose the method that best fits your application and infrastructure needs.