An open API service indexing awesome lists of open source software.

https://github.com/ghusta/java-loki-demo

Demo Java / Loki / Grafana
https://github.com/ghusta/java-loki-demo

java loki

Last synced: 4 months ago
JSON representation

Demo Java / Loki / Grafana

Awesome Lists containing this project

README

        

= Demo Java / Loki / Grafana

== Overview

Demo for testing :

* Java
* Loki with Logback (_https://github.com/loki4j/loki-logback-appender[loki-logback-appender]_)
* Grafana

== Run the demo

=== Start Loki and Grafana instances

With Docker :

[source,bash]
----
docker compose up -d
----

Open Grafana at : http://localhost:3000/explore

Check Loki at :

* http://localhost:3100/ready (readiness)
* http://localhost:3100/metrics (Prometheus metrics)

=== Generate logs with Java

Execute `com.example.Demo`.

== References

* https://grafana.com/docs/loki/latest/[Grafana Loki documentation]
** https://grafana.com/docs/loki/latest/get-started/[Get started]
** https://grafana.com/docs/loki/latest/get-started/overview/[Loki overview]
** https://grafana.com/docs/loki/latest/query/[LogQL: Log query language]
** https://grafana.com/docs/loki/latest/query/logcli/[LogCLI]
* https://piotrminkowski.com/2023/07/05/logging-in-spring-boot-with-loki/