server:
  http_listen_port: 9080
  grpc_listen_port: 0

positions:
  filename: /tmp/positions.yaml

clients:
  - url: http://loki:3100/loki/api/v1/push

scrape_configs:
  - job_name: docker
    docker_sd_configs:
      - host: unix:///var/run/docker.sock
        refresh_interval: 10s
    relabel_configs:
      # Use the container name as a label
      - source_labels: ["__meta_docker_container_name"]
        regex: "/?(.*)"
        target_label: container
      # Use the compose service name if available
      - source_labels: ["__meta_docker_container_label_com_docker_compose_service"]
        target_label: service
      # Drop containers we don't need logs from (exporters, promtail itself)
      - source_labels: ["__meta_docker_container_label_com_docker_compose_service"]
        regex: "promtail|node-exporter|cadvisor|postgres-exporter"
        action: drop
    pipeline_stages:
      - docker: {}
      # Parse Pino JSON logs (journal, planner) to extract level
      - match:
          selector: '{service=~"journal|planner"}'
          stages:
            - json:
                expressions:
                  level: level
                  msg: msg
            - labels:
                level:
