Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(examples, docs): Migrate agent to alloy in docs and examples #3762

Merged
merged 3 commits into from
Dec 12, 2024

Conversation

alsoba13
Copy link
Contributor

@alsoba13 alsoba13 commented Dec 11, 2024

Migrating agent to alloy. Expect a lot of changes in urls, pointing to Alloy doc, using alloy images and config conventions.
I could test golang-pull, which worked.

Needs to be tested:

@alsoba13 alsoba13 force-pushed the alsoba13/agent-to-alloy-migration branch 2 times, most recently from 9994c1f to 24f08b4 Compare December 11, 2024 15:30
@alsoba13 alsoba13 changed the title agent -> alloy rename in docs Migrate agent to alloy in docs and examples Dec 11, 2024
@alsoba13 alsoba13 marked this pull request as ready for review December 11, 2024 15:42
@alsoba13 alsoba13 requested review from a team as code owners December 11, 2024 15:42
@alsoba13 alsoba13 changed the title Migrate agent to alloy in docs and examples chore(examples, docs): Migrate agent to alloy in docs and examples Dec 11, 2024
@alsoba13 alsoba13 force-pushed the alsoba13/agent-to-alloy-migration branch from 24f08b4 to fa39993 Compare December 11, 2024 15:52
Copy link
Contributor

@simonswine simonswine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Nothing obviously wrong. But I also haven't run every example. :shipit:

grafana-agent:
image: grafana/agent:main
grafana-alloy:
image: grafana/alloy:main
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should use a released version for alloy too?

Suggested change
image: grafana/alloy:main
image: grafana/alloy:latest

@kolesnikovae
Copy link
Collaborator

Looks good to me! @korniltsev you probably should take a look, I suspect Alberto wanted to tag you and not me

@korniltsev
Copy link
Collaborator

➜  local git:(fa399931e) docker compose up
[+] Running 1/1
 ✘ app Error manifest for grafana/alloy:main not found: manifest unknown: manifest unknown                             3.4s
Error response from daemon: manifest for grafana/alloy:main not found: manifest unknown: manifest unknown
➜  local git:(fa399931e) pwd
/home/korniltsev/p/pyroscope/examples/grafana-alloy-auto-instrumentation/ebpf/local

I think we should use grafana/alloy:latest or grafana/alloy-dev:latest , there seem to be no alloy:main

@korniltsev
Copy link
Collaborator

The renames in ebpf/local examples breaks discovery.relabel configuration. The binary and exe name is alloy, not grafana-alloy. I propose to apply this.

diff --git a/examples/grafana-alloy-auto-instrumentation/ebpf/local/config.alloy b/examples/grafana-alloy-auto-instrumentation/ebpf/local/config.alloy
index a2f6f2d98..4c1bf1848 100644
--- a/examples/grafana-alloy-auto-instrumentation/ebpf/local/config.alloy
+++ b/examples/grafana-alloy-auto-instrumentation/ebpf/local/config.alloy
@@ -18,16 +18,16 @@ discovery.relabel "alloy" {
     // Filter needed processes
     rule {
         source_labels = ["__meta_process_exe"]
-        regex = ".*/grafana-alloy"
+        regex = ".*/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-alloy"
+        regex = ".*/alloy"
         action = "replace"
-        replacement = "ebpf/local/grafana-alloy"
+        replacement = "ebpf/local/alloy"
     }
 }

@alsoba13
Copy link
Contributor Author

I updated the PR with the comments (latest instead of main, and fixing bin name). I didn't run the examples so I propose that everyone (dima and tolya) try and fix their examples in separate PRs.

@alsoba13 alsoba13 merged commit b0f61d2 into main Dec 12, 2024
18 checks passed
@alsoba13 alsoba13 deleted the alsoba13/agent-to-alloy-migration branch December 12, 2024 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants