<#C01HWQ1R0BC|support> how to create new alert bas...
# support
m
#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
Have you tried creating alerts based on traces, as exceptions data is available in traces
s
@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