Skip to content

Open-source status page, incident response and uptime monitoring

553 B
Raw Blame
TOKEN "endpoint__http_status_14d__v0_endpoint_read_8823" READ

NODE endpoint
SQL >

%
SELECT
    time as day,
    countMerge(total) as total,
    countMerge(success) as success,
    countMerge(error) as error,
    countMerge(degraded) as degraded
FROM mv__http_status_14d__v0
WHERE monitorId = {{ String(monitorId, '1', required=True) }}
GROUP BY day
ORDER BY day DESC
WITH FILL
FROM
    toStartOfDay(toStartOfDay(toTimeZone(now(), 'UTC')))
    TO toStartOfDay(date_sub(DAY, 14, now())) STEP INTERVAL -1 DAY
LIMIT {{ Int16(days, 14) }}

TYPE endpoint