Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/ruanbekker/docker-promtail-loki

Docker Compose Stack with Grafana Loki and Promtail
https://github.com/ruanbekker/docker-promtail-loki

docker docker-compose grafana logging loki promtail

Last synced: about 13 hours ago
JSON representation

Docker Compose Stack with Grafana Loki and Promtail

Awesome Lists containing this project

README

        

# docker-promtail-loki
Docker Compose Stack with Grafana Loki, Promtail and the Grafana [Explore Logs](https://grafana.com/blog/2024/04/09/find-your-logs-data-with-explore-logs-no-logql-required/) plugin.

> [!NOTE]
> For a full example with prometheus, alertmanager, cadvisor, node-exporter and loki, please see the following repo:
> - https://github.com/ruanbekker/docker-monitoring-stack-gpnc

## Usage

Start the stack with:

```bash
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](https://github.com/user-attachments/assets/14aa2b93-8baf-441b-bd18-eeade5dd575c)

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:
- [Find your logs data with Explore Logs: No LogQL required!](https://grafana.com/blog/2024/04/09/find-your-logs-data-with-explore-logs-no-logql-required/)