Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
1.7 kB ยท 44 lines
at incident-api
123456789101112131415161718192021222324252627282930313233343536373839404142434445TOKEN "endpoint__http_metrics_7d__v1_endpoint_read_5469" READNODE endpointSQL >% SELECT round(quantile(0.50)(latency)) as p50Latency, round(quantile(0.75)(latency)) as p75Latency, round(quantile(0.90)(latency)) as p90Latency, round(quantile(0.95)(latency)) as p95Latency, round(quantile(0.99)(latency)) as p99Latency, count() as count, countIf(requestStatus = 'success') AS success, countIf(requestStatus = 'degraded') AS degraded, countIf(requestStatus = 'error') AS error, max(cronTimestamp) AS lastTimestamp FROM mv__http_7d__v1 WHERE monitorId = {{ String(monitorId, '1', required=True) }} AND time >= toDateTime64(now() - INTERVAL 7 DAY, 3) {% if regions %} AND region IN {{ Array(regions, 'String', 'ams,fra') }} {% end %} UNION ALL SELECT round(quantile(0.50)(latency)) AS p50Latency, round(quantile(0.75)(latency)) AS p75Latency, round(quantile(0.90)(latency)) AS p90Latency, round(quantile(0.95)(latency)) AS p95Latency, round(quantile(0.99)(latency)) AS p99Latency, count() as count, countIf(requestStatus = 'success') AS success, countIf(requestStatus = 'degraded') AS degraded, countIf(requestStatus = 'error') AS error, NULL as lastTimestamp -- no need to query the `lastTimestamp` as not relevant FROM mv__http_14d__v1 WHERE monitorId = {{ String(monitorId, '1', required=True) }} AND time >= toDateTime64(now() - INTERVAL 14 DAY, 3) AND time < toDateTime64(now() - INTERVAL 7 DAY, 3) {% if regions %} AND region IN {{ Array(regions, 'String', 'ams,fra') }} {% end %}TYPE endpoint