Promtail : is a collector which ships the contents of local logs to a private Grafana Loki instance or Grafana Cloud. It is usually deployed to every machine that has applications needed to be monitored.
Loki : is a search engine for logs inspired by Prometheus.
OTEL Collector : is vendor-agnostic way to receive, process and export telemetry data.
Tempo : is a distributed tracing backend.
Grafana : is a query frontend to output data.
cd monitoring
# start containers
docker-compose up -d
# FIXME: maybe we can remove manual setups with help of a config or automation?
- Go to page of grafana: https://127.0.0.1:3000/
- Use login and password "admin"
- Add Loki data source: https://loki:3100
- "Save & Exit" should give "Data source connected and labels found." if everything is okay.
- Go to "Explore" tab and make a query "{job="varlogs"} |= ``".
- Navigate to Grafana
- Enter "admin" for both username and password [skip if it asks for updating the password]
- Add data source (Tempo)
- select
Tempo
- set
URL
tohttps://tempo:3200
- save
- select
- Add data source (Loki)
- select Loki
- make it default
- set
URL
tohttps://loki:3100
- add
Derived fields
- - set
Name
totrace_id
- set
Regex
totrace_id":"(.*?)"(?=,|}|$)
- set
URL
to${__value.raw}
- set
URL label
toTempo
- enable
Internal link
and selectTempo
- save
- Navigate to Explore
- Add query [example,
job
=router
]
- Use
trace_id
in logs to jump to Tempo view to visualize the tracing. - Searching through recent trace ids is also possible by selecting appropriate
Service Name
in Tempo view underSearch
tab. The UI also provides other filter options.
https://127.0.0.1:3100/ready
: To get status of Loki, it should give "Ready".
docker container ls -as
: List running containers.
docker exec -it monitoring_promtail_1 bash
: Look inside of promtail container.
docker-compose down
: Stop containers