Slackbot
10/03/2022, 8:54 AMAnkit Nayan
Łukasz Herman
11/17/2022, 11:00 AMnitya-signoz
11/17/2022, 11:23 AMCount of logs over time
select toStartOfInterval(fromUnixTimestamp64Nano(timestamp), INTERVAL 1 MINUTE) AS interval, toFloat64(count()) as value from signoz_logs.logs where timestamp > toUnixTimestamp64Nano(now64() - INTERVAL 30 MINUTE) group by interval order by interval asc;
Count of error logs over time
select toStartOfInterval(fromUnixTimestamp64Nano(timestamp), INTERVAL 1 MINUTE) AS interval, toFloat64(count()) as value from signoz_logs.logs where timestamp > toUnixTimestamp64Nano(now64() - INTERVAL 30 MINUTE) AND stream='stderr' group by interval order by interval asc;
Quantile
select toStartOfInterval(fromUnixTimestamp64Nano(timestamp), INTERVAL 1 MINUTE) AS interval, quantile(0.9)(bytes) as value from signoz_logs.logs where timestamp > toUnixTimestamp64Nano(now64() - INTERVAL 30 MINUTE) group by interval order by interval asc;
Please note that things in the where clause are interesting fields.
For more aggregate functions refer to https://clickhouse.com/docs/en/sql-reference/aggregate-functions/reference/SigNoz is an open-source APM. It helps developers monitor their applications & troubleshoot problems, an open-source alternative to DataDog, NewRelic, etc.
Powered by