Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why would I need Promtail when Loki4j Logback to Loki gets the data too?

I am new to developing a Kotlin application and would like to have a tool to centrally manage logs. Since I'm already using Grafana + Prometheus for monitoring, I decided to use Loki as a data source, and use loki-logback-appender in the Kotlin application to send data directly to Loki. I am able to retrieve these in Grafana.

And then there's the Promtail tool, which can do some extra things that I won't use yet (I haven't quite figured out the logging requirements yet). Why should I use it when the application itself already delivers the data to Loki?

like image 404
Michal Špondr Avatar asked Oct 12 '25 12:10

Michal Špondr


1 Answers

Why should I use it when the application itself already delivers the data to Loki?

You shouldn't: if your application already instrumented to send logs into loki there no need for Promtail.

This situation can be compared to Prometheus. If your application is instrumented with some library it exposes metrics by itself. But if not - you can use some exporter, mysql_exporter for example, to provide interface for Prometheus scraping without modification of your application itself.

like image 77
markalex Avatar answered Oct 14 '25 02:10

markalex