Skip to content

Commit

Permalink
agent -> alloy rename in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alsoba13 committed Dec 11, 2024
1 parent b62fda5 commit fa39993
Show file tree
Hide file tree
Showing 56 changed files with 115 additions and 134 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ For more documentation on how to add the Pyroscope agent to your code, see the [
<a href="https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/dotnet/" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/language-sdk-instrumentation/dotnet" title="examples">Examples</a>
</td>
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/grafana-agent/ebpf/"><img src="https://user-images.githubusercontent.com/23323466/178160548-e974c080-808d-4c5d-be9b-c983a319b037.png" width="100px;" alt=""/><br />
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/grafana-alloy/ebpf/"><img src="https://user-images.githubusercontent.com/23323466/178160548-e974c080-808d-4c5d-be9b-c983a319b037.png" width="100px;" alt=""/><br />
<b>eBPF</b></a><br />
<a href="https://grafana.com/docs/pyroscope/latest/configure-client/grafana-alloy/ebpf/" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/grafana-agent-auto-instrumentation/ebpf" title="examples">Examples</a>
<a href="https://github.com/grafana/pyroscope/tree/main/examples/grafana-alloy-auto-instrumentation/ebpf" title="examples">Examples</a>
</td>
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/rust/"><img src="https://user-images.githubusercontent.com/23323466/178160555-fb6aeee7-5d31-4bcb-9e3e-41e9f2f7d5b4.png" width="100px;" alt=""/><br />
<b>Rust</b></a><br />
Expand Down
4 changes: 2 additions & 2 deletions docs/sources/configure-client/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ To get started, choose one of the integrations below:
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/grafana-alloy/go_pull"><img src="/media/docs/alloy/alloy_icon.png" width="100px;" alt=""/><br />
<b>Grafana Alloy</b></a><br />
<a href="https://grafana.com/docs/pyroscope/latest/configure-client/grafana-alloy/go_pull/" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/grafana-agent-auto-instrumentation" title="examples">Examples</a>
<a href="https://github.com/grafana/pyroscope/tree/main/examples/grafana-alloy-auto-instrumentation" title="examples">Examples</a>
</td>
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/go_push/"><img src="https://user-images.githubusercontent.com/23323466/178160549-2d69a325-56ec-4e19-bca7-d460d400b163.png" width="100px;" alt=""/><br />
<b>Golang</b></a><br />
Expand All @@ -103,7 +103,7 @@ To get started, choose one of the integrations below:
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/grafana-alloy/ebpf"><img src="https://user-images.githubusercontent.com/23323466/178160548-e974c080-808d-4c5d-be9b-c983a319b037.png" width="100px;" alt=""/><br />
<b>eBPF</b></a><br />
<a href="https://grafana.com/docs/pyroscope/latest/configure-client/grafana-alloy/ebpf" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/grafana-agent-auto-instrumentation/ebpf" title="examples">Examples</a>
<a href="https://github.com/grafana/pyroscope/tree/main/examples/grafana-alloy-auto-instrumentation/ebpf" title="examples">Examples</a>
</td>
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/python/"><img src="https://user-images.githubusercontent.com/23323466/178160553-c78b8c15-99b4-43f3-a2a0-252b6c4862b1.png" width="100px;" alt=""/><br />
<b>Python</b></a><br />
Expand Down
8 changes: 4 additions & 4 deletions docs/sources/configure-client/grafana-alloy/java/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pyroscope.write "endpoint" {

## Examples

For more robust examples, refer to the [Grafana Alloy and Agent Auto-instrumentation](https://github.com/grafana/pyroscope/tree/main/examples/grafana-agent-auto-instrumentation) examples in the Pyroscope repository.
For more robust examples, refer to the [Grafana Alloy and Agent Auto-instrumentation](https://github.com/grafana/pyroscope/tree/main/examples/grafana-alloy-auto-instrumentation) examples in the Pyroscope repository.

### Profiling local process

Expand Down Expand Up @@ -155,7 +155,7 @@ pyroscope.write "example" {

### Profiling Docker containers

For a working example, refer to [Java profiling via auto-instrumentation example in Docker](https://github.com/grafana/pyroscope/tree/main/examples/grafana-agent-auto-instrumentation/java/docker).
For a working example, refer to [Java profiling via auto-instrumentation example in Docker](https://github.com/grafana/pyroscope/tree/main/examples/grafana-alloy-auto-instrumentation/java/docker).

```alloy
discovery.docker "local_containers" {
Expand Down Expand Up @@ -202,7 +202,7 @@ pyroscope.write "example" {

### Profiling Kubernetes pods

For a working example, refer to [Grafana Alloy Java profiling via auto-instrumentation with Kubernetes](https://github.com/grafana/pyroscope/tree/main/examples/grafana-agent-auto-instrumentation/java/kubernetes).
For a working example, refer to [Grafana Alloy Java profiling via auto-instrumentation with Kubernetes](https://github.com/grafana/pyroscope/tree/main/examples/grafana-alloy-auto-instrumentation/java/kubernetes).

```alloy
discovery.kubernetes "local_pods" {
Expand Down Expand Up @@ -283,7 +283,7 @@ pyroscope.write "example" {

For more information:

* [Examples](https://github.com/grafana/pyroscope/tree/main/examples/grafana-agent-auto-instrumentation/java)
* [Examples](https://github.com/grafana/pyroscope/tree/main/examples/grafana-alloy-auto-instrumentation/java)

- [Grafana Alloy](https://grafana.com/docs/alloy/<ALLOY_VERSION>/)
- [pyroscope.scrape](https://grafana.com/docs/alloy/<ALLOY_VERSION>/reference/components/pyroscope/pyroscope.scrape/)
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/configure-client/language-sdks/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The following languages SDKs provide support for sending profiles from your appl
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/grafana-alloy/ebpf/"><img src="https://user-images.githubusercontent.com/23323466/178160548-e974c080-808d-4c5d-be9b-c983a319b037.png" width="100px;" alt=""/><br />
<b>eBPF</b></a><br />
<a href="https://grafana.com/docs/pyroscope/latest/configure-client/grafana-alloy/ebpf/" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/grafana-agent-auto-instrumentation/ebpf" title="examples">Examples</a>
<a href="https://github.com/grafana/pyroscope/tree/main/examples/grafana-alloy-auto-instrumentation/ebpf" title="examples">Examples</a>
</td>
<td align="center"><a href="./rust"><img src="https://user-images.githubusercontent.com/23323466/178160555-fb6aeee7-5d31-4bcb-9e3e-41e9f2f7d5b4.png" width="100px;" alt=""/><br />
<b>Rust</b></a><br />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ The profile collection pipeline consists of:

## Get started

For detailed setup instructions and working examples, refer to the [examples repository](https://github.com/grafana/pyroscope/tree/main/examples/grafana-agent-auto-instrumentation/ebpf-otel).
For detailed setup instructions and working examples, refer to the [examples repository](https://github.com/grafana/pyroscope/tree/main/examples/grafana-alloy-auto-instrumentation/ebpf-otel).

The examples demonstrate deployments for both Docker and Kubernetes environments.
18 changes: 9 additions & 9 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ If you are familiar with profiling and flame graphs, then you'll be happy to kno
## Auto-instrumentation and language SDK instrumentation examples

Pyroscope is a continuous profiling database that allows you to analyze the performance of your applications.
When sending profiles to Pyroscope, you can choose between two primary methods: SDK Instrumentation and auto-instrumentation using the Grafana Agent.
When sending profiles to Pyroscope, you can choose between two primary methods: SDK Instrumentation and auto-instrumentation using Grafana Alloy.

![Pyroscope agent server diagram](https://grafana.com/media/docs/pyroscope/pyroscope_client_server_diagram_09_18_2024.png)

Expand All @@ -26,7 +26,7 @@ When sending profiles to Pyroscope, you can choose between two primary methods:
You can send data from your application using Grafana Alloy or Grafana Agent collectors.
Both collectors support profiling with eBPF, Java, and Golang in pull mode.

For examples using auto-instrumentation with the collectors, try the `grafana-agent-auto-instrumentation` example.
For examples using auto-instrumentation with the collectors, try the `grafana-alloy-auto-instrumentation` example.

[Grafana Alloy](https://grafana.com/docs/alloy/latest/) is a vendor-neutral distribution of the OpenTelemetry (OTel) Collector.
Alloy uniquely combines the very best OSS observability signals in the community.
Expand Down Expand Up @@ -71,10 +71,10 @@ Here are some factors to consider when making the choice:
To get started, choose one of the integrations below:
<table>
<tr>
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/grafana-agent/go_pull"><img src="https://github-production-user-asset-6210df.s3.amazonaws.com/223048/257522425-48683963-91ae-4caf-8c52-ce131e25bd65.png" width="100px;" alt=""/><br />
<b>Grafana Agent</b></a><br />
<a href="https://grafana.com/docs/pyroscope/latest/configure-client/grafana-agent/go_pull/" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/grafana-agent-auto-instrumentation" title="examples">Examples</a>
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/grafana-alloy/go_pull"><img src="https://grafana.com/media/docs/alloy/alloy_icon.png" width="100px;" alt=""/><br />
<b>Grafana Alloy</b></a><br />
<a href="https://grafana.com/docs/pyroscope/latest/configure-client/grafana-alloy/go_pull/" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/grafana-alloy-auto-instrumentation" title="examples">Examples</a>
</td>
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/go_push/"><img src="https://user-images.githubusercontent.com/23323466/178160549-2d69a325-56ec-4e19-bca7-d460d400b163.png" width="100px;" alt=""/><br />
<b>Golang</b></a><br />
Expand All @@ -86,10 +86,10 @@ To get started, choose one of the integrations below:
<a href="https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/java/">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/language-sdk-instrumentation/java/rideshare" title="java-examples">Examples</a>
</td>
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/grafana-agent/ebpf"><img src="https://user-images.githubusercontent.com/23323466/178160548-e974c080-808d-4c5d-be9b-c983a319b037.png" width="100px;" alt=""/><br />
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/grafana-alloy/ebpf"><img src="https://user-images.githubusercontent.com/23323466/178160548-e974c080-808d-4c5d-be9b-c983a319b037.png" width="100px;" alt=""/><br />
<b>eBPF</b></a><br />
<a href="https://grafana.com/docs/pyroscope/latest/configure-client/grafana-agent/ebpf" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/grafana-agent-auto-instrumentation/ebpf" title="examples">Examples</a>
<a href="https://grafana.com/docs/pyroscope/latest/configure-client/grafana-alloy/ebpf" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/grafana-alloy-auto-instrumentation/ebpf" title="examples">Examples</a>
</td>
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/python/"><img src="https://user-images.githubusercontent.com/23323466/178160553-c78b8c15-99b4-43f3-a2a0-252b6c4862b1.png" width="100px;" alt=""/><br />
<b>Python</b></a><br />
Expand Down
34 changes: 0 additions & 34 deletions examples/grafana-agent-auto-instrumentation/golang-pull/README.md

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ discovery.docker "all" {
discovery.relabel "pyroscope" {
targets = discovery.docker.all.targets
// Filter needed containers based on docker labels
// See more info at reference doc https://grafana.com/docs/agent/next/flow/reference/components/discovery.docker/
// See more info at reference doc https://grafana.com/docs/alloy/next/reference/components/discovery/discovery.docker/
rule {
source_labels = ["__meta_docker_container_name"]
regex = ".*pyroscope.*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,20 @@ services:
image: grafana/pyroscope
ports:
- 4040:4040
grafana-agent:
image: grafana/agent:main
grafana-alloy:
image: grafana/alloy:main
user: root
privileged: true
pid: host
environment:
- AGENT_MODE=flow
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./config.river:/config.river
- ./config.alloy:/config.alloy
ports:
- 12345:12345
command:
- run
- /config.river
- --storage.path=/tmp/agent
- /config.alloy
- --storage.path=/tmp/alloy
- --server.http.listen-addr=0.0.0.0:12345
grafana:
image: grafana/grafana:latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ spec:
command:
- /bin/alloy
- run
- /etc/agent-config/config.river
- /etc/alloy-config/config.alloy
- --server.http.listen-addr=0.0.0.0:12345
env:
- name: HOSTNAME
Expand All @@ -73,16 +73,16 @@ spec:
ports:
- containerPort: 12345
volumeMounts:
- name: agent-config
mountPath: /etc/agent-config
- name: alloy-config
mountPath: /etc/alloy-config
securityContext:
privileged: true
runAsGroup: 0
runAsUser: 0
volumes:
- name: agent-config
- name: alloy-config
configMap:
name: agent-config
name: alloy-config

hostPID: true

Expand All @@ -91,12 +91,12 @@ spec:
apiVersion: v1
kind: ConfigMap
metadata:
name: agent-config
name: alloy-config
namespace: pyroscope-ebpf
data:
config.river: |
// This is an example grafana agent config to set up eBPF profiling in kubernetes.
// for more info see https://grafana.com/docs/pyroscope/latest/configure-client/grafana-agent/ebpf/setup-kubernetes/
config.alloy: |
// This is an example grafana alloy config to set up eBPF profiling in kubernetes.
// for more info see https://grafana.com/docs/pyroscope/latest/configure-client/grafana-alloy/ebpf/setup-kubernetes/
logging {
level = "debug"
format = "logfmt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,35 @@
// "__meta_process_username"
// "__meta_process_uid"
// "__container_id__"
// See reference doc for more info https://grafana.com/docs/agent/next/flow/reference/components/discovery.process/
// See reference doc for more info https://grafana.com/docs/alloy/next/reference/components/discovery/discovery.process/

discovery.process "all" {

}

discovery.relabel "agent" {
discovery.relabel "alloy" {
targets = discovery.process.all.targets
// Filter needed processes
rule {
source_labels = ["__meta_process_exe"]
regex = ".*/grafana-agent"
regex = ".*/grafana-alloy"
action = "keep"
}
// provide arbitrary service_name label, otherwise it will be "unspecified"
rule {
source_labels = ["__meta_process_exe"]
target_label = "service_name"
regex = ".*/grafana-agent"
regex = ".*/grafana-alloy"
action = "replace"
replacement = "ebpf/local/grafana-agent"
replacement = "ebpf/local/grafana-alloy"
}
}


pyroscope.ebpf "instance" {
forward_to = [pyroscope.write.endpoint.receiver]
targets = concat(
discovery.relabel.agent.output,
discovery.relabel.alloy.output,
[{"__process_pid__" = "1", "service_name" = "ebpf/local/init"}],
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,18 @@ services:
ports:
- 4040:4040
app:
image: grafana/agent:main
image: grafana/alloy:main
user: root
privileged: true
pid: host
environment:
- AGENT_MODE=flow
volumes:
- ./config.river:/config.river
- ./config.alloy:/config.alloy
ports:
- 12345:12345
command:
- run
- /config.river
- --storage.path=/tmp/agent
- /config.alloy
- --storage.path=/tmp/alloy
- --server.http.listen-addr=0.0.0.0:12345
grafana:
image: grafana/grafana:latest
Expand Down
36 changes: 36 additions & 0 deletions examples/grafana-alloy-auto-instrumentation/golang-pull/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Grafana Alloy Pull Mode Integration

This example demonstrates how you can use Grafana Alloy with Grafana Pyroscope (formerly known as Phlare).

### 1. Configure Grafana Alloy

You'll need to configure the Grafana Alloy for things like profiling configuration, targets, and possibly authentication in order to have the Grafana Alloy pull profiles from your application.

You can find a list of [arguments](https://grafana.com/docs/alloy/latest/reference/components/pyroscope/pyroscope.scrape/#arguments) and [supported blocks](https://grafana.com/docs/alloy/latest/reference/components/pyroscope/pyroscope.scrape/#blocks) in the [Grafana Alloy documentation for pyroscope](https://grafana.com/docs/alloy/latest/reference/components/pyroscope/pyroscope.scrape/)

Refer to [config file](alloy/config.alloy) to see an example of how to configure Grafana Alloy to send profiling data to Pyroscope.

### 2. Run Grafana Alloy, Grafana and Pyroscope

```shell
# Pull latest pyroscope and grafana images:
docker pull grafana/pyroscope:latest
docker pull grafana/grafana:latest
docker pull grafana/alloy:latest

docker-compose up -d
```

### 3. Observe profiling data

Now that everything is set up, you can browse profiling data.

#### Explore profiles
[Explore profiles app](http://localhost:3000/a/grafana-pyroscope-app/profiles-explorer).

![image](https://github.com/user-attachments/assets/71cb5a6e-2f5f-4f80-b868-d17fc30c2ca1)
![image](https://github.com/user-attachments/assets/00e45eac-0d2d-4229-85f0-3d2321c4542a)

#### Dashboard
You will also find a dummy [dashboard](http://localhost:3000/d/65gjqY3Mk/main).

Loading

0 comments on commit fa39993

Please sign in to comment.