apiVersion: v1
kind: ConfigMap
metadata:
  name: prometheus
data:
  prometheus.yml: |-
    global:
      scrape_interval: 15s
    rule_files:
    - '/etc/prometheus-rules/alert.rules'
    scrape_configs:
    # etcd is living outside of our cluster and we configure
    # it directly.
    - job_name: 'etcd_compose'
      scheme: https
      tls_config:
        insecure_skip_verify: true
      static_configs:
      - targets: ['{{.Values.prometheus.etcd_urls}}']

    - job_name: 'push_gateway'
      scheme: http
      honor_labels: true
      static_configs:
      - targets: ["pushgateway:9091"]
      relabel_configs:
      - source_labels: [instance]
        target_label: instance
        replacement: {{.Values.prometheus.cluster_name}}
      - source_labels: [job]
        target_label: job
        replacement: {{.Values.env}}

    - job_name: 'statsd_exporter'
      scheme: http
      static_configs:
      - targets: ["pushgateway:9102"]
      relabel_configs:
      - source_labels: [instance]
        target_label: instance
        replacement: {{.Values.prometheus.cluster_name}}
      - source_labels: [job]
        target_label: job
        replacement: {{.Values.env}}
