#support

Creating Alerts Based on Custom Exception Messages

TLDR ma asked how to create alerts from custom exception messages. Pranay suggested using trace data but Srikanth clarified that exceptions are stored separately and suggested using a ClickHouse query instead, providing an example.

Powered by Struct AI
3
3w
Solved
Join the chat
Nov 02, 2023 (3 weeks ago)
ma
Photo of md5-85ec814bda5ed3241e448de91292ecb1
ma
01:45 AM
#support how to create new alert based on some custom message in exception? For example I want to filter by exception.type . How to write the query
Image 1 for <#C01HWQ1R0BC|support> how to create new alert based on some custom message in exception? For example I want to filter by exception.type . How to write the query
Pranay
Photo of md5-8df7ce0274b2473ec07403336e48b574
Pranay
05:13 PM
Have you tried creating alerts based on traces, as exceptions data is available in traces
Image 1 for Have you tried creating alerts based on traces, as exceptions data is available in traces
Nov 03, 2023 (3 weeks ago)
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
02:32 AM
Pranay that's not possible because exceptions are stored separately and can't be searched. Only tags are usable in the traces. ma alternative is to write ClickHouse query. You can find examples here https://signoz.io/docs/tutorial/writing-clickhouse-queries-in-dashboard/.
example
SELECT count() AS value, toStartOfInterval(timestamp, INTERVAL 5 MINUTE) AS interval 
FROM signoz_traces.signoz_error_index_v2 
WHERE timestamp BETWEEN {{.start_datetime}} AND {{.end_datetime}} 
AND (serviceName = 'api-service') 
AND (exceptionType = 'Not found') 
GROUP BY interval