Issue with alerts. Why is `count (.value)` not par...
# support
e
Issue with alerts. Why is
count (.value)
not part of alert message ? Count = NULL RESULT ON SLACK:
Copy code
AlertName: ALERT: Hangfire Job Exception (scheduler services)_TEST_ALERT

Service: Company.Project.App.Scheduler

Message: Element 'SomeItems' does not match any field or property of class Company.Project.App.Something

exceptionType: FormatException

Count:
Definied metric:
Copy code
SELECT
  count() AS value,
  toStartOfInterval(timestamp, toIntervalMinute(1)) AS interval,
  serviceName,
  exceptionType,
  exceptionMessage
FROM signoz_traces.distributed_signoz_error_index_v2
WHERE exceptionType != 'OSError'
  AND serviceName ILIKE '%scheduler%'
  AND timestamp BETWEEN {{.start_datetime}} AND {{.end_datetime}}
GROUP BY serviceName, interval, exceptionType, exceptionMessage;
Alert configuration:
Copy code
labels:
  alertname: "SchedulerExceptionAlert"
  serviceName: "{{ .serviceName }}"
  exceptionMessage: "{{.exceptionMessage}}"
  exceptionType: "{{.exceptionType}}"
  count: "{{.value}}"
Alert template:
Copy code
{{ range .Alerts -}}
*AlertName:* {{ .Labels.alertname}}
*Service:* {{ .Labels.serviceName }}
*Message:* {{ .Labels.exceptionMessage}}
*exceptionType:* {{ .Labels.exceptionType}}

*Count:* {{ .Labels.count}}
{{ end }}