-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.alloy
40 lines (34 loc) · 987 Bytes
/
config.alloy
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
// Remote Loki Server
loki.write "remote_loki" {
endpoint {
url = env("REMOTE_LOKI_WRITE_URL")
}
}
// Remote Prometheus Server
prometheus.remote_write "remote_prometheus" {
endpoint {
url = env("REMOTE_PROMETHEUS_WRITE_URL")
basic_auth {
username = env("REMOTE_PROMETHEUS_USERNAME")
password = env("REMOTE_PROMETHEUS_PASSWORD")
}
}
}
// Send Agent Logs to Loki
logging {
level = "info"
write_to = [loki.write.remote_loki.receiver]
}
// Collect metrics from the local running Alloy instance and forward to
// Prometheus.
prometheus.exporter.self "cougar_host" {}
prometheus.scrape "cougar_host" {
targets = prometheus.exporter.self.cougar_host.targets
forward_to = [prometheus.remote_write.remote_prometheus.receiver]
}
loki.source.file "badger_logs" {
targets = [
{__path__ = "/var/log/badger.log", "color" = "pink", "service_name" = "badger", "component" = "backend"},
]
forward_to = [loki.write.remote_loki.receiver]
}