-
Notifications
You must be signed in to change notification settings - Fork 15
/
agent-local.river
95 lines (83 loc) · 1.74 KB
/
agent-local.river
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// Receive traces
otelcol.receiver.otlp "default" {
grpc {
endpoint = "0.0.0.0:4317"
}
http {
endpoint = "0.0.0.0:4318"
}
output {
traces = [otelcol.processor.batch.default.input]
}
}
otelcol.processor.batch "default" {
output {
metrics = []
logs = []
traces = [
otelcol.exporter.otlp.default.input,
]
}
}
// Scrape Metrics
prometheus.scrape "default" {
forward_to = [
prometheus.remote_write.default.receiver,
]
targets = [
{
"__address__" = env("QUICKPIZZA_HOST"),
"job" = "quickpizza",
"instance" = "local",
},
]
}
// Collect profiles
otelcol.exporter.otlp "default" {
client {
// TODO: Replace this with the endpoint for your trace receiver
endpoint = env("TRACES_ENDPOINT")
tls {
insecure = true
insecure_skip_verify = true
}
}
}
prometheus.remote_write "default" {
endpoint {
// TODO: Replace this with your prometheus-compatible metrics store
url = env("METRICS_ENDPOINT")
}
}
discovery.docker "all_containers" {
host = "unix:///var/run/docker.sock"
}
discovery.relabel "quickpizza" {
rule {
target_label = "instance"
source_labels = [
"__meta_docker_container_name",
]
regex ="/(.*)"
action = "replace"
}
rule {
target_label = "job"
source_labels = [
"__meta_docker_container_label_com_docker_compose_project",
]
regex = ".*quickpizza.*"
action = "keep"
}
targets = discovery.docker.all_containers.targets
}
loki.source.docker "default" {
host = "unix:///var/run/docker.sock"
targets = discovery.relabel.quickpizza.output
forward_to = [loki.write.local.receiver]
}
loki.write "local" {
endpoint {
url = env("LOGS_ENDPOINT")
}
}