https://signoz.io logo
#support
Title
# support
m

ma bo

11/02/2023, 1: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
p

Pranay

11/02/2023, 5:13 PM
Have you tried creating alerts based on traces, as exceptions data is available in traces
s

Srikanth Chekuri

11/03/2023, 2: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 bo alternative is to write ClickHouse query. You can find examples here https://signoz.io/docs/tutorial/writing-clickhouse-queries-in-dashboard/. example
Copy code
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