mr-karan / calert

🔔 Send alert notifications to Google Chat via Prometheus Alertmanager
MIT License
158 stars 58 forks source link

Alert template error #78

Open NYARAS opened 6 months ago

NYARAS commented 6 months ago

Alert templating *({{.Labels.severity | toUpper }}) fails when you don't have severity in alert rules into a string.

Example:

        - alert: High Node CPU Usage
          annotations:
            summary: Example summary
          expr: |
            <Example Expr>
          for: 5m
          labels:
            team: devops
            severity: "critical"

This will pass but

        - alert: High Node CPU Usage
          annotations:
            summary: Example summary
          expr: |
            <Example Expr>
          for: 5m
          labels:
            team: devops
            severity: critical # without quotes

This fails with msg="Error parsing values in template" error="template: message.tmpl:1:23: executing \"message.tmpl\" at <toUpper>: invalid value; expected string"