Open-source status page, incident response and uptime monitoring
TypeScript alertingincident-managementmcpmcp-servermonitoringmonitoring-as-codeobservabilityon-callopen-sourcesrestatus-pagestatuspagesynthetic-monitoringterraformtinybirdtursouptimeuptime-checkeruptime-monitor
TOKEN "endpoint__tcp_metrics_14d__v1_endpoint_read_5043" READ
NODE endpoint
SQL >
%
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__tcp_14d__v1
WHERE
monitorId = {{ String(monitorId, '4433', required=True) }}
AND time >= toDateTime64(now() - INTERVAL 14 DAY, 3)
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__tcp_30d__v1
WHERE
monitorId = {{ String(monitorId, '4433', required=True) }}
AND time >= toDateTime64(now() - INTERVAL 28 DAY, 3)
AND time < toDateTime64(now() - INTERVAL 14 DAY, 3)
TYPE endpoint
NODE endpoint__tcp_metrics_14d__v1_1
SQL >
SELECT * FROM endpoint