Skip to content

Commit 6429092

Browse files
committed
examples: Add pyroscope relabel componet in rideshare-alloy example
1 parent 2a310e1 commit 6429092

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

examples/language-sdk-instrumentation/golang-push/rideshare-alloy/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pyroscope.write "backend" {
4545
# Pull latest images
4646
docker pull grafana/pyroscope:latest
4747
docker pull grafana/grafana:latest
48-
docker pull grafana/alloy:latest
48+
docker pull grafana/grafana/alloy-dev:latest
4949

5050
# Run the example
5151
docker-compose up --build

examples/language-sdk-instrumentation/golang-push/rideshare-alloy/config.alloy

+34
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,40 @@ pyroscope.receive_http "default" {
33
listen_address = "0.0.0.0"
44
listen_port = 9999
55
}
6+
forward_to = [pyroscope.relabel.filter_profiles.receiver]
7+
}
8+
9+
pyroscope.relabel "filter_profiles" {
10+
// Convert region to datacenter
11+
rule {
12+
action = "replace"
13+
source_labels = ["region"]
14+
target_label = "datacenter"
15+
}
16+
17+
// Add environment label
18+
rule {
19+
action = "replace"
20+
target_label = "environment"
21+
replacement = "demo"
22+
}
23+
24+
// Add component label based on application name
25+
rule {
26+
action = "replace"
27+
source_labels = ["__name__"]
28+
target_label = "component"
29+
regex = "ride-sharing-app.*"
30+
replacement = "backend"
31+
}
32+
rule {
33+
action = "replace"
34+
source_labels = ["__name__"]
35+
target_label = "component"
36+
regex = "load-generator.*"
37+
replacement = "load-generator"
38+
}
39+
640
forward_to = [pyroscope.write.backend.receiver]
741
}
842

examples/language-sdk-instrumentation/golang-push/rideshare-alloy/docker-compose.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ services:
2727
context: .
2828

2929
alloy:
30-
image: grafana/alloy:latest
30+
image: grafana/alloy-dev:latest
3131
command:
3232
- run
3333
- /etc/alloy/config.alloy
@@ -36,6 +36,7 @@ services:
3636
- ./config.alloy:/etc/alloy/config.alloy
3737
ports:
3838
- "9999:9999"
39+
- "12345:12345"
3940

4041
pyroscope:
4142
image: grafana/pyroscope:latest

0 commit comments

Comments
 (0)