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:
Start the stack with:
make up
Access nginx on http://localhost:8080
Then navigate to grafana on http://localhost:3000 and select explore on the left and select the container:
And you will see the logs:
The grafana explore-logs app can be found under explore:
Any application that logs to Loki can be discovered here:
Here we can view the log content for the selected service_name
:
This view we can explore the different labels thats available for our selected service:
For example, we can select the level
label, which will then append that to our LogQL query and present us with this view:
We can then include error
for example and we will see all the error logs for our selected service:
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
:
We can also explore logs by fields:
As well as patterns:
For more information about exploring logs without LogQL, view Grafana's blog post: