Grafana Loki Docker Driver for ARM-based servers #97
-
Hi I found a solution using vector.dev and i am posting the solution here if anyone else has this problem: vector:
image: timberio/vector:0.18.1-debian
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /home/serveradmin/docker_volumes/vector/vector-config.toml:/etc/vector/vector.toml:ro
ports:
- "8383:8383"
restart: unless-stopped
networks:
- loki Run this commands mkdir vector
cd vector
nano vector-config.toml Paste this config file: [sources.docker-local]
type = "docker_logs"
docker_host = "/var/run/docker.sock"
exclude_containers = []
# Identify zero-width space as first line of a multiline block.
multiline.condition_pattern = '^\x{200B}' # required
multiline.mode = "halt_before" # required
multiline.start_pattern = '^\x{200B}' # required
multiline.timeout_ms = 1000 # required, milliseconds
[sinks.loki]
# General
type = "loki" # required
inputs = ["docker*"] # required
endpoint = "http://loki:3100" # required
# Auth
auth.strategy = "bearer" # required
auth.token = "none" # required
# Encoding
encoding.codec = "json" # required
# Healthcheck
healthcheck.enabled = false # optional, default
# Loki Labels
labels.forwarder = 'vector'
labels.host = '{{ host }}'
labels.container_name = '{{ container_name }}'
labels.compose_service = '{{ label.com\.docker\.compose\.service }}'
labels.compose_project = '{{ label.com\.docker\.compose\.project }}'
labels.source = '{{ stream }}'
labels.category = 'dockerlogs' Credits to this post for the config file: grafana/loki#2361 (comment) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Thank you so much for this! I will add it to the docs! |
Beta Was this translation helpful? Give feedback.
-
Added your fix here! https://techno-tim.github.io/posts/grafana-loki/ Thank you so much!!! |
Beta Was this translation helpful? Give feedback.
-
I just ran into this issue while following Tim's the video guide. I'll uninstall the plugin ( it installs but won't enable.) and install the vector service instead. What is port 8383 for? I don't see it used by any of the other services. does it need to be exposed? |
Beta Was this translation helpful? Give feedback.
Added your fix here! https://techno-tim.github.io/posts/grafana-loki/
Thank you so much!!!