Skip to content

Commit 927c02c

Browse files
fix(post): Added arm instructions for LOKI
1 parent c850913 commit 927c02c

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

_posts/2021-11-20-grafana-loki.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,78 @@ Query all logs from the `container_name` label of `uptime-kuma` and filter on `h
226226

227227
Read more about LogQL [here](https://grafana.com/docs/loki/latest/logql/)
228228

229+
## ARM CPU (Raspberry Pi)
230+
231+
There is a workaround for using this with ARM CPUs. Credit to [AndreiTelteu](https://github.com/AndreiTelteu) for finding this [in this discussion](https://github.com/techno-tim/techno-tim.github.io/discussions/97)
232+
233+
delete `/etc/docker/daemon.json`
234+
235+
Add the vector service to the docker-compose.yml file
236+
237+
```yml
238+
239+
vector:
240+
image: timberio/vector:0.18.1-debian
241+
volumes:
242+
- /var/run/docker.sock:/var/run/docker.sock
243+
- /home/serveradmin/docker_volumes/vector/vector-config.toml:/etc/vector/vector.toml:ro
244+
ports:
245+
- "8383:8383"
246+
restart: unless-stopped
247+
networks:
248+
- loki
249+
```
250+
251+
Run this command
252+
253+
```bash
254+
mkdir vector
255+
cd vector
256+
nano vector-config.toml
257+
```
258+
259+
paste this config in the file:
260+
261+
```toml
262+
[sources.docker-local]
263+
type = "docker_logs"
264+
docker_host = "/var/run/docker.sock"
265+
exclude_containers = []
266+
267+
# Identify zero-width space as first line of a multiline block.
268+
multiline.condition_pattern = '^\x{200B}' # required
269+
multiline.mode = "halt_before" # required
270+
multiline.start_pattern = '^\x{200B}' # required
271+
multiline.timeout_ms = 1000 # required, milliseconds
272+
273+
[sinks.loki]
274+
# General
275+
type = "loki" # required
276+
inputs = ["docker*"] # required
277+
endpoint = "http://loki:3100" # required
278+
279+
# Auth
280+
auth.strategy = "bearer" # required
281+
auth.token = "none" # required
282+
283+
# Encoding
284+
encoding.codec = "json" # required
285+
286+
# Healthcheck
287+
healthcheck.enabled = false # optional, default
288+
289+
# Loki Labels
290+
labels.forwarder = 'vector'
291+
labels.host = '{{ host }}'
292+
labels.container_name = '{{ container_name }}'
293+
labels.compose_service = '{{ label.com\.docker\.compose\.service }}'
294+
labels.compose_project = '{{ label.com\.docker\.compose\.project }}'
295+
labels.source = '{{ stream }}'
296+
labels.category = 'dockerlogs'
297+
```
298+
299+
Credits to this post for the config file: [grafana/loki#2361 (comment)](https://github.com/grafana/loki/issues/2361#issuecomment-826732810)
300+
229301
## Kubernetes Setup
230302

231303
If you're looking to set this up in kubernetes, see [this post](https://techno-tim.github.io/posts/grafana-loki-kubernetes/)

0 commit comments

Comments
 (0)