Idimmachukwu Okoro
01/20/2023, 12:31 PMSrikanth Chekuri
01/20/2023, 2:25 PMIdimmachukwu Okoro
01/20/2023, 2:26 PMSrikanth Chekuri
01/22/2023, 10:45 PMI have instrumented a python app, Now I want to send an alert to slack whenever a link returns anything with status code other than 2xx, but with a message explaining why.Where does this explanation come from? I am not sure I fully understand the part “a link returns anything with status code other than 2xx”. I hope the link you are here referring to is the endpoint because python wouldn’t know the “links”; the fronted knows the links. Here is the query that gives the number of times there were non 2xx codes for a minute interval
SELECT
toStartOfInterval(timestamp, toIntervalMinute(1)) AS interval,
httpCode,
toFloat64(count()) AS num_times
FROM signoz_traces.distributed_signoz_index_v2
WHERE (httpCode != '') AND (httpCode NOT LIKE '2%%') AND (timestamp > (now() - toIntervalMinute(30)))
GROUP BY (httpCode, interval)
ORDER BY (httpCode, interval) ASC
when a route takes more than 5s to respond with a neat message containing the route
SELECT
toStartOfInterval(timestamp, toIntervalMinute(1)) AS interval,
httpRoute,
toFloat64(count()) AS num_times
FROM signoz_traces.distributed_signoz_index_v2
WHERE (httpRoute != '') AND ((durationNano / 1000000000) > 5) AND (timestamp > (now() - toIntervalMinute(30)))
GROUP BY (httpRoute, interval)
ORDER BY (httpRoute, interval) ASC
when there is an error/exception with the error log info to slack
SELECT toFloat64(count()) AS value, toStartOfInterval(timestamp, INTERVAL 5 MINUTE) AS interval, serviceName, exceptionType, exceptionMessage
FROM signoz_traces.distributed_signoz_error_index_v2
WHERE timestamp > now() - INTERVAL 30 MINUTE
GROUP BY interval, serviceName, exceptionType, exceptionMessage
The exception message can be used in alert descriptionIdimmachukwu Okoro
01/23/2023, 7:27 AM