Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
  • Loading branch information
marcsanmi and knylander-grafana committed Nov 5, 2024
2 parents b5a4dfa + bad239a commit a11899b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
14 changes: 8 additions & 6 deletions docs/sources/configure-client/grafana-alloy/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Grafana Alloy"
menuTitle: "Grafana Alloy"
description: "Send data from your application using Grafana Alloy."
weight: 200
weight: 10
aliases:
- /docs/phlare/latest/configure-client/grafana-agent/
- ./grafana-agent # /docs/pyroscope/<PYROSCOPE_VERSION>/configure-client/grafana-agent/
Expand All @@ -24,7 +24,7 @@ New installations should use Alloy.
The instructions in this section explain how to use Alloy.

{{< admonition type="note" >}}
Refer to [Available profiling types](https://grafana.com/docs/pyroscope/<PYROSCOPE_VERSION>/configure-client/profile-types/) for a list of supported profile types.
Refer to [Available profiling types]({{< relref "../../view-and-analyze-profile-data/profiling-types#available-profiling-types" >}}) for a list of supported profile types.

Check failure on line 27 in docs/sources/configure-client/grafana-alloy/_index.md

View workflow job for this annotation

GitHub Actions / doc-validator

[doc-validator] reported by reviewdog 🐶 The link '{{< relref "../../view-and-analyze-profile-data/profiling-types#available-profiling-types" >}}' references a page in the project that doesn't exist. Check if the page has moved within the repository. Verify the link by building the docs locally using the `make docs` webserver. Raw Output: {"message":"The link '{{< relref \"../../view-and-analyze-profile-data/profiling-types#available-profiling-types\" >}}' references a page in the project that doesn't exist.\nCheck if the page has moved within the repository.\n\nVerify the link by building the docs locally using the `make docs` webserver.","location":{"path":"docs/sources/configure-client/grafana-alloy/_index.md","range":{"start":{"line":27,"column":10},"end":{"line":27,"column":133}}},"severity":1,"source":{"name":"doc-validator"},"code":{"value":"link-does-not-exist"}}
{{< /admonition >}}

## Legacy collector, Grafana Agent
Expand Down Expand Up @@ -81,17 +81,19 @@ In pull mode, the collector periodically retrieves profiles from Golang applicat
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.
1. The collector queries the pprof endpoints of your Golang application, collects the profiles, and forwards them to the Pyroscope server.

## Receiving profiles from Pyroscope SDKs
## Receive profiles from Pyroscope SDKs

Alloy (not available in Grafana Agent) can receive profiles from applications instrumented with Pyroscope SDKs through the `pyroscope.receive_http` component. This approach provides several key advantages:
Alloy can receive profiles from applications instrumented with Pyroscope SDKs through the `pyroscope.receive_http` component. This approach provides several key advantages:
- Improved performance by sending profiles to a local Alloy instance instead of over the internet to Grafana Cloud, reducing latency and application impact
- Separation of infrastructure concerns from application code - developers don't need to handle authentication, tenant configuration, or infrastructure labels in their code
- Centralized management of authentication and metadata enrichment (for example, Kubernetes labels, business labels)

This capability is not available in the legacy Grafana Agent.

### Set up profile receiving

1. Configure your application with a Pyroscope SDK pointing to Alloy's receive endpoint
2. For step-by-step instructions, visit the [Receiving SDK profiles](https://grafana.com/docs/pyroscope/<PYROSCOPE_VERSION>/configure-client/grafana-alloy/receive_profiles) documentation.
1. Configure your application with a Pyroscope SDK pointing to receive endpoint for Alloy.
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.

## Next steps

Expand Down
13 changes: 10 additions & 3 deletions docs/sources/configure-client/grafana-alloy/receive_profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ The `pyroscope.receive_http` component in Alloy receives profiles from applicati
- Separation of infrastructure concerns (auth, routing) from application code
- Centralized management of authentication and metadata enrichment

For more information about this component, refer to the [pyroscope.receive_http component](https://grafana.com/docs/alloy/<ALLOY_VERSION>/reference/components/pyroscope/pyroscope.receive_http/) documentation.

To set up profile receiving, you need to:
1. Configure Alloy components
2. Configure your application's SDK
Expand All @@ -20,10 +22,11 @@ To set up profile receiving, you need to:
## Configure Alloy components

The configuration requires at least two components:
- `pyroscope.receive_http` to receive profiles via HTTP
- `pyroscope.write` to forward profiles to Pyroscope
- [`pyroscope.receive_http`](https://grafana.com/docs/alloy/<ALLOY_VERSION>/reference/components/pyroscope/pyroscope.receive_http/) to receive profiles via HTTP
- [`pyroscope.write`](https://grafana.com/docs/alloy/<ALLOY_VERSION>/reference/components/pyroscope/pyroscope.write/) to forward profiles to Pyroscope

Here's a basic configuration:
Here's a basic configuration that sets up a simple profile collection pipeline.
It creates a receiver to collect profiles from your applications and forwards them through a writer component to send them to the Pyroscope backend:

```alloy
// Receives profiles over HTTP
Expand Down Expand Up @@ -55,9 +58,13 @@ Check your specific language SDK documentation for the exact configuration optio

## Examples

The examples in this section provide samples you can use as a starting point for your own configurations.

### Basic receiving setup

This example shows a basic setup receiving profiles on port 9090 and forwarding them to a local Pyroscope instance:


```alloy
pyroscope.receive_http "default" {
http {
Expand Down

0 comments on commit a11899b

Please sign in to comment.