global:
  scrape_interval: 5s

scrape_configs:
  - job_name: 'docker-spring-apps'
    metrics_path: /actuator/prometheus
    docker_sd_configs:
      - host: "unix:///var/run/docker.sock"
        refresh_interval: 10s
    relabel_configs:
      - source_labels: [__meta_docker_container_label_monitor]
        action: keep
        regex: true

      - source_labels: [__meta_docker_container_label_com_docker_compose_service]
        target_label: service

      - source_labels: [__meta_docker_container_name]
        target_label: instance
        regex: ^/(.*)$
        replacement: $1