apiVersion: v1
kind: ConfigMap
metadata:
  name: prometheus-config
  namespace: monitoring
data:
  prometheus.yml: |
    global:
      scrape_interval:     15s
      evaluation_interval: 15s
    alerting:
      alertmanagers:
      - static_configs:
        - targets:
    rule_files:
      # - "example-file.yml"
    scrape_configs:
            # MS-Demo App
      - job_name: 'ms-demo-service'
        # Override the global default and scrape targets from this job every 5 seconds.
        scrape_interval: 5s
        metrics_path: /actuator/prometheus
        static_configs:
                # Use the service name (see docker-compose-desktop.yml) instead of localhost
        - targets: ['ms-demo-service.default.svc:8080']

      - job_name: 'ms-demo-ingress'
          # Override the global default and scrape targets from this job every 5 seconds.
          scrape_interval: 5s
          honor_timestamps: true
          metrics_path: /metrics
          scheme: http
          static_configs:
            # Use the service name (see docker-compose-desktop.yml) instead of localhost
            - targets: ['ingress-controller-ingress-nginx-controller-metrics.ingress-nginx.svc:10254']
