env: TMPL_ENV
replicaCount: 2
nodeSelector:
  node_type: worker

image:
  repository: TMPL_IMAGE_REGISTRY/third-party/prometheus/alertmanager
  tag: "v0.28.1"

ingress:
  enabled: true
  className: TMPL_NGINX_READ_INGRESS_CLASS

alertmanager:
  route:
    groupBy:
      - alertname
      - level
      - severity
      - priority
      - rule
      - cluster
      - tenant
      - cluster_id
    groupWait: 30s
    receiver: junkyard
    repeatInterval: 30m
    routes:
    # Pingcap Service Routes
    - receiver: customer
      repeatInterval: 3h
      groupBy: ['alertname', 'cluster_id', 'tidb_cluster_id', 'job_id', 'changefeed']
      continue: true
      matchers:
      - name: visibility
        value: external
        matchType: '='
    - receiver: pingcap
      groupBy: ['...']
      continue: true
      groupWait: 10s
      groupInterval: 10m
      repeatInterval: 2h
      matchers:
      - name: severity
        value: critical|emergency|blocker|major|warning
        matchType: '=~'
      routes:
        - receiver: pingcap-warning
          matchers:
          - name: severity
            value: warning
            matchType: '=~'
        - receiver: pingcap-major
          matchers:
          - name: severity
            value: major
            matchType: '=~'
  receivers:
  - name: junkyard
  - name: customer
    webhookConfigs:
      - httpConfig:
          basicAuth:
            password:
              key: password
              name: TMPL_CLINIC_SECRET_NAME
            username:
              key: username
              name: TMPL_CLINIC_SECRET_NAME
        sendResolved: true
        url: http://TMPL_CLINIC_PRIVATE_DNS/api/byoc/v1/alert
  - name: pingcap
    webhookConfigs:
      - httpConfig:
          basicAuth:
            password:
              key: password
              name: TMPL_CLINIC_SECRET_NAME
            username:
              key: username
              name: TMPL_CLINIC_SECRET_NAME
        sendResolved: true
        url: http://TMPL_CLINIC_PRIVATE_DNS/api/byoc/v1/alert
  - name: pingcap-warning
    webhookConfigs:
      - httpConfig:
          basicAuth:
            password:
              key: password
              name: TMPL_CLINIC_SECRET_NAME
            username:
              key: username
              name: TMPL_CLINIC_SECRET_NAME
        sendResolved: true
        url: http://TMPL_CLINIC_PRIVATE_DNS/api/byoc/v1/alert
  - name: pingcap-major
    webhookConfigs:
      - httpConfig:
          basicAuth:
            password:
              key: password
              name: TMPL_CLINIC_SECRET_NAME
            username:
              key: username
              name: TMPL_CLINIC_SECRET_NAME
        sendResolved: true
        url: http://TMPL_CLINIC_PRIVATE_DNS/api/byoc/v1/alert
