diff --git a/README.md b/README.md
index 6ed3ff57b6..3d4de84df4 100644
--- a/README.md
+++ b/README.md
@@ -117,10 +117,10 @@ For more documentation on how to add the Pyroscope agent to your code, see the [
Documentation
Examples
-
- Grafana Agent - Documentation - Examples + | + Grafana Alloy + Documentation + Examples |
Golang @@ -86,10 +86,10 @@ To get started, choose one of the integrations below: Documentation Examples |
- + | eBPF - Documentation - Examples + Documentation + Examples |
Python diff --git a/examples/grafana-agent-auto-instrumentation/golang-pull/README.md b/examples/grafana-agent-auto-instrumentation/golang-pull/README.md deleted file mode 100644 index 0348807ee8..0000000000 --- a/examples/grafana-agent-auto-instrumentation/golang-pull/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# Grafana Agent Pull Mode Integration - -This example demonstrates how you can use Grafana Agent with Grafana Pyroscope (formerly known as Phlare). - -### 1. Configure Grafana agent - -You'll need to configure the Grafana agent for things like profiling configuration, targets, and possibly authentication in order to have the Grafana Agent pull profiles from your application. - -You can find a list of [arguments](https://grafana.com/docs/agent/latest/flow/reference/components/pyroscope.scrape/#arguments) and [supported blocks](https://grafana.com/docs/agent/latest/flow/reference/components/pyroscope.scrape/#blocks) in the [Grafana Agent documentation for pyroscope](https://grafana.com/docs/agent/latest/flow/reference/components/pyroscope.scrape/) - -Refer to [config file](agent/config/config.river) to see an example of how to configure Grafana Agent to send profiling data to Pyroscope. - -### 2. Run Grafana agent, Grafana and Pyroscope - -```shell -# Pull latest pyroscope and grafana images: -docker pull grafana/pyroscope:latest -docker pull grafana/grafana:latest - -docker-compose up -d -``` - -### 3. Observe profiling data - -Now that everything is set up, you can browse profiling data via [Grafana UI](http://localhost:3000). - -#### Explore view -For showing profiling data alongside traces -![image](https://github.com/grafana/pyroscope/assets/23323466/a9c2f28c-d35a-49b0-a3bc-678d3fbdd321) - -#### Dashboard -For showing real-time overview of profiling data -![image](https://github.com/grafana/pyroscope/assets/23323466/59a84d0c-87d2-4cfc-8e34-b54576cb6540) - diff --git a/examples/grafana-agent-auto-instrumentation/golang-pull/agent/config/agent.yaml b/examples/grafana-agent-auto-instrumentation/golang-pull/agent/config/agent.yaml deleted file mode 100644 index 9faaad5f71..0000000000 --- a/examples/grafana-agent-auto-instrumentation/golang-pull/agent/config/agent.yaml +++ /dev/null @@ -1,2 +0,0 @@ -server: - log_level: info diff --git a/examples/grafana-agent-auto-instrumentation/ebpf-otel/README.md b/examples/grafana-alloy-auto-instrumentation/ebpf-otel/README.md similarity index 100% rename from examples/grafana-agent-auto-instrumentation/ebpf-otel/README.md rename to examples/grafana-alloy-auto-instrumentation/ebpf-otel/README.md diff --git a/examples/grafana-agent-auto-instrumentation/ebpf-otel/docker/Dockerfile b/examples/grafana-alloy-auto-instrumentation/ebpf-otel/docker/Dockerfile similarity index 100% rename from examples/grafana-agent-auto-instrumentation/ebpf-otel/docker/Dockerfile rename to examples/grafana-alloy-auto-instrumentation/ebpf-otel/docker/Dockerfile diff --git a/examples/grafana-agent-auto-instrumentation/ebpf-otel/docker/config/otel-collector-config.yaml b/examples/grafana-alloy-auto-instrumentation/ebpf-otel/docker/config/otel-collector-config.yaml similarity index 100% rename from examples/grafana-agent-auto-instrumentation/ebpf-otel/docker/config/otel-collector-config.yaml rename to examples/grafana-alloy-auto-instrumentation/ebpf-otel/docker/config/otel-collector-config.yaml diff --git a/examples/grafana-agent-auto-instrumentation/ebpf-otel/docker/docker-compose.yml b/examples/grafana-alloy-auto-instrumentation/ebpf-otel/docker/docker-compose.yml similarity index 100% rename from examples/grafana-agent-auto-instrumentation/ebpf-otel/docker/docker-compose.yml rename to examples/grafana-alloy-auto-instrumentation/ebpf-otel/docker/docker-compose.yml diff --git a/examples/grafana-agent-auto-instrumentation/ebpf-otel/docker/grafana-provisioning/datasources/pyroscope.yml b/examples/grafana-alloy-auto-instrumentation/ebpf-otel/docker/grafana-provisioning/datasources/pyroscope.yml similarity index 100% rename from examples/grafana-agent-auto-instrumentation/ebpf-otel/docker/grafana-provisioning/datasources/pyroscope.yml rename to examples/grafana-alloy-auto-instrumentation/ebpf-otel/docker/grafana-provisioning/datasources/pyroscope.yml diff --git a/examples/grafana-agent-auto-instrumentation/ebpf-otel/kubernetes/Dockerfile b/examples/grafana-alloy-auto-instrumentation/ebpf-otel/kubernetes/Dockerfile similarity index 100% rename from examples/grafana-agent-auto-instrumentation/ebpf-otel/kubernetes/Dockerfile rename to examples/grafana-alloy-auto-instrumentation/ebpf-otel/kubernetes/Dockerfile diff --git a/examples/grafana-agent-auto-instrumentation/ebpf-otel/kubernetes/cpu-stress.yaml b/examples/grafana-alloy-auto-instrumentation/ebpf-otel/kubernetes/cpu-stress.yaml similarity index 100% rename from examples/grafana-agent-auto-instrumentation/ebpf-otel/kubernetes/cpu-stress.yaml rename to examples/grafana-alloy-auto-instrumentation/ebpf-otel/kubernetes/cpu-stress.yaml diff --git a/examples/grafana-agent-auto-instrumentation/ebpf-otel/kubernetes/grafana.yaml b/examples/grafana-alloy-auto-instrumentation/ebpf-otel/kubernetes/grafana.yaml similarity index 100% rename from examples/grafana-agent-auto-instrumentation/ebpf-otel/kubernetes/grafana.yaml rename to examples/grafana-alloy-auto-instrumentation/ebpf-otel/kubernetes/grafana.yaml diff --git a/examples/grafana-agent-auto-instrumentation/ebpf-otel/kubernetes/otel-collector.yaml b/examples/grafana-alloy-auto-instrumentation/ebpf-otel/kubernetes/otel-collector.yaml similarity index 100% rename from examples/grafana-agent-auto-instrumentation/ebpf-otel/kubernetes/otel-collector.yaml rename to examples/grafana-alloy-auto-instrumentation/ebpf-otel/kubernetes/otel-collector.yaml diff --git a/examples/grafana-agent-auto-instrumentation/ebpf-otel/kubernetes/profiler.yaml b/examples/grafana-alloy-auto-instrumentation/ebpf-otel/kubernetes/profiler.yaml similarity index 100% rename from examples/grafana-agent-auto-instrumentation/ebpf-otel/kubernetes/profiler.yaml rename to examples/grafana-alloy-auto-instrumentation/ebpf-otel/kubernetes/profiler.yaml diff --git a/examples/grafana-agent-auto-instrumentation/ebpf-otel/kubernetes/pyroscope.yaml b/examples/grafana-alloy-auto-instrumentation/ebpf-otel/kubernetes/pyroscope.yaml similarity index 100% rename from examples/grafana-agent-auto-instrumentation/ebpf-otel/kubernetes/pyroscope.yaml rename to examples/grafana-alloy-auto-instrumentation/ebpf-otel/kubernetes/pyroscope.yaml diff --git a/examples/grafana-agent-auto-instrumentation/ebpf/README.md b/examples/grafana-alloy-auto-instrumentation/ebpf/README.md similarity index 100% rename from examples/grafana-agent-auto-instrumentation/ebpf/README.md rename to examples/grafana-alloy-auto-instrumentation/ebpf/README.md diff --git a/examples/grafana-agent-auto-instrumentation/ebpf/docker/config.river b/examples/grafana-alloy-auto-instrumentation/ebpf/docker/config.alloy similarity index 94% rename from examples/grafana-agent-auto-instrumentation/ebpf/docker/config.river rename to examples/grafana-alloy-auto-instrumentation/ebpf/docker/config.alloy index dc72493831..be5d510eb4 100644 --- a/examples/grafana-agent-auto-instrumentation/ebpf/docker/config.river +++ b/examples/grafana-alloy-auto-instrumentation/ebpf/docker/config.alloy @@ -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.*" diff --git a/examples/grafana-agent-auto-instrumentation/ebpf/docker/docker-compose.yml b/examples/grafana-alloy-auto-instrumentation/ebpf/docker/docker-compose.yml similarity index 77% rename from examples/grafana-agent-auto-instrumentation/ebpf/docker/docker-compose.yml rename to examples/grafana-alloy-auto-instrumentation/ebpf/docker/docker-compose.yml index eea6e38140..a71eb863c2 100644 --- a/examples/grafana-agent-auto-instrumentation/ebpf/docker/docker-compose.yml +++ b/examples/grafana-alloy-auto-instrumentation/ebpf/docker/docker-compose.yml @@ -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 diff --git a/examples/grafana-agent-auto-instrumentation/ebpf/docker/grafana-provisioning/datasources/pyroscope.yml b/examples/grafana-alloy-auto-instrumentation/ebpf/docker/grafana-provisioning/datasources/pyroscope.yml similarity index 100% rename from examples/grafana-agent-auto-instrumentation/ebpf/docker/grafana-provisioning/datasources/pyroscope.yml rename to examples/grafana-alloy-auto-instrumentation/ebpf/docker/grafana-provisioning/datasources/pyroscope.yml diff --git a/examples/grafana-agent-auto-instrumentation/ebpf/docker/grafana-provisioning/plugins/explore-profiles.yml b/examples/grafana-alloy-auto-instrumentation/ebpf/docker/grafana-provisioning/plugins/explore-profiles.yml similarity index 100% rename from examples/grafana-agent-auto-instrumentation/ebpf/docker/grafana-provisioning/plugins/explore-profiles.yml rename to examples/grafana-alloy-auto-instrumentation/ebpf/docker/grafana-provisioning/plugins/explore-profiles.yml diff --git a/examples/grafana-agent-auto-instrumentation/ebpf/kubernetes/README.md b/examples/grafana-alloy-auto-instrumentation/ebpf/kubernetes/README.md similarity index 100% rename from examples/grafana-agent-auto-instrumentation/ebpf/kubernetes/README.md rename to examples/grafana-alloy-auto-instrumentation/ebpf/kubernetes/README.md diff --git a/examples/grafana-agent-auto-instrumentation/ebpf/kubernetes/alloy.yaml b/examples/grafana-alloy-auto-instrumentation/ebpf/kubernetes/alloy.yaml similarity index 92% rename from examples/grafana-agent-auto-instrumentation/ebpf/kubernetes/alloy.yaml rename to examples/grafana-alloy-auto-instrumentation/ebpf/kubernetes/alloy.yaml index cb39a98c99..92052a4046 100644 --- a/examples/grafana-agent-auto-instrumentation/ebpf/kubernetes/alloy.yaml +++ b/examples/grafana-alloy-auto-instrumentation/ebpf/kubernetes/alloy.yaml @@ -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 @@ -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 @@ -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" diff --git a/examples/grafana-agent-auto-instrumentation/ebpf/kubernetes/grafana.yaml b/examples/grafana-alloy-auto-instrumentation/ebpf/kubernetes/grafana.yaml similarity index 100% rename from examples/grafana-agent-auto-instrumentation/ebpf/kubernetes/grafana.yaml rename to examples/grafana-alloy-auto-instrumentation/ebpf/kubernetes/grafana.yaml diff --git a/examples/grafana-agent-auto-instrumentation/ebpf/kubernetes/pyroscope.yaml b/examples/grafana-alloy-auto-instrumentation/ebpf/kubernetes/pyroscope.yaml similarity index 100% rename from examples/grafana-agent-auto-instrumentation/ebpf/kubernetes/pyroscope.yaml rename to examples/grafana-alloy-auto-instrumentation/ebpf/kubernetes/pyroscope.yaml diff --git a/examples/grafana-agent-auto-instrumentation/ebpf/kubernetes/python-fast-slow.yaml b/examples/grafana-alloy-auto-instrumentation/ebpf/kubernetes/python-fast-slow.yaml similarity index 100% rename from examples/grafana-agent-auto-instrumentation/ebpf/kubernetes/python-fast-slow.yaml rename to examples/grafana-alloy-auto-instrumentation/ebpf/kubernetes/python-fast-slow.yaml diff --git a/examples/grafana-agent-auto-instrumentation/ebpf/local/config.river b/examples/grafana-alloy-auto-instrumentation/ebpf/local/config.alloy similarity index 77% rename from examples/grafana-agent-auto-instrumentation/ebpf/local/config.river rename to examples/grafana-alloy-auto-instrumentation/ebpf/local/config.alloy index d10937a5e0..a2f6f2d981 100644 --- a/examples/grafana-agent-auto-instrumentation/ebpf/local/config.river +++ b/examples/grafana-alloy-auto-instrumentation/ebpf/local/config.alloy @@ -7,27 +7,27 @@ // "__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" } } @@ -35,7 +35,7 @@ discovery.relabel "agent" { 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"}], ) } diff --git a/examples/grafana-agent-auto-instrumentation/ebpf/local/docker-compose.yml b/examples/grafana-alloy-auto-instrumentation/ebpf/local/docker-compose.yml similarity index 78% rename from examples/grafana-agent-auto-instrumentation/ebpf/local/docker-compose.yml rename to examples/grafana-alloy-auto-instrumentation/ebpf/local/docker-compose.yml index b888603a9d..436515596d 100644 --- a/examples/grafana-agent-auto-instrumentation/ebpf/local/docker-compose.yml +++ b/examples/grafana-alloy-auto-instrumentation/ebpf/local/docker-compose.yml @@ -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 diff --git a/examples/grafana-agent-auto-instrumentation/ebpf/local/grafana-provisioning/datasources/pyroscope.yml b/examples/grafana-alloy-auto-instrumentation/ebpf/local/grafana-provisioning/datasources/pyroscope.yml similarity index 100% rename from examples/grafana-agent-auto-instrumentation/ebpf/local/grafana-provisioning/datasources/pyroscope.yml rename to examples/grafana-alloy-auto-instrumentation/ebpf/local/grafana-provisioning/datasources/pyroscope.yml diff --git a/examples/grafana-agent-auto-instrumentation/ebpf/local/grafana-provisioning/plugins/explore-profiles.yml b/examples/grafana-alloy-auto-instrumentation/ebpf/local/grafana-provisioning/plugins/explore-profiles.yml similarity index 100% rename from examples/grafana-agent-auto-instrumentation/ebpf/local/grafana-provisioning/plugins/explore-profiles.yml rename to examples/grafana-alloy-auto-instrumentation/ebpf/local/grafana-provisioning/plugins/explore-profiles.yml diff --git a/examples/grafana-alloy-auto-instrumentation/golang-pull/README.md b/examples/grafana-alloy-auto-instrumentation/golang-pull/README.md new file mode 100644 index 0000000000..a67939d741 --- /dev/null +++ b/examples/grafana-alloy-auto-instrumentation/golang-pull/README.md @@ -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). + diff --git a/examples/grafana-agent-auto-instrumentation/golang-pull/agent/config/config.river b/examples/grafana-alloy-auto-instrumentation/golang-pull/alloy/config.alloy similarity index 90% rename from examples/grafana-agent-auto-instrumentation/golang-pull/agent/config/config.river rename to examples/grafana-alloy-auto-instrumentation/golang-pull/alloy/config.alloy index 92774355a9..2188c07bdb 100644 --- a/examples/grafana-agent-auto-instrumentation/golang-pull/agent/config/config.river +++ b/examples/grafana-alloy-auto-instrumentation/golang-pull/alloy/config.alloy @@ -23,7 +23,7 @@ pyroscope.write "example" { pyroscope.scrape "default" { targets = [ {"__address__" = "pyroscope:4040", "service_name"="pyroscope"}, - {"__address__" = "agent:12345", "service_name"="agent"}, + {"__address__" = "alloy:12345", "service_name"="alloy"}, ] forward_to = [pyroscope.write.example.receiver] } diff --git a/examples/grafana-agent-auto-instrumentation/golang-pull/docker-compose.yml b/examples/grafana-alloy-auto-instrumentation/golang-pull/docker-compose.yml similarity index 75% rename from examples/grafana-agent-auto-instrumentation/golang-pull/docker-compose.yml rename to examples/grafana-alloy-auto-instrumentation/golang-pull/docker-compose.yml index e3b437ef9b..48f98f84b6 100644 --- a/examples/grafana-agent-auto-instrumentation/golang-pull/docker-compose.yml +++ b/examples/grafana-alloy-auto-instrumentation/golang-pull/docker-compose.yml @@ -18,16 +18,13 @@ services: ports: - 4040:4040 - agent: - image: grafana/agent:latest + alloy: + image: grafana/alloy:latest volumes: - - ./agent/config:/etc/agent-config + - ./alloy/config.alloy:/etc/alloy/config.alloy command: - run - - /etc/agent-config/config.river + - /etc/alloy/config.alloy - --server.http.listen-addr=0.0.0.0:12345 - environment: - HOSTNAME: agent - AGENT_MODE: flow ports: - - "12345:12345" + - "12345:12345" \ No newline at end of file diff --git a/examples/grafana-agent-auto-instrumentation/golang-pull/grafana-provisioning/dashboards/main.json b/examples/grafana-alloy-auto-instrumentation/golang-pull/grafana-provisioning/dashboards/main.json similarity index 100% rename from examples/grafana-agent-auto-instrumentation/golang-pull/grafana-provisioning/dashboards/main.json rename to examples/grafana-alloy-auto-instrumentation/golang-pull/grafana-provisioning/dashboards/main.json diff --git a/examples/grafana-agent-auto-instrumentation/golang-pull/grafana-provisioning/dashboards/main.yml b/examples/grafana-alloy-auto-instrumentation/golang-pull/grafana-provisioning/dashboards/main.yml similarity index 100% rename from examples/grafana-agent-auto-instrumentation/golang-pull/grafana-provisioning/dashboards/main.yml rename to examples/grafana-alloy-auto-instrumentation/golang-pull/grafana-provisioning/dashboards/main.yml diff --git a/examples/grafana-agent-auto-instrumentation/golang-pull/grafana-provisioning/datasources/datasources.yml b/examples/grafana-alloy-auto-instrumentation/golang-pull/grafana-provisioning/datasources/datasources.yml similarity index 100% rename from examples/grafana-agent-auto-instrumentation/golang-pull/grafana-provisioning/datasources/datasources.yml rename to examples/grafana-alloy-auto-instrumentation/golang-pull/grafana-provisioning/datasources/datasources.yml diff --git a/examples/grafana-agent-auto-instrumentation/golang-pull/grafana-provisioning/plugins/explore-profiles.yml b/examples/grafana-alloy-auto-instrumentation/golang-pull/grafana-provisioning/plugins/explore-profiles.yml similarity index 100% rename from examples/grafana-agent-auto-instrumentation/golang-pull/grafana-provisioning/plugins/explore-profiles.yml rename to examples/grafana-alloy-auto-instrumentation/golang-pull/grafana-provisioning/plugins/explore-profiles.yml diff --git a/examples/grafana-agent-auto-instrumentation/golang-pull/grafana/grafana.ini b/examples/grafana-alloy-auto-instrumentation/golang-pull/grafana/grafana.ini similarity index 100% rename from examples/grafana-agent-auto-instrumentation/golang-pull/grafana/grafana.ini rename to examples/grafana-alloy-auto-instrumentation/golang-pull/grafana/grafana.ini diff --git a/examples/grafana-agent-auto-instrumentation/golang-pull/grafana/home.json b/examples/grafana-alloy-auto-instrumentation/golang-pull/grafana/home.json similarity index 100% rename from examples/grafana-agent-auto-instrumentation/golang-pull/grafana/home.json rename to examples/grafana-alloy-auto-instrumentation/golang-pull/grafana/home.json diff --git a/examples/grafana-agent-auto-instrumentation/java/docker/FastSlow.java b/examples/grafana-alloy-auto-instrumentation/java/docker/FastSlow.java similarity index 100% rename from examples/grafana-agent-auto-instrumentation/java/docker/FastSlow.java rename to examples/grafana-alloy-auto-instrumentation/java/docker/FastSlow.java diff --git a/examples/grafana-agent-auto-instrumentation/java/docker/README.md b/examples/grafana-alloy-auto-instrumentation/java/docker/README.md similarity index 56% rename from examples/grafana-agent-auto-instrumentation/java/docker/README.md rename to examples/grafana-alloy-auto-instrumentation/java/docker/README.md index a9514145fb..76b5eef417 100644 --- a/examples/grafana-agent-auto-instrumentation/java/docker/README.md +++ b/examples/grafana-alloy-auto-instrumentation/java/docker/README.md @@ -1,23 +1,23 @@ -# Grafana Agent Java profiling via auto-instrumentation example in Docker +# Java profiling via auto-instrumentation example in Docker with Grafana Alloy -This repository provides a practical demonstration of leveraging the Grafana Agent for continuous Java application profiling using Pyroscope in a dockerized environment. It illustrates a seamless approach to profiling Java processes, aiding in performance optimization. +This repository provides a practical demonstration of leveraging the Grafana Alloy for continuous Java application profiling using Pyroscope in a dockerized environment. It illustrates a seamless approach to profiling Java processes, aiding in performance optimization. ## Overview -The Grafana Agent automates Java process discovery for profiling, streamlining the setup per application. It enables precise and targeted profiling configurations through the Grafana Agent settings. +Grafana Alloy automates Java process discovery for profiling, streamlining the setup per application. It enables precise and targeted profiling configurations through Grafana Alloy settings. -Java profiling via the Grafana Agent is based on a few Grafana Agent components: +Java profiling via Grafana Alloy is based on a few Grafana Alloy components: - `discovery.process` (and optionally `discovery.kubernetes`) for process discovery - `discovery.relabel` for detecting java processes and setting up labels - `pyroscope.java` for enabling profiling for specific applications - `pyroscope.write` for writing the profiles data to a remote endpoint -Refer to the [official documentation](https://grafana.com/docs/pyroscope/latest/configure-client/grafana-agent/java/) for an in-depth understanding and additional configuration options for Java profiling with the Grafana Agent. -Also, check the [Grafana Agent Components reference](https://grafana.com/docs/agent/latest/flow/reference/components/) for more details on each used component. +Refer to the [official documentation](https://grafana.com/docs/pyroscope/latest/configure-client/grafana-alloy/java/) for an in-depth understanding and additional configuration options for Java profiling with Grafana Alloy. +Also, check the [Grafana Alloy Components reference](https://grafana.com/docs/alloy/latest/reference/components/) for more details on each used component. ### async-profiler -The `pyroscope.java` agent component internally uses the [async-profiler](https://github.com/async-profiler/async-profiler) library. +The `pyroscope.java` component internally uses the [async-profiler](https://github.com/async-profiler/async-profiler) library. This approach offers a key advantage over other instrumentation mechanisms in that you can profile applications that are already running without interruptions (code changes, config changes or restarts). Under the hood, this is achieved by attaching to the application at a process level and issuing commands to control profiling. @@ -34,16 +34,17 @@ To use this example: # Pull latest pyroscope and grafana images: docker pull grafana/pyroscope:latest docker pull grafana/grafana:latest +docker pull grafana/alloy:latest docker-compose up --build ``` -After the container is operational, the Grafana Agent profiles the Java application using he defined configuration. +After the container is operational, Grafana Alloy profiles the Java application using he defined configuration. ## Considerations -You need root privileges to run the Grafana Agent for profiling. The Agent must be executed within the host's PID namespace. +You need root privileges to run Grafana Alloy for profiling. It must be executed within the host's PID namespace. ## Documentation -Refer to the [official documentation](https://grafana.com/docs/pyroscope/latest/configure-client/grafana-agent/java/) for an in-depth understanding and additional configuration options for Java profiling with the Grafana Agent. +Refer to the [official documentation](https://grafana.com/docs/pyroscope/latest/configure-client/grafana-alloy/java/) for an in-depth understanding and additional configuration options for Java profiling with Grafana Alloy. diff --git a/examples/grafana-agent-auto-instrumentation/java/docker/config.river b/examples/grafana-alloy-auto-instrumentation/java/docker/config.alloy similarity index 100% rename from examples/grafana-agent-auto-instrumentation/java/docker/config.river rename to examples/grafana-alloy-auto-instrumentation/java/docker/config.alloy diff --git a/examples/grafana-agent-auto-instrumentation/java/docker/docker-compose.yml b/examples/grafana-alloy-auto-instrumentation/java/docker/docker-compose.yml similarity index 76% rename from examples/grafana-agent-auto-instrumentation/java/docker/docker-compose.yml rename to examples/grafana-alloy-auto-instrumentation/java/docker/docker-compose.yml index 880c120e31..21638e8b13 100644 --- a/examples/grafana-agent-auto-instrumentation/java/docker/docker-compose.yml +++ b/examples/grafana-alloy-auto-instrumentation/java/docker/docker-compose.yml @@ -7,17 +7,14 @@ services: image: grafana/pyroscope:latest ports: - 4040:4040 - agent: - image: grafana/agent:main + alloy: + image: grafana/alloy:main volumes: - - ./config.river:/etc/agent-config/config.river + - ./config.alloy:/etc/alloy-config/config.alloy command: - run - - /etc/agent-config/config.river + - /etc/alloy-config/config.alloy - --server.http.listen-addr=0.0.0.0:12345 - environment: - HOSTNAME: agent - AGENT_MODE: flow ports: - 12345:12345 privileged: true diff --git a/examples/grafana-agent-auto-instrumentation/java/docker/grafana-provisioning/datasources/pyroscope.yml b/examples/grafana-alloy-auto-instrumentation/java/docker/grafana-provisioning/datasources/pyroscope.yml similarity index 100% rename from examples/grafana-agent-auto-instrumentation/java/docker/grafana-provisioning/datasources/pyroscope.yml rename to examples/grafana-alloy-auto-instrumentation/java/docker/grafana-provisioning/datasources/pyroscope.yml diff --git a/examples/grafana-agent-auto-instrumentation/java/docker/grafana-provisioning/plugins/explore-profiles.yml b/examples/grafana-alloy-auto-instrumentation/java/docker/grafana-provisioning/plugins/explore-profiles.yml similarity index 100% rename from examples/grafana-agent-auto-instrumentation/java/docker/grafana-provisioning/plugins/explore-profiles.yml rename to examples/grafana-alloy-auto-instrumentation/java/docker/grafana-provisioning/plugins/explore-profiles.yml diff --git a/examples/grafana-agent-auto-instrumentation/java/docker/java.Dockerfile b/examples/grafana-alloy-auto-instrumentation/java/docker/java.Dockerfile similarity index 100% rename from examples/grafana-agent-auto-instrumentation/java/docker/java.Dockerfile rename to examples/grafana-alloy-auto-instrumentation/java/docker/java.Dockerfile diff --git a/examples/grafana-agent-auto-instrumentation/java/kubernetes/README.md b/examples/grafana-alloy-auto-instrumentation/java/kubernetes/README.md similarity index 90% rename from examples/grafana-agent-auto-instrumentation/java/kubernetes/README.md rename to examples/grafana-alloy-auto-instrumentation/java/kubernetes/README.md index 3cb5784e0f..64f2d97b83 100644 --- a/examples/grafana-agent-auto-instrumentation/java/kubernetes/README.md +++ b/examples/grafana-alloy-auto-instrumentation/java/kubernetes/README.md @@ -14,12 +14,12 @@ Java profiling via Grafana Alloy is based on a few components: - `pyroscope.java` for enabling profiling for specific applications - `pyroscope.write` for writing the profiles data to a remote endpoint -Refer to the [official documentation](https://grafana.com/docs/pyroscope/latest/configure-client/grafana-agent/java/) for an in-depth understanding and additional configuration options for Java profiling with Grafana Alloy. +Refer to the [official documentation](https://grafana.com/docs/pyroscope/latest/configure-client/grafana-alloy/java/) for an in-depth understanding and additional configuration options for Java profiling with Grafana Alloy. Also, check the [Grafana Alloy Components reference](https://grafana.com/docs/alloy/latest/reference/components/) for more details on each used component. ### async-profiler -The `pyroscope.java` agent component internally uses the [async-profiler](https://github.com/async-profiler/async-profiler) library. +The `pyroscope.java` component internally uses the [async-profiler](https://github.com/async-profiler/async-profiler) library. This approach offers a key advantage over other instrumentation mechanisms in that you can profile applications that are already running without interruptions (code changes, config changes or restarts). Under the hood, this is achieved by attaching to the application at a process level and issuing commands to control profiling. @@ -44,4 +44,4 @@ The example will deploy a Grafana instance in the same cluster, available via th ## Documentation -Refer to the [official documentation](https://grafana.com/docs/pyroscope/latest/configure-client/grafana-agent/java/) for an in-depth understanding and additional configuration options for Java profiling with Grafana Alloy. +Refer to the [official documentation](https://grafana.com/docs/pyroscope/latest/configure-client/grafana-alloy/java/) for an in-depth understanding and additional configuration options for Java profiling with Grafana Alloy. diff --git a/examples/grafana-agent-auto-instrumentation/java/kubernetes/grafana-alloy.yaml b/examples/grafana-alloy-auto-instrumentation/java/kubernetes/grafana-alloy.yaml similarity index 91% rename from examples/grafana-agent-auto-instrumentation/java/kubernetes/grafana-alloy.yaml rename to examples/grafana-alloy-auto-instrumentation/java/kubernetes/grafana-alloy.yaml index 2ba685c07a..60734e344b 100644 --- a/examples/grafana-agent-auto-instrumentation/java/kubernetes/grafana-alloy.yaml +++ b/examples/grafana-alloy-auto-instrumentation/java/kubernetes/grafana-alloy.yaml @@ -53,20 +53,13 @@ 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 - valueFrom: - fieldRef: - fieldPath: spec.nodeName - - name: AGENT_MODE - value: flow ports: - containerPort: 12345 volumeMounts: - - name: agent-config - mountPath: /etc/agent-config + - name: alloy-config + mountPath: /etc/alloy-config securityContext: privileged: true runAsGroup: 0 @@ -78,9 +71,9 @@ spec: - SYS_RESOURCE - SYS_ADMIN volumes: - - name: agent-config + - name: alloy-config configMap: - name: agent-config + name: alloy-config hostPID: true --- @@ -88,9 +81,9 @@ spec: apiVersion: v1 kind: ConfigMap metadata: - name: agent-config + name: alloy-config data: - config.river: | + config.alloy: | logging { level = "debug" format = "logfmt" diff --git a/examples/grafana-agent-auto-instrumentation/java/kubernetes/grafana.yaml b/examples/grafana-alloy-auto-instrumentation/java/kubernetes/grafana.yaml similarity index 100% rename from examples/grafana-agent-auto-instrumentation/java/kubernetes/grafana.yaml rename to examples/grafana-alloy-auto-instrumentation/java/kubernetes/grafana.yaml diff --git a/examples/grafana-agent-auto-instrumentation/java/kubernetes/java-fast-slow.yaml b/examples/grafana-alloy-auto-instrumentation/java/kubernetes/java-fast-slow.yaml similarity index 100% rename from examples/grafana-agent-auto-instrumentation/java/kubernetes/java-fast-slow.yaml rename to examples/grafana-alloy-auto-instrumentation/java/kubernetes/java-fast-slow.yaml diff --git a/examples/grafana-agent-auto-instrumentation/java/kubernetes/pyroscope.yaml b/examples/grafana-alloy-auto-instrumentation/java/kubernetes/pyroscope.yaml similarity index 100% rename from examples/grafana-agent-auto-instrumentation/java/kubernetes/pyroscope.yaml rename to examples/grafana-alloy-auto-instrumentation/java/kubernetes/pyroscope.yaml diff --git a/examples/language-sdk-instrumentation/nodejs/express-pull/agent.config.river b/examples/language-sdk-instrumentation/nodejs/express-pull/agent.config.alloy similarity index 100% rename from examples/language-sdk-instrumentation/nodejs/express-pull/agent.config.river rename to examples/language-sdk-instrumentation/nodejs/express-pull/agent.config.alloy diff --git a/examples/language-sdk-instrumentation/nodejs/express-pull/docker-compose.yml b/examples/language-sdk-instrumentation/nodejs/express-pull/docker-compose.yml index eafef6a668..f3460116b3 100644 --- a/examples/language-sdk-instrumentation/nodejs/express-pull/docker-compose.yml +++ b/examples/language-sdk-instrumentation/nodejs/express-pull/docker-compose.yml @@ -3,17 +3,14 @@ services: image: grafana/pyroscope ports: - 4040:4040 - agent: - image: grafana/agent:latest + alloy: + image: grafana/alloy:latest volumes: - - ./agent.config.river:/etc/agent-config/config.river:ro + - ./alloy.config.alloy:/etc/alloy-config/config.alloy:ro command: - run - - /etc/agent-config/config.river + - /etc/alloy-config/config.alloy - --server.http.listen-addr=0.0.0.0:12345 - environment: - HOSTNAME: agent - AGENT_MODE: flow ports: - 12345:12345 us-east: |