feat: send docker logs to loki

This commit is contained in:
2026-06-02 18:39:24 -03:00
parent 38095e23fa
commit 024f2a8aec
2 changed files with 23 additions and 1 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ export PROMETHEUS_YML_VERSION=v2
export MATRIX_ALERTMANAGER_CONFIG_VERSION=e
export MATRIX_ALERTMANAGER_ENTRYPOINT_VERSION=a
export GRAFANA_ALERTS_NODE_VERSION=v1c
export CONFIG_ALLOY_VERSION=v5
export CONFIG_ALLOY_VERSION=v6
# creates a default prometheus scrape config for a given node
add_node(){
+22
View File
@@ -3,6 +3,10 @@ logging {
format = "logfmt"
}
discovery.docker "linux" {
host = "unix:///var/run/docker.sock"
}
prometheus.exporter.cadvisor "docker" {
}
@@ -34,3 +38,21 @@ prometheus.remote_write "prometheus" {
}
}
}
loki.source.docker "docker" {
host = "unix:///var/run/docker.sock"
targets = discovery.docker.linux.targets
labels = {"app" = "docker"}
forward_to = [loki.write.loki.receiver]
}
loki.write "loki" {
endpoint {
url = "{{ env "LOKI_PUSH_URL" }}"
basic_auth {
username = "admin"
password = "{{ secret "basic_auth" }}"
}
}
}