/docker-promtail-loki

Docker Compose Stack with Grafana Loki and Promtail

Primary LanguageMakefile

docker-promtail-loki

Docker Compose Stack with Grafana Loki, Promtail and the Grafana Explore Logs plugin.

Note

For a full example with prometheus, alertmanager, cadvisor, node-exporter and loki, please see the following repo:

Usage

Start the stack with:

make up

Access nginx on http://localhost:8080

View Logs

image

Then navigate to grafana on http://localhost:3000 and select explore on the left and select the container:

image

And you will see the logs:

image

Explore Logs

The grafana explore-logs app can be found under explore:

image

Any application that logs to Loki can be discovered here:

image

Here we can view the log content for the selected service_name:

image

This view we can explore the different labels thats available for our selected service:

image

For example, we can select the level label, which will then append that to our LogQL query and present us with this view:

image

We can then include error for example and we will see all the error logs for our selected service:

image

We can then also select "Open in Explore" and our query will be pre-populated for us, eg. {service_name="tempo-ingester", level="error"} | logfmt:

image

We can also explore logs by fields:

image

As well as patterns:

image

For more information about exploring logs without LogQL, view Grafana's blog post: