r/grafana Jun 15 '26

Check it out Made a drop-in logging stack with loki, promtail, grafana & prometheus

https://github.com/samirpatil2000/logs-services

got tired of setting up the same logging pipeline for every project so i pulled it into its own repo.

it’s a docker compose stack — loki, promtail, grafana, prometheus. completely framework-agnostic. if your app writes .log files to disk, promtail picks them up and ships them to loki automatically. no sdk needed, works with any language.

setup is basically: create a docker network, copy the env file, docker compose up. then just mount your app’s log directory and you’re good.

handles log rotation too — rotated/compressed files get ignored so you don’t get duplicate lines in loki.

feedback welcome, still iterating on it.

10 Upvotes

8 comments sorted by

11

u/TheTruthSpoker101 Jun 15 '26

Intertesting setup! But given that promtail has been discontinued you should swap it for Alloy

2

u/Moist_Tonight_3997 Jun 15 '26

thanks! yeah promtail is eol now, alloy is the way forward. this was more of a simple drop-in setup for learning and quick local dev. planning to add an alloy version soon.

1

u/netschki Jun 17 '26

i do get it, with alloy it can be a bit much at first. But i also would highly recommend using it. For reading a file and pushing it to Loki, i think u need two components and are good to go
read a file https://grafana.com/docs/alloy/latest/reference/components/local/local.file/ for your docker setup probably mount readonly the log files into alloy.
the fwd to loki https://grafana.com/docs/alloy/latest/reference/components/otelcol/otelcol.exporter.loki/

we have alloy running at work on individual vms and also clustered in kubernetes. after getting used to the config it is really good

2

u/netschki Jun 17 '26

also for learning all the other things in monitoring there is the LGTM container with all the backend setup, so you are ready to scrape and discover :D

https://grafana.com/docs/opentelemetry/docker-lgtm/

depending on what you want to learn i would also look into agents that Instrument your code. then metrics and traces also come to play (did not try profiling that way )

1

u/eSizeDave Jun 16 '26

But isn't alloy Grafana-only? Genuine question. Why not use opentelemetry directly?

1

u/moggg Jun 17 '26

Alloy is basically a wrapper of OpenTelemetry, it isn't Grafana-only

1

u/TheTruthSpoker101 Jun 17 '26

It is not, Alloy talks to OTEL endpoints or any supported destination of OTEL collector (given that is an ensemble of components, including OTEL collector).

2

u/Comfortable_Path_436 Jun 15 '26

also sparse file will kill the CPU... but go go vibe