Collect logs#
Promtail is the agent responsible of collecting the logs.
Howto#
By default we collect all the logs of all the pods.
There is nothing to configure.
Labels#
Labels allow us to filter logs.
Promtail send logs to Loki along with a set of labels :
- labels from Kubernetes (same as Prometheus)
jobnamespacecontainer_name- ...
Logs can usually be selected with job and namespace label. But you may prefer to use the K8S labels of your pods.
Note
Kubernetes labels and Loki labels are not the same concept. However, Kubernetes labels are usually copied as Loki labels.This may lead to confusion, but it is not a problem because they are the same.