rbac:
  create: false

alertmanager:
  enabled: false

configmapReload:
  alertmanager:
    enabled: false

kubeStateMetrics:
  enabled: false

nodeExporter:
  enabled: false

server:
  enabled: true

  ## Use a ClusterRole (and ClusterRoleBinding)
  ## - If set to false - we define a RoleBinding in the defined namespaces ONLY
  ##
  ## NB: because we need a Role with nonResourceURL's ("/metrics") - you must get someone with Cluster-admin privileges to define this role for you, before running with this setting enabled.
  ##     This makes prometheus work - for users who do not have ClusterAdmin privs, but wants prometheus to operate on their own namespaces, instead of clusterwide.
  ##
  ## You MUST also set namespaces to the ones you have access to and want monitored by Prometheus.
  ##
  useExistingClusterRoleName: false

  ## namespaces to monitor (instead of monitoring all - clusterwide). Needed if you want to run without Cluster-admin privileges.
  namespaces:
    - customers

  name: server

  global:
    scrape_interval: 30s
    scrape_timeout: 10s
    evaluation_interval: 1m

  ingress:
    enabled: true
    hosts: 
      - prometheus-customers.minikube.cloud
  #   path: /

  persistentVolume:
    enabled: false

  replicaCount: 1

  statefulSet:
    enabled: true

  securityContext: null
  #   runAsUser: 65534
  #   runAsNonRoot: true
  #   runAsGroup: 65534
  #   fsGroup: 65534

  service:
    servicePort: 9090
    statefulsetReplica:
      enabled: false
      replica: 0

pushgateway:
  enabled: false

## Prometheus server ConfigMap entries
##
serverFiles:
  prometheus.yml:
    rule_files:
      - /etc/config/recording_rules.yml
      - /etc/config/alerting_rules.yml

    scrape_configs:
      - job_name: prometheus
        static_configs:
          - targets:
            - localhost:9090

 
# adds additional scrape configs to prometheus.yml
# must be a string so you have to add a | after extraScrapeConfigs:
# example adds prometheus-blackbox-exporter scrape config
extraScrapeConfigs: |
  - job_name: default/infinispan-monitoring/0
    honor_timestamps: true
    scrape_interval: 30s
    scrape_timeout: 10s
    metrics_path: /actuator/prometheus
    scheme: http
    kubernetes_sd_configs:
    - role: endpoints
      namespaces:
        names:
        - customers
    relabel_configs:
    - source_labels: [__meta_kubernetes_service_label_app]
      separator: ;
      regex: customer-service-cache-springboot
      replacement: $1
      action: keep
    - source_labels: [__meta_kubernetes_endpoint_port_name]
      separator: ;
      regex: http
      replacement: $1
      action: keep
    - source_labels: [__meta_kubernetes_endpoint_address_target_kind, __meta_kubernetes_endpoint_address_target_name]
      separator: ;
      regex: Node;(.*)
      target_label: node
      replacement: ${1}
      action: replace
    - source_labels: [__meta_kubernetes_endpoint_address_target_kind, __meta_kubernetes_endpoint_address_target_name]
      separator: ;
      regex: Pod;(.*)
      target_label: pod
      replacement: ${1}
      action: replace
    - source_labels: [__meta_kubernetes_namespace]
      separator: ;
      regex: (.*)
      target_label: namespace
      replacement: $1
      action: replace
    - source_labels: [__meta_kubernetes_service_name]
      separator: ;
      regex: (.*)
      target_label: service
      replacement: $1
      action: replace
    - source_labels: [__meta_kubernetes_pod_name]
      separator: ;
      regex: (.*)
      target_label: pod
      replacement: $1
      action: replace
    - source_labels: [__meta_kubernetes_service_name]
      separator: ;
      regex: (.*)
      target_label: job
      replacement: ${1}
      action: replace
    - separator: ;
      regex: (.*)
      target_label: endpoint
      replacement: http
      action: replace
# Adds option to add alert_relabel_configs to avoid duplicate alerts in alertmanager
# useful in H/A prometheus with different external labels but the same alerts
