github.com/grafana/pyroscope@v1.18.0/docs/sources/configure-client/grafana-alloy/_index.md (about)

     1  ---
     2  title: "Grafana Alloy"
     3  menuTitle: "Grafana Alloy"
     4  description: "Send data from your application using Grafana Alloy."
     5  weight: 200
     6  aliases:
     7    - /docs/phlare/latest/configure-client/grafana-agent/
     8    - ./grafana-agent # /docs/pyroscope/<PYROSCOPE_VERSION>/configure-client/grafana-agent/
     9  ---
    10  
    11  # Grafana Alloy
    12  
    13  You can send data from your application using Grafana Alloy (preferred) or Grafana Agent (legacy) collectors.
    14  Both collectors support profiling with eBPF, Java, and Golang in pull mode.
    15  
    16  [//]: # 'Shared content for supported languages with eBPF'
    17  [//]: # 'This content is located in /pyroscope/docs/sources/shared/supported-languages-ebpf.md'
    18  
    19  {{< docs/shared source="pyroscope" lookup="supported-languages-ebpf.md" version="latest" >}}
    20  
    21  [Grafana Alloy](https://grafana.com/docs/alloy/<ALLOY_VERSION>/) is a vendor-neutral distribution of the OpenTelemetry (OTel) Collector.
    22  Alloy uniquely combines the very best OSS observability signals in the community.
    23  Alloy uses configuration files written in Alloy configuration syntax.
    24  For  more information, refer to the [Alloy configuration syntax](https://grafana.com/docs/alloy/<ALLOY_VERSION>/get-started/configuration-syntax/).
    25  
    26  Alloy is the recommended collector instead of Grafana Agent.
    27  New installations should use Alloy.
    28  
    29  The instructions in this section explain how to use Alloy.
    30  
    31  {{< admonition type="note" >}}
    32  Refer to [Available profiling types](https://grafana.com/docs/pyroscope/<PYROSCOPE_VERSION>/configure-client/profile-types/) for a list of supported profile types.
    33  {{< /admonition >}}
    34  
    35  ## Legacy collector, Grafana Agent
    36  
    37  {{< docs/shared lookup="agent-deprecation.md" source="alloy" version="next" >}}
    38  
    39  Grafana Agent is a legacy tool for collecting and forwarding profiling data.
    40  Agent supports for eBPF and Golang in pull mode.
    41  For information about Agent, refer to [Grafana Agent Flow](https://grafana.com/docs/agent/<AGENT_VERSION>/flow/).
    42  
    43  Instructions for using Grafana Agent are available in documentation for Pyroscope v1.8 and earlier.
    44  
    45  ## eBPF profiling
    46  
    47  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.
    48  
    49  Benefits of eBPF profiling:
    50  
    51  - Low overhead: eBPF collects data with minimal impact on performance.
    52  - Versatile: eBPF can trace system calls, network packets, and even user-space application logic.
    53  - Dynamic: No need to recompile or restart applications. eBPF allows for live tracing.
    54  
    55  ### Set up eBPF profiling
    56  
    57  1. Ensure your system runs a Linux kernel version 4.9 or newer.
    58  1. Install a collector, such as Alloy, on the target machine or container.
    59  1. Configure Alloy to use eBPF for profiling. Refer to the [eBPF documentation](/docs/pyroscope/<PYROSCOPE_VERSION>/configure-client/grafana-alloy/ebpf) for detailed steps.
    60  1. The collector collects eBPF profiles and sends them to the Pyroscope server.
    61  
    62  ### Supported languages
    63  
    64  [//]: # 'Shared content for supported languages with eBPF'
    65  [//]: # 'This content is located in /pyroscope/docs/sources/shared/supported-languages-ebpf.md'
    66  
    67  {{< docs/shared source="pyroscope" lookup="supported-languages-ebpf.md" version="latest" >}}
    68  
    69  ## Golang profiling in pull mode
    70  
    71  In pull mode, the collector periodically retrieves profiles from Golang applications, specifically targeting the pprof endpoints.
    72  
    73  ### Benefits of Golang profiling in pull mode
    74  
    75  - Non-intrusive: No need to modify your application’s source code.
    76  - Centralized profiling: Suitable for environments with multiple Golang applications or microservices.
    77  - Automatic: Alloy handles the pulling and sending of profiles, requiring minimal configuration.
    78  
    79  ### Set up Golang profiling in pull mode
    80  
    81  1. Ensure your Golang application exposes pprof endpoints.
    82  1. Install and configure Alloy on the same machine or container where your application runs.
    83  1. Ensure Alloy is set to pull mode and targeting the correct pprof endpoints. For step-by-step instructions, visit the [Go (Pull Mode)](https://grafana.com/docs/pyroscope/<PYROSCOPE_VERSION>/configure-client/grafana-alloy/go_pull) documentation.
    84  1. The collector queries the pprof endpoints of your Golang application, collects the profiles, and forwards them to the Pyroscope server.
    85  
    86  ## Receive profiles from Pyroscope SDKs
    87  
    88  Alloy can receive profiles from applications instrumented with Pyroscope SDKs through the `pyroscope.receive_http` component. This approach provides several key advantages:
    89  - Improved performance by sending profiles to a local Alloy instance instead of over the internet to Grafana Cloud, reducing latency and application impact
    90  - Separation of infrastructure concerns from application code - developers don't need to handle authentication, tenant configuration, or infrastructure labels in their code
    91  - Centralized management of authentication and metadata enrichment (for example, Kubernetes labels, business labels)
    92  
    93  This capability is not available in the legacy Grafana Agent.
    94  
    95  ### Set up profile receiving
    96  
    97  1. Configure your application with a Pyroscope SDK pointing to the `pyroscope.receive_http` Alloy component.
    98  2. For step-by-step instructions, refer to the [Receive profiles from Pyroscope SDKs](https://grafana.com/docs/pyroscope/<PYROSCOPE_VERSION>/configure-client/grafana-alloy/receive_profiles) documentation.
    99  
   100  ## Next steps
   101  
   102  Whether using eBPF for versatile system and application profiling or relying on Golang's built-in pprof endpoints in pull mode, Alloy collectors offer streamlined processes to gather essential profiling data.
   103  Choose the method that best fits your application and infrastructure needs.
   104  
   105  [troubleshooting]: /docs/alloy/<ALLOY_VERSION>/reference/components/pyroscope/pyroscope.ebpf/#troubleshooting-unknown-symbols