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:
  # Docker container logs
  - job_name: docker
    docker_sd_configs:
      - host: unix:///var/run/docker.sock
        refresh_interval: 5s
        filters:
          - name: label
            values: ["com.docker.compose.project=provisioning"]

    relabel_configs:
      - source_labels: ['__meta_docker_container_name']
        regex: '/(.*)'
        target_label: 'container'

      - source_labels: ['__meta_docker_container_log_stream']
        target_label: 'stream'

      - source_labels: ['__meta_docker_container_label_com_docker_compose_service']
        target_label: 'service'

  # System logs
  - job_name: system
    static_configs:
      - targets:
          - localhost
        labels:
          job: varlogs
          __path__: /var/log/*log

  # Application logs
  - job_name: orchestrator
    static_configs:
      - targets:
          - localhost
        labels:
          job: orchestrator
          __path__: /var/lib/docker/volumes/provisioning_orchestrator-logs/_data/*.log

  - job_name: control-center
    static_configs:
      - targets:
          - localhost
        labels:
          job: control-center
          __path__: /var/lib/docker/volumes/provisioning_control-center-logs/_data/*.log
