global:
  scrape_interval: 5s
  evaluation_interval: 5s
rule_files:
  - /etc/prometheus/prometheus.rules
alerting:
  alertmanagers:
  #- scheme: http
  - static_configs:
    - targets:
     # - "alertmanager.monitoring.svc:9093"
scrape_configs:
  - job_name: 'kubernetes-apiservers'
    kubernetes_sd_configs:
    - role: endpoints
    scheme: https
    tls_config:
      ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
    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: 'kubernetes-nodes'
    scheme: https
    tls_config:
      ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
    bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
    kubernetes_sd_configs:
    - role: node
    relabel_configs:
    - action: labelmap
      regex: __meta_kubernetes_node_label_(.+)
    - target_label: __address__
      replacement: kubernetes.default.svc:443
    - source_labels: [__meta_kubernetes_node_name]
      regex: (.+)
      target_label: __metrics_path__
      replacement: /api/v1/nodes/${1}/proxy/metrics

  #- job_name: 'k8pods'
   # kubernetes_sd_configs:
    #- role: pod
    #relabel_configs:
    #- source_labels: [__meta_kubernetes_pod_container_name]
     # target_label: job
    #- source_labels: [__meta_kubernetes_namespace]
     # target_label: namespace

  - job_name: 'jenkins'
    #scrape_interval: 5m
    #scrape_timeout: 1m
    metrics_path: '/prometheus'
    scheme: http
    static_configs:
    - targets: ['65.1.95.23:32000']

  - job_name: 'sonarqube'
    metrics_path: '/api/monitoring/metrics'
    basic_auth:
      username: 'admin'
      password: '9YesakuZOVEjS4MyJ'
    scheme: http
    static_configs:
    - targets: ['65.1.95.23:32001']

  - job_name: 'e-search'
    metrics_path: '/metrics'
    static_configs:
    - targets: ['10.105.168.247:9114']

  - job_name: 'kubernetes-service-endpoints'
    kubernetes_sd_configs:
    - role: endpoints
    relabel_configs:
    - action: labelmap
      regex: __meta_kubernetes_service_label_(.+)
    - source_labels: [__meta_kubernetes_namespace]
      action: replace
      target_label: kubernetes_namespace
    - source_labels: [__meta_kubernetes_service_name]
      action: replace
      target_label: kubernetes_name

  #- job_name: "kafka-server"
   # static_configs:
    #- targets: ["65.1.95.23:30518"]

