chore: replace Promtail with Grafana Alloy for log collection (refs #97)
Promtail 2.9.0 embeds Docker client API v1.42 which is incompatible with Docker Engine v29 (minimum API v1.44). Grafana Alloy v1.12.2 resolves this by using a compatible Docker client. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
29
config/alloy/config.alloy
Normal file
29
config/alloy/config.alloy
Normal file
@@ -0,0 +1,29 @@
|
||||
discovery.docker "containers" {
|
||||
host = "unix:///var/run/docker.sock"
|
||||
refresh_interval = "5s"
|
||||
}
|
||||
|
||||
discovery.relabel "containers" {
|
||||
targets = discovery.docker.containers.targets
|
||||
rule {
|
||||
source_labels = ["__meta_docker_container_name"]
|
||||
regex = "/(.*)"
|
||||
target_label = "container"
|
||||
}
|
||||
rule {
|
||||
source_labels = ["__meta_docker_container_label_com_docker_compose_service"]
|
||||
target_label = "service"
|
||||
}
|
||||
}
|
||||
|
||||
loki.source.docker "containers" {
|
||||
host = "unix:///var/run/docker.sock"
|
||||
targets = discovery.relabel.containers.output
|
||||
forward_to = [loki.write.default.receiver]
|
||||
}
|
||||
|
||||
loki.write "default" {
|
||||
endpoint {
|
||||
url = "http://mvp-loki:3100/loki/api/v1/push"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user