groups:
  - name: serverless.cert-manager.rules
    rules:
      - alert: ServerlessCertsRenewed
        annotations:
          message: |
            The cert {{ $labels.namespace }}/{{ $labels.name }} renewed. Some certificate in the namespace tidb-serverless has been renewed.
            It might require the restart the corresponding service to reload the latest certificate before the old certificate is expired (about 15 days later).
        expr: |
          certmanager_certificate_expiration_timestamp_seconds - time() < (15 * 24 * 3600 - 3600) # 14d23h
        for: 10m
        labels:
          severity: major
          response_class: ticket
          tier: serverless
          provider_type: aws-free-tier
          component: cert-manager
          oncall_team: serverless
