scrape_configs:
- job_name: cadvisor
  scheme: https
  metrics_path: /metrics/cadvisor
  scrape_interval: 30s
  label_limit: 63
  label_name_length_limit: 511
  label_value_length_limit: 1023
  tls_config:
    ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
    insecure_skip_verify: true
  bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
  metric_relabel_configs:
  - source_labels: [__name__]
    action: keep
    regex: "up"
  kubernetes_sd_configs:
  - role: node

- job_name: kubelet
  scheme: https
  metrics_path: /metrics
  scrape_interval: 30s
  label_limit: 63
  label_name_length_limit: 511
  label_value_length_limit: 1023
  tls_config:
    ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
    insecure_skip_verify: true
  bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
  relabel_configs:
  - source_labels: [__metrics_path__]
    regex: (.*)
    target_label: metrics_path
  - source_labels: [__meta_kubernetes_node_label_kubernetes_io_os]
    target_label: "kubernetes_io_os"
  metric_relabel_configs:
  - source_labels: [__name__]
    action: keep
    regex: "up"
  kubernetes_sd_configs:
  - role: node

- job_name: kube-dns
  scrape_interval: 30s
  label_limit: 63
  label_name_length_limit: 511
  label_value_length_limit: 1023
  honor_labels: true
  kubernetes_sd_configs:
  - role: pod
  relabel_configs:
  - action: keep
    source_labels: [__meta_kubernetes_namespace,__meta_kubernetes_pod_name]
    separator: '/'
    regex: 'kube-system/coredns.+'
  - source_labels: [__meta_kubernetes_pod_container_port_name]
    action: keep
    regex: metrics
  - source_labels:[__meta_kubernetes_pod_name]
    target_label: pod

- job_name: kube-proxy
  scrape_interval: 30s
  label_limit: 63
  label_name_length_limit: 511
  label_value_length_limit: 1023
  kubernetes_sd_configs:
  - role: pod
  relabel_configs:
  - action: keep
    source_labels: [__meta_kubernetes_namespace,__meta_kubernetes_pod_name]
    separator: '/'
    regex: 'kube-system/kube-proxy.+'
  - source_labels:
    - __address__
    action: replace
    target_label: __address__
    regex: (.+?)(\\:\\d+)?
    replacement: $$1:10249

- job_name: kube-apiserver
  scrape_interval: 30s
  label_limit: 63
  label_name_length_limit: 511
  label_value_length_limit: 1023
  kubernetes_sd_configs:
  - role: endpoints
  scheme: https
  tls_config:
    ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
    insecure_skip_verify: true
  bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
  relabel_configs:
  - source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name]
    action: keep
    regex: default;kubernetes;https

- job_name: node
  scrape_interval: 30s
  label_limit: 63
  label_name_length_limit: 511
  label_value_length_limit: 1023
  scheme: http
  kubernetes_sd_configs:
    - role: endpoints
      namespaces:
        names:
        - node-exporter-namespace
  relabel_configs:
    - source_labels: [__meta_kubernetes_endpoints_name]
      action: keep
      regex: "dev-cluster-node-exporter-release-prometheus-node-exporter"
    - source_labels: [__metrics_path__]
      regex: (.*)
      target_label: metrics_path
    - source_labels: [__meta_kubernetes_endpoint_node_name]
      regex: (.*)
      target_label: instance
  metric_relabel_configs:
  - source_labels: [__name__]
    action: keep
    regex: "up"

- job_name: kube-state-metrics
  scrape_interval: 30s
  label_limit: 63
  label_name_length_limit: 511
  label_value_length_limit: 1023
  static_configs:
    - targets: ['dev-cluster-kube-state-metrics-release.kube-state-metrics.svc.cluster.local:8080']

- job_name: windows-exporter
  scheme: http
  scrape_interval: 30s
  label_limit: 63
  label_name_length_limit: 511
  label_value_length_limit: 1023
  tls_config:
    ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
    insecure_skip_verify: true
  bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
  kubernetes_sd_configs:
  - role: node
  relabel_configs:
  - action: keep
    source_labels: [__meta_kubernetes_node_label_kubernetes_io_os]
    regex: windows
  - source_labels:
    - __address__
    action: replace
    target_label: __address__
    regex: (.+?)(\:\d+)?
    replacement: $$1:9182

- job_name: kube-proxy-windows
  scheme: http
  scrape_interval: 30s
  label_limit: 63
  label_name_length_limit: 511
  label_value_length_limit: 1023
  tls_config:
    ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
    insecure_skip_verify: true
  bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
  kubernetes_sd_configs:
  - role: node
  relabel_configs:
  - action: keep
    source_labels: [__meta_kubernetes_node_label_kubernetes_io_os]
    regex: windows
  - source_labels:
    - __address__
    action: replace
    target_label: __address__
    regex: (.+?)(\:\d+)?
    replacement: $$1:10249

- job_name: prometheus_collector_health
  label_limit: 63
  label_name_length_limit: 511
  label_value_length_limit: 1023
  static_configs:
  - targets: ['127.0.0.1:2234']

- job_name: kubelet-windows
  scheme: https
  metrics_path: /metrics
  scrape_interval: 30s
  label_limit: 63
  label_name_length_limit: 511
  label_value_length_limit: 1023
  tls_config:
    ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
    insecure_skip_verify: true
  bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
  relabel_configs:
  - source_labels: [__metrics_path__]
    regex: (.*)
    target_label: metrics_path
  - source_labels: [__meta_kubernetes_node_label_kubernetes_io_os]
    action: keep
    regex: "windows"
  metric_relabel_configs:
  - source_labels: [__name__]
    action: keep
    regex: "up"
  kubernetes_sd_configs:
  - role: node
