Skip to content

Open-source status page, incident response and uptime monitoring

842 B
Raw Blame
NODE endpoint
SQL >

%
    SELECT
        region,
        toStartOfInterval(
            toDateTime(cronTimestamp / 1000),
            INTERVAL {{ Int64(interval, 30) }} MINUTE -- use 2880 (2d) in case you want the 1d summary for the regions
        ) as h,
        toUnixTimestamp64Milli(toDateTime64(h, 3)) as timestamp,
        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
    FROM mv__http_1d__v0
    WHERE
        monitorId = {{ String(monitorId, '1', required=True) }}
        {% if regions %} AND region IN {{ Array(regions, 'String', 'ams,fra') }} {% end %}
    GROUP BY h, region
    ORDER BY h DESC

TYPE endpoint