Sitemap
Nerd For Tech

NFT is an Educational Media House. Our mission is to bring the invaluable knowledge and experiences of experts from all over the world to the novice. To know more about us, visit https://www.nerdfortech.org/.

Do not Fly Blind! Setup Grafana & Loki for Caprover (Docker Swarm)

4 min readSep 7, 2024

--

Image by Loki

#1 Deploying Loki

Path binding
> cd /captain/data/nginx-shared/loki/config # we bound this path to the app's /mnt/config
> ls
loki-config.yaml
docker plugin install grafana/loki-docker-driver:2.9.2 --alias loki --grant-all-permissions
docker service update \
--args="-config.file=/mnt/config/loki-config.yaml" \
srv-captain--loki # this is our service name

#2 Configuring Django App’s Logging

> docker service update \
--log-driver loki \
--log-opt loki-url=https://my-loki-domain/loki/api/v1/push \
srv-captain--my-donation-app

# you should see a similar output
srv-captain--my-donation-app
overall progress: 1 out of 1 tasks
1/1: running [==================================================>]
verify: Service srv-captain--my-donation-app converged

#3 Setting Up Grafana

Adding a datasource
Image by Author

Finally

--

--

Nerd For Tech
Nerd For Tech

Published in Nerd For Tech

NFT is an Educational Media House. Our mission is to bring the invaluable knowledge and experiences of experts from all over the world to the novice. To know more about us, visit https://www.nerdfortech.org/.

Baysan
Baysan

Written by Baysan

Solopreneur & Lifelong Learner I use technology that helps me. mebaysan.com

No responses yet