global:
  scrape_interval: 30s
  external_labels:
    prometheus: default/test
    prometheus_replica: $(POD_NAME)
  evaluation_interval: 30s
scrape_configs:
- job_name: serviceMonitor/default/defaultServiceMonitor/0
  honor_labels: false
  kubernetes_sd_configs:
  - role: endpoints
    namespaces:
      names:
      - default
  scrape_interval: 30s
  relabel_configs:
  - source_labels:
    - job
    target_label: __tmp_prometheus_job_name
  - action: keep
    source_labels:
    - __meta_kubernetes_service_label_group
    - __meta_kubernetes_service_labelpresent_group
    regex: (group1);true
  - action: keep
    source_labels:
    - __meta_kubernetes_endpoint_port_name
    regex: web
  - source_labels:
    - __meta_kubernetes_endpoint_address_target_kind
    - __meta_kubernetes_endpoint_address_target_name
    separator: ;
    regex: Node;(.*)
    replacement: ${1}
    target_label: node
  - source_labels:
    - __meta_kubernetes_endpoint_address_target_kind
    - __meta_kubernetes_endpoint_address_target_name
    separator: ;
    regex: Pod;(.*)
    replacement: ${1}
    target_label: pod
  - source_labels:
    - __meta_kubernetes_namespace
    target_label: namespace
  - source_labels:
    - __meta_kubernetes_service_name
    target_label: service
  - source_labels:
    - __meta_kubernetes_pod_name
    target_label: pod
  - source_labels:
    - __meta_kubernetes_pod_container_name
    target_label: container
  - action: drop
    source_labels:
    - __meta_kubernetes_pod_phase
    regex: (Failed|Succeeded)
  - source_labels:
    - __meta_kubernetes_service_name
    target_label: job
    replacement: ${1}
  - target_label: endpoint
    replacement: web
  - source_labels:
    - __address__
    - __tmp_hash
    target_label: __tmp_hash
    regex: (.+);
    replacement: $1
    action: replace
  - source_labels:
    - __tmp_hash
    target_label: __tmp_hash
    modulus: 1
    action: hashmod
  - source_labels:
    - __tmp_hash
    - __tmp_disable_sharding
    regex: $(SHARD);|.+;.+
    action: keep
- job_name: podMonitor/default/defaultPodMonitor/0
  honor_labels: false
  kubernetes_sd_configs:
  - role: pod
    namespaces:
      names:
      - default
  scrape_interval: 30s
  relabel_configs:
  - source_labels:
    - job
    target_label: __tmp_prometheus_job_name
  - action: drop
    source_labels:
    - __meta_kubernetes_pod_phase
    regex: (Failed|Succeeded)
  - action: keep
    source_labels:
    - __meta_kubernetes_pod_label_group
    - __meta_kubernetes_pod_labelpresent_group
    regex: (group1);true
  - action: keep
    source_labels:
    - __meta_kubernetes_pod_container_port_name
    regex: web
  - source_labels:
    - __meta_kubernetes_namespace
    target_label: namespace
  - source_labels:
    - __meta_kubernetes_pod_container_name
    target_label: container
  - source_labels:
    - __meta_kubernetes_pod_name
    target_label: pod
  - target_label: job
    replacement: default/defaultPodMonitor
  - target_label: endpoint
    replacement: web
  - source_labels:
    - __address__
    - __tmp_hash
    target_label: __tmp_hash
    regex: (.+);
    replacement: $1
    action: replace
  - source_labels:
    - __tmp_hash
    target_label: __tmp_hash
    modulus: 1
    action: hashmod
  - source_labels:
    - __tmp_hash
    - __tmp_disable_sharding
    regex: $(SHARD);|.+;.+
    action: keep
- job_name: probe/default/defaultProbe
  honor_timestamps: true
  metrics_path: /probe
  scheme: http
  params:
    module:
    - http_2xx
  static_configs:
  - targets:
    - prometheus.io
    - promcon.io
    labels:
      namespace: custom
      static: label
  relabel_configs:
  - source_labels:
    - job
    target_label: __tmp_prometheus_job_name
  - source_labels:
    - __address__
    target_label: __param_target
  - source_labels:
    - __param_target
    target_label: instance
  - target_label: __address__
    replacement: blackbox.exporter.io
  - source_labels:
    - __param_target
    - __tmp_hash
    target_label: __tmp_hash
    regex: (.+);
    replacement: $1
    action: replace
  - source_labels:
    - __tmp_hash
    target_label: __tmp_hash
    modulus: 1
    action: hashmod
  - source_labels:
    - __tmp_hash
    - __tmp_disable_sharding
    regex: $(SHARD);|.+;.+
    action: keep
  metric_relabel_configs:
  - regex: noisy_labels.*
    action: labeldrop
- job_name: scrapeConfig/default/defaultScrapeConfig
  http_sd_configs:
  - proxy_url: http://no-proxy.com
    no_proxy: 0.0.0.0
    proxy_from_environment: false
    url: http://localhost:9100/sd.json
    refresh_interval: 5m
  relabel_configs:
  - source_labels:
    - job
    target_label: __tmp_prometheus_job_name
