Promtail

Definition

Promtail is an agent that is used to collect logs from various sources and send them to Loki, a log aggregation system. It is designed to work seamlessly with Kubernetes, but it can also be configured to collect logs from other environments. Promtail reads logs from files, such as those generated by Docker containers, and forwards them to Loki for centralized storage and querying.

Secure Settings Example

server:
  http_listen_port: 9080
  grpc_listen_port: 0

positions:
  filename: /var/log/positions.yaml

clients:
  - url: https://loki.example.com/loki/api/v1/push
    basic_auth:
      username: loki_user
      password: loki_password

scrape_configs:
  - job_name: system
    static_configs:
      - targets:
          - localhost
        labels:
          job: varlogs
          __path__: /var/log/*.log

Insecure Settings Example

server:
  http_listen_port: 9080
  grpc_listen_port: 0

positions:
  filename: /var/log/positions.yaml

clients:
  - url: http://loki.example.com/loki/api/v1/push

scrape_configs:
  - job_name: system
    static_configs:
      - targets:
          - localhost
        labels:
          job: varlogs
          __path__: /var/log/*.log