Openstatus www.openstatus.dev

chore: update tb pipes and datasources (#1081)

authored by

Maximilian Kaske and committed by
GitHub
64c14125 38076377

+241 -1052
-1
apps/web/src/components/forms/monitor/section-scheduling.tsx
··· 153 153 item.code, 154 154 )} 155 155 onCheckedChange={(checked) => { 156 - console.log(field.value); 157 156 return checked 158 157 ? field.onChange([ 159 158 ...(field.value
+7 -5
packages/tinybird/datasources/__ttl_14d_mv.datasource packages/tinybird/datasources/mv__http_14d.datasource
··· 1 - # Data Source created from Pipe '__ttl_14d__v0' 2 1 VERSION 0 2 + # Data Source created from Pipe 'aggregate__http_14d__v0' 3 3 4 4 SCHEMA > 5 5 `time` DateTime, 6 6 `latency` Int64, 7 - `monitorId` String, 7 + `error` Int8, 8 8 `region` LowCardinality(String), 9 + `trigger` Nullable(String), 9 10 `statusCode` Nullable(Int16), 10 - `url` String, 11 - `workspaceId` String, 12 - `cronTimestamp` Int64 11 + `timestamp` Int64, 12 + `cronTimestamp` Int64, 13 + `monitorId` String, 14 + `workspaceId` String 13 15 14 16 ENGINE "MergeTree" 15 17 ENGINE_PARTITION_KEY "toYYYYMM(time)"
+6 -5
packages/tinybird/datasources/__ttl_1d_mv.datasource packages/tinybird/datasources/mv__http_1d.datasource
··· 1 - # Data Source created from Pipe '__ttl_1d__v0' 2 1 VERSION 0 2 + # Data Source created from Pipe 'aggregate__http_1d__v0' 3 3 4 4 SCHEMA > 5 5 `time` DateTime, 6 6 `latency` Int64, 7 - `monitorId` String, 7 + `error` Int8, 8 8 `region` LowCardinality(String), 9 + `trigger` Nullable(String), 9 10 `statusCode` Nullable(Int16), 10 - `url` String, 11 - `workspaceId` String, 12 11 `timestamp` Int64, 13 - `cronTimestamp` Int64 12 + `cronTimestamp` Int64, 13 + `monitorId` String, 14 + `workspaceId` String 14 15 15 16 ENGINE "MergeTree" 16 17 ENGINE_PARTITION_KEY "toYYYYMM(time)"
-18
packages/tinybird/datasources/__ttl_1h_mv.datasource
··· 1 - # Data Source created from Pipe '__ttl_1h__v0' 2 - VERSION 0 3 - 4 - SCHEMA > 5 - `time` DateTime, 6 - `latency` Int64, 7 - `monitorId` String, 8 - `region` LowCardinality(String), 9 - `statusCode` Nullable(Int16), 10 - `url` String, 11 - `workspaceId` String, 12 - `timestamp` Int64, 13 - `cronTimestamp` Int64 14 - 15 - ENGINE "MergeTree" 16 - ENGINE_PARTITION_KEY "toYYYYMM(time)" 17 - ENGINE_SORTING_KEY "monitorId, time" 18 - ENGINE_TTL "time + toIntervalHour(1)"
-17
packages/tinybird/datasources/__ttl_3d_mv.datasource
··· 1 - # Data Source created from Pipe '__ttl_3d__v0' 2 - VERSION 0 3 - 4 - SCHEMA > 5 - `time` DateTime, 6 - `latency` Int64, 7 - `monitorId` String, 8 - `region` LowCardinality(String), 9 - `statusCode` Nullable(Int16), 10 - `url` String, 11 - `workspaceId` String, 12 - `cronTimestamp` Int64 13 - 14 - ENGINE "MergeTree" 15 - ENGINE_PARTITION_KEY "toYYYYMM(time)" 16 - ENGINE_SORTING_KEY "monitorId, time" 17 - ENGINE_TTL "time + toIntervalDay(3)"
-22
packages/tinybird/datasources/__ttl_45d_all_mv.datasource
··· 1 - VERSION 0 2 - 3 - # Data Source created from Pipe '__ttl_45d_all__v0' 4 - 5 - SCHEMA > 6 - `time` DateTime, 7 - `latency` Int64, 8 - `monitorId` String, 9 - `region` LowCardinality(String), 10 - `statusCode` Nullable(Int16), 11 - `timestamp` Int64, 12 - `url` String, 13 - `workspaceId` String, 14 - `cronTimestamp` Int64, 15 - `message` Nullable(String), 16 - `timing` Nullable(String), 17 - `headers` Nullable(String) 18 - 19 - ENGINE "MergeTree" 20 - ENGINE_PARTITION_KEY "toYYYYMM(time)" 21 - ENGINE_SORTING_KEY "monitorId, cronTimestamp, time" 22 - ENGINE_TTL "time + toIntervalDay(45)"
+2 -2
packages/tinybird/datasources/__ttl_45d_count_utc_mv.datasource packages/tinybird/datasources/mv__http_status_45d.datasource
··· 1 - # Data Source created from Pipe '__ttl_45d_count_utc__v1' 2 - VERSION 1 1 + VERSION 0 2 + # Data Source created from Pipe 'aggregate__http_status_45d__v0' 3 3 4 4 SCHEMA > 5 5 `time` DateTime('UTC'),
-17
packages/tinybird/datasources/__ttl_45d_mv.datasource
··· 1 - # Data Source created from Pipe '__ttl_45d__v0' 2 - VERSION 0 3 - 4 - SCHEMA > 5 - `time` DateTime, 6 - `latency` Int64, 7 - `monitorId` String, 8 - `region` LowCardinality(String), 9 - `statusCode` Nullable(Int16), 10 - `url` String, 11 - `workspaceId` String, 12 - `cronTimestamp` Int64 13 - 14 - ENGINE "MergeTree" 15 - ENGINE_PARTITION_KEY "toYYYYMM(time)" 16 - ENGINE_SORTING_KEY "monitorId, time" 17 - ENGINE_TTL "time + toIntervalDay(45)"
-22
packages/tinybird/datasources/__ttl_7d_all_mv.datasource
··· 1 - VERSION 0 2 - 3 - # Data Source created from Pipe '__ttl_7d_all__v0' 4 - 5 - SCHEMA > 6 - `time` DateTime, 7 - `latency` Int64, 8 - `monitorId` String, 9 - `region` LowCardinality(String), 10 - `statusCode` Nullable(Int16), 11 - `timestamp` Int64, 12 - `url` String, 13 - `workspaceId` String, 14 - `cronTimestamp` Int64, 15 - `message` Nullable(String), 16 - `timing` Nullable(String), 17 - `headers` Nullable(String) 18 - 19 - ENGINE "MergeTree" 20 - ENGINE_PARTITION_KEY "toYYYYMM(time)" 21 - ENGINE_SORTING_KEY "monitorId, cronTimestamp, time" 22 - ENGINE_TTL "time + toIntervalDay(7)"
-14
packages/tinybird/datasources/__ttl_7d_count_mv.datasource
··· 1 - VERSION 1 2 - # Data Source created from Pipe '__ttl_7d_count__v1' 3 - 4 - SCHEMA > 5 - `time` DateTime, 6 - `monitorId` String, 7 - `url` String, 8 - `count` AggregateFunction(count), 9 - `ok` AggregateFunction(count, Nullable(UInt8)) 10 - 11 - ENGINE "AggregatingMergeTree" 12 - ENGINE_PARTITION_KEY "toYYYYMM(time)" 13 - ENGINE_SORTING_KEY "time, monitorId, url" 14 - ENGINE_TTL "time + toIntervalDay(7)"
+2 -2
packages/tinybird/datasources/__ttl_7d_count_utc_mv.datasource packages/tinybird/datasources/mv__http_status_7d.datasource
··· 1 - # Data Source created from Pipe '__ttl_7d_count_utc__v1' 2 - VERSION 1 1 + VERSION 0 2 + # Data Source created from Pipe 'aggregate__http_status_7d__v0' 3 3 4 4 SCHEMA > 5 5 `time` DateTime('UTC'),
+7 -5
packages/tinybird/datasources/__ttl_7d_mv.datasource packages/tinybird/datasources/mv__http_7d.datasource
··· 1 - # Data Source created from Pipe '__ttl_7d__v0' 2 1 VERSION 0 2 + # Data Source created from Pipe 'aggregate__http_7d__v0' 3 3 4 4 SCHEMA > 5 5 `time` DateTime, 6 6 `latency` Int64, 7 - `monitorId` String, 7 + `error` Int8, 8 8 `region` LowCardinality(String), 9 + `trigger` Nullable(String), 9 10 `statusCode` Nullable(Int16), 10 - `url` String, 11 - `workspaceId` String, 12 - `cronTimestamp` Int64 11 + `timestamp` Int64, 12 + `cronTimestamp` Int64, 13 + `monitorId` String, 14 + `workspaceId` String 13 15 14 16 ENGINE "MergeTree" 15 17 ENGINE_PARTITION_KEY "toYYYYMM(time)"
+15
packages/tinybird/datasources/check_response_http.datasource
··· 1 + VERSION 0 2 + 3 + SCHEMA > 4 + `body` String `json:$.body`, 5 + `headers` String `json:$.headers`, 6 + `latency` Int32 `json:$.latency`, 7 + `region` String `json:$.region`, 8 + `requestId` Int16 `json:$.requestId`, 9 + `statusCode` Int16 `json:$.statusCode`, 10 + `timestamp` Int64 `json:$.timestamp`, 11 + `timing` String `json:$.timing`, 12 + `workspaceId` Int16 `json:$.workspaceId` 13 + 14 + ENGINE "MergeTree" 15 + ENGINE_SORTING_KEY "timestamp, timing, workspaceId"
+19
packages/tinybird/datasources/mv__http_30d.datasource
··· 1 + VERSION 0 2 + # Data Source created from Pipe 'aggregate__http_30d__v0' 3 + 4 + SCHEMA > 5 + `time` DateTime, 6 + `latency` Int64, 7 + `error` Int8, 8 + `region` LowCardinality(String), 9 + `trigger` Nullable(String), 10 + `statusCode` Nullable(Int16), 11 + `timestamp` Int64, 12 + `cronTimestamp` Int64, 13 + `monitorId` String, 14 + `workspaceId` String 15 + 16 + ENGINE "MergeTree" 17 + ENGINE_PARTITION_KEY "toYYYYMM(time)" 18 + ENGINE_SORTING_KEY "monitorId, time" 19 + ENGINE_TTL "time + toIntervalDay(30)"
+25
packages/tinybird/datasources/mv__http_full_30d.datasource
··· 1 + VERSION 0 2 + # Data Source created from Pipe 'aggregate__http_full_30d__v0' 3 + 4 + SCHEMA > 5 + `time` DateTime, 6 + `latency` Int64, 7 + `monitorId` String, 8 + `region` LowCardinality(String), 9 + `statusCode` Nullable(Int16), 10 + `error` Int8, 11 + `timestamp` Int64, 12 + `url` String, 13 + `workspaceId` String, 14 + `cronTimestamp` Int64, 15 + `message` Nullable(String), 16 + `timing` Nullable(String), 17 + `headers` Nullable(String), 18 + `assertions` Nullable(String), 19 + `body` Nullable(String), 20 + `trigger` Nullable(String) 21 + 22 + ENGINE "MergeTree" 23 + ENGINE_PARTITION_KEY "toYYYYMM(time)" 24 + ENGINE_SORTING_KEY "monitorId, time" 25 + ENGINE_TTL "time + toIntervalDay(30)"
+18
packages/tinybird/datasources/mv__tcp_14d.datasource
··· 1 + VERSION 0 2 + # Data Source created from Pipe 'aggregate__tcp_14d__v0' 3 + 4 + SCHEMA > 5 + `time` DateTime, 6 + `latency` Int64, 7 + `error` Int16, 8 + `region` String, 9 + `trigger` Nullable(String), 10 + `timestamp` Int64, 11 + `cronTimestamp` Int64, 12 + `monitorId` Int32, 13 + `workspaceId` Int32 14 + 15 + ENGINE "MergeTree" 16 + ENGINE_PARTITION_KEY "toYYYYMM(time)" 17 + ENGINE_SORTING_KEY "monitorId, time" 18 + ENGINE_TTL "time + toIntervalDay(14)"
+18
packages/tinybird/datasources/mv__tcp_1d.datasource
··· 1 + VERSION 0 2 + # Data Source created from Pipe 'aggregate__tcp_1d__v0' 3 + 4 + SCHEMA > 5 + `time` DateTime, 6 + `latency` Int64, 7 + `error` Int16, 8 + `region` String, 9 + `trigger` Nullable(String), 10 + `timestamp` Int64, 11 + `cronTimestamp` Int64, 12 + `monitorId` Int32, 13 + `workspaceId` Int32 14 + 15 + ENGINE "MergeTree" 16 + ENGINE_PARTITION_KEY "toYYYYMM(time)" 17 + ENGINE_SORTING_KEY "monitorId, time" 18 + ENGINE_TTL "time + toIntervalDay(1)"
+18
packages/tinybird/datasources/mv__tcp_30d.datasource
··· 1 + VERSION 0 2 + # Data Source created from Pipe 'aggregate__tcp_30d__v0' 3 + 4 + SCHEMA > 5 + `time` DateTime, 6 + `latency` Int64, 7 + `error` Int16, 8 + `region` String, 9 + `trigger` Nullable(String), 10 + `timestamp` Int64, 11 + `cronTimestamp` Int64, 12 + `monitorId` Int32, 13 + `workspaceId` Int32 14 + 15 + ENGINE "MergeTree" 16 + ENGINE_PARTITION_KEY "toYYYYMM(time)" 17 + ENGINE_SORTING_KEY "monitorId, time" 18 + ENGINE_TTL "time + toIntervalDay(30)"
+18
packages/tinybird/datasources/mv__tcp_7d.datasource
··· 1 + VERSION 0 2 + # Data Source created from Pipe 'aggregate__tcp_7d__v0' 3 + 4 + SCHEMA > 5 + `time` DateTime, 6 + `latency` Int64, 7 + `error` Int16, 8 + `region` String, 9 + `trigger` Nullable(String), 10 + `timestamp` Int64, 11 + `cronTimestamp` Int64, 12 + `monitorId` Int32, 13 + `workspaceId` Int32 14 + 15 + ENGINE "MergeTree" 16 + ENGINE_PARTITION_KEY "toYYYYMM(time)" 17 + ENGINE_SORTING_KEY "monitorId, time" 18 + ENGINE_TTL "time + toIntervalDay(7)"
+21
packages/tinybird/datasources/mv__tcp_full_30d.datasource
··· 1 + VERSION 0 2 + # Data Source created from Pipe 'aggregate__tcp_full_30d__v0' 3 + 4 + SCHEMA > 5 + `time` DateTime, 6 + `monitorId` Int32, 7 + `region` String, 8 + `timestamp` Int64, 9 + `cronTimestamp` Int64, 10 + `timing` String, 11 + `workspaceId` Int32, 12 + `latency` Int64, 13 + `errorMessage` Nullable(String), 14 + `error` Int16, 15 + `trigger` Nullable(String), 16 + `uri` Nullable(String) 17 + 18 + ENGINE "MergeTree" 19 + ENGINE_PARTITION_KEY "toYYYYMM(time)" 20 + ENGINE_SORTING_KEY "monitorId, time" 21 + ENGINE_TTL "time + toIntervalDay(30)"
+13
packages/tinybird/datasources/mv__tcp_status_45d.datasource
··· 1 + VERSION 0 2 + # Data Source created from Pipe 'aggregate__tcp_status_45d__v0' 3 + 4 + SCHEMA > 5 + `time` DateTime('UTC'), 6 + `monitorId` Int32, 7 + `count` AggregateFunction(count), 8 + `ok` AggregateFunction(count, Nullable(UInt8)) 9 + 10 + ENGINE "AggregatingMergeTree" 11 + ENGINE_PARTITION_KEY "toYYYYMM(time)" 12 + ENGINE_SORTING_KEY "monitorId, time" 13 + ENGINE_TTL "time + toIntervalDay(45)"
+13
packages/tinybird/datasources/mv__tcp_status_7d.datasource
··· 1 + VERSION 0 2 + # Data Source created from Pipe 'aggregate__tcp_status_7d__v0' 3 + 4 + SCHEMA > 5 + `time` DateTime('UTC'), 6 + `monitorId` Int32, 7 + `count` AggregateFunction(count), 8 + `ok` AggregateFunction(count, Nullable(UInt8)) 9 + 10 + ENGINE "AggregatingMergeTree" 11 + ENGINE_PARTITION_KEY "toYYYYMM(time)" 12 + ENGINE_SORTING_KEY "monitorId, time" 13 + ENGINE_TTL "time + toIntervalDay(7)"
+5 -1
packages/tinybird/datasources/ping_response.datasource
··· 1 - VERSION 6 1 + VERSION 8 2 2 3 3 SCHEMA > 4 4 `latency` Int64 `json:$.latency`, 5 5 `monitorId` String `json:$.monitorId`, 6 6 `region` LowCardinality(String) `json:$.region`, 7 7 `statusCode` Nullable(Int16) `json:$.statusCode`, 8 + `error` Int8 `json:$.error`, 8 9 `timestamp` Int64 `json:$.timestamp`, 9 10 `url` String `json:$.url`, 10 11 `workspaceId` String `json:$.workspaceId`, ··· 12 13 `message` Nullable(String) `json:$.message`, 13 14 `timing` Nullable(String) `json:$.timing`, 14 15 `headers` Nullable(String) `json:$.headers`, 16 + `assertions` Nullable(String) `json:$.assertions`, 17 + `body` Nullable(String) `json:$.body`, 18 + `trigger` Nullable(String) `json:$.trigger`, 15 19 16 20 ENGINE "MergeTree" 17 21 ENGINE_SORTING_KEY "monitorId, cronTimestamp"
+2 -2
packages/tinybird/datasources/tcp_response.datasource
··· 6 6 `timestamp` Int64 `json:$.timestamp`, 7 7 `cronTimestamp` Int64 `json:$.timestamp`, 8 8 `timing` String `json:$.timing`, 9 - `uri` String `json:$.uri`, 10 9 `workspaceId` Int32 `json:$.workspaceId`, 11 10 `latency` Int64 `json:$.latency`, 12 11 `errorMessage` Nullable(String) `json:$.errorMessage`, 13 - `error` Int16 `json:$.error` 12 + `error` Int16 `json:$.error`, 14 13 `trigger` Nullable(String) `json:$.trigger`, 14 + `uri` Nullable(String) `json:$.uri`, 15 15 16 16 17 17 ENGINE "MergeTree"
-21
packages/tinybird/pipes/__ttl_14d.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_14d_0 4 - SQL > 5 - 6 - SELECT 7 - toDateTime(fromUnixTimestamp64Milli(cronTimestamp)) AS time, 8 - latency, 9 - monitorId, 10 - error, 11 - region, 12 - statusCode, 13 - url, 14 - workspaceId, 15 - cronTimestamp 16 - FROM ping_response__v7 17 - 18 - TYPE materialized 19 - DATASOURCE __ttl_14d_mv__v1 20 - 21 -
-23
packages/tinybird/pipes/__ttl_14d_chart_all_regions_get.pipe
··· 1 - VERSION 1 2 - TOKEN "__ttl_14d_chart_all_regions_get__v1_endpoint_read_6659" READ 3 - 4 - NODE __ttl_14d_chart_all_regions_get_0 5 - SQL > 6 - 7 - % 8 - SELECT 9 - toStartOfInterval( 10 - toDateTime(cronTimestamp / 1000), INTERVAL 1 HOUR 11 - ) as h, 12 - toUnixTimestamp64Milli(toDateTime64(h, 3)) as timestamp, 13 - round(quantile(0.5)(latency)) as p50Latency, 14 - round(quantile(0.75)(latency)) as p75Latency, 15 - round(quantile(0.9)(latency)) as p90Latency, 16 - round(quantile(0.95)(latency)) as p95Latency, 17 - round(quantile(0.99)(latency)) as p99Latency 18 - FROM __ttl_14d_mv 19 - WHERE monitorId = {{ String(monitorId, '1') }} 20 - GROUP BY h 21 - ORDER BY h DESC 22 - 23 -
-25
packages/tinybird/pipes/__ttl_14d_chart_get.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_14d_chart_get_0 4 - SQL > 5 - 6 - % 7 - SELECT 8 - region, 9 - toStartOfInterval( 10 - toDateTime(cronTimestamp / 1000), 11 - INTERVAL {{ Int64(interval, 30) }} MINUTE 12 - ) as h, 13 - toUnixTimestamp64Milli(toDateTime64(h, 3)) as timestamp, 14 - round(quantile(0.5)(latency)) as p50Latency, 15 - round(quantile(0.75)(latency)) as p75Latency, 16 - round(quantile(0.9)(latency)) as p90Latency, 17 - round(quantile(0.95)(latency)) as p95Latency, 18 - round(quantile(0.99)(latency)) as p99Latency 19 - FROM __ttl_14d_mv__v1 20 - WHERE 21 - monitorId = {{ String(monitorId, '1') }} 22 - GROUP BY h, region 23 - ORDER BY h DESC 24 - 25 -
-36
packages/tinybird/pipes/__ttl_14d_metrics_get.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_14d_metrics_get_0 4 - SQL > 5 - 6 - % 7 - SELECT 8 - round(quantile(0.5)(latency)) as p50Latency, 9 - round(quantile(0.75)(latency)) as p75Latency, 10 - round(quantile(0.9)(latency)) as p90Latency, 11 - round(quantile(0.95)(latency)) as p95Latency, 12 - round(quantile(0.99)(latency)) as p99Latency, 13 - count() as count, 14 - count(if(error = 0, 1, NULL)) AS ok, 15 - max(cronTimestamp) AS lastTimestamp 16 - FROM __ttl_14d_mv__v1 17 - WHERE 18 - monitorId = {{ String(monitorId, '1') }} 19 - AND time >= toDateTime64(now() - INTERVAL 14 DAY, 3) 20 - UNION ALL 21 - SELECT 22 - round(quantile(0.5)(latency)) AS p50Latency, 23 - round(quantile(0.75)(latency)) AS p75Latency, 24 - round(quantile(0.9)(latency)) AS p90Latency, 25 - round(quantile(0.95)(latency)) AS p95Latency, 26 - round(quantile(0.99)(latency)) AS p99Latency, 27 - count() as count, 28 - count(if(error = 0, 1, NULL)) AS ok, 29 - NULL as lastTimestamp -- no need to query the `lastTimestamp` as not relevant 30 - FROM __ttl_45d_mv__v1 31 - WHERE 32 - monitorId = {{ String(monitorId, '1') }} 33 - AND time >= toDateTime64(now() - INTERVAL 28 DAY, 3) 34 - AND time < toDateTime64(now() - INTERVAL 14 DAY, 3) 35 - 36 -
-22
packages/tinybird/pipes/__ttl_14d_metrics_get_by_region.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_14d_metrics_get_by_region_0 4 - SQL > 5 - 6 - % 7 - SELECT 8 - region, 9 - round(quantile(0.5)(latency)) as p50Latency, 10 - round(quantile(0.75)(latency)) as p75Latency, 11 - round(quantile(0.9)(latency)) as p90Latency, 12 - round(quantile(0.95)(latency)) as p95Latency, 13 - round(quantile(0.99)(latency)) as p99Latency, 14 - count() as count, 15 - count(if(error = 0, 1, NULL)) AS ok, 16 - max(cronTimestamp) AS lastTimestamp 17 - FROM __ttl_14d_mv__v1 18 - WHERE 19 - monitorId = {{ String(monitorId, '1') }} 20 - GROUP BY region 21 - 22 -
-22
packages/tinybird/pipes/__ttl_1d.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_1d_0 4 - SQL > 5 - 6 - SELECT 7 - toDateTime(fromUnixTimestamp64Milli(cronTimestamp)) AS time, 8 - latency, 9 - monitorId, 10 - error, 11 - region, 12 - statusCode, 13 - url, 14 - workspaceId, 15 - timestamp, 16 - cronTimestamp 17 - FROM ping_response__v8 18 - 19 - TYPE materialized 20 - DATASOURCE __ttl_1d_mv__v1 21 - 22 -
-27
packages/tinybird/pipes/__ttl_1d_chart_get.pipe
··· 1 - VERSION 1 2 - 3 - TOKEN "__ttl_1d_chart_get_endpoint_read_4815" READ 4 - 5 - NODE __ttl_1d_chart_get_0 6 - SQL > 7 - 8 - % 9 - SELECT 10 - region, 11 - toStartOfInterval( 12 - toDateTime(cronTimestamp / 1000), 13 - INTERVAL {{ Int64(interval, 30) }} MINUTE 14 - ) as h, 15 - toUnixTimestamp64Milli(toDateTime64(h, 3)) as timestamp, 16 - round(quantile(0.5)(latency)) as p50Latency, 17 - round(quantile(0.75)(latency)) as p75Latency, 18 - round(quantile(0.9)(latency)) as p90Latency, 19 - round(quantile(0.95)(latency)) as p95Latency, 20 - round(quantile(0.99)(latency)) as p99Latency 21 - FROM __ttl_1d_mv__v1 22 - WHERE 23 - monitorId = {{ String(monitorId, '1') }} 24 - GROUP BY h, region 25 - ORDER BY h DESC 26 - 27 -
-13
packages/tinybird/pipes/__ttl_1d_list_get.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_1d_list_get__v0_0 4 - SQL > 5 - 6 - % 7 - SELECT latency, monitorId, error, region, statusCode, timestamp, url, workspaceId, cronTimestamp 8 - FROM __ttl_1d_mv__v1 9 - WHERE 10 - monitorId = {{ String(monitorId, '1') }} 11 - ORDER BY cronTimestamp DESC 12 - 13 -
-36
packages/tinybird/pipes/__ttl_1d_metrics_get.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_1d_metrics_get_0 4 - SQL > 5 - 6 - % 7 - SELECT 8 - round(quantile(0.5)(latency)) as p50Latency, 9 - round(quantile(0.75)(latency)) as p75Latency, 10 - round(quantile(0.9)(latency)) as p90Latency, 11 - round(quantile(0.95)(latency)) as p95Latency, 12 - round(quantile(0.99)(latency)) as p99Latency, 13 - count() as count, 14 - count(if(error = 0, 1, NULL)) AS ok, 15 - max(cronTimestamp) AS lastTimestamp 16 - FROM __ttl_1d_mv__v1 17 - WHERE 18 - monitorId = {{ String(monitorId, '1') }} 19 - AND time >= toDateTime64(now() - INTERVAL 1 DAY, 3) 20 - UNION ALL 21 - SELECT 22 - round(quantile(0.5)(latency)) AS p50Latency, 23 - round(quantile(0.75)(latency)) AS p75Latency, 24 - round(quantile(0.9)(latency)) AS p90Latency, 25 - round(quantile(0.95)(latency)) AS p95Latency, 26 - round(quantile(0.99)(latency)) AS p99Latency, 27 - count() as count, 28 - count(if(error = 0, 1, NULL)) AS ok, 29 - NULL as lastTimestamp -- no need to query the `lastTimestamp` as not relevant 30 - FROM __ttl_3d_mv__v1 31 - WHERE 32 - monitorId = {{ String(monitorId, '1') }} 33 - AND time >= toDateTime64(now() - INTERVAL 2 DAY, 3) 34 - AND time < toDateTime64(now() - INTERVAL 1 DAY, 3) 35 - 36 -
-21
packages/tinybird/pipes/__ttl_1d_metrics_get_by_region.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_1d_metrics_get_by_region_0 4 - SQL > 5 - 6 - % 7 - SELECT 8 - region, 9 - round(quantile(0.5)(latency)) as p50Latency, 10 - round(quantile(0.75)(latency)) as p75Latency, 11 - round(quantile(0.9)(latency)) as p90Latency, 12 - round(quantile(0.95)(latency)) as p95Latency, 13 - round(quantile(0.99)(latency)) as p99Latency, 14 - count() as count, 15 - count(if(error = 0, 1, NULL)) AS ok 16 - FROM __ttl_1d_mv__v1 17 - WHERE 18 - monitorId = {{ String(monitorId, '1') }} 19 - GROUP BY region 20 - 21 -
-22
packages/tinybird/pipes/__ttl_1h.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_1h_0 4 - SQL > 5 - 6 - SELECT 7 - toDateTime(fromUnixTimestamp64Milli(cronTimestamp)) AS time, 8 - latency, 9 - monitorId, 10 - error, 11 - region, 12 - statusCode, 13 - url, 14 - workspaceId, 15 - timestamp, 16 - cronTimestamp 17 - FROM ping_response__v8 18 - 19 - TYPE materialized 20 - DATASOURCE __ttl_1h_mv__v1 21 - 22 -
-25
packages/tinybird/pipes/__ttl_1h_chart_get.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_1h_chart_get_0 4 - SQL > 5 - 6 - % 7 - SELECT 8 - region, 9 - toStartOfInterval( 10 - toDateTime(cronTimestamp / 1000), 11 - INTERVAL {{ Int64(interval, 30) }} MINUTE 12 - ) as h, 13 - toUnixTimestamp64Milli(toDateTime64(h, 3)) as timestamp, 14 - round(quantile(0.5)(latency)) as p50Latency, 15 - round(quantile(0.75)(latency)) as p75Latency, 16 - round(quantile(0.9)(latency)) as p90Latency, 17 - round(quantile(0.95)(latency)) as p95Latency, 18 - round(quantile(0.99)(latency)) as p99Latency 19 - FROM __ttl_1h_mv__v1 20 - WHERE 21 - monitorId = {{ String(monitorId, '1') }} 22 - GROUP BY h, region 23 - ORDER BY h DESC 24 - 25 -
-12
packages/tinybird/pipes/__ttl_1h_last_timestamp_monitor_get.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_1h_last_timestamp_monitor_get__v0_0 4 - SQL > 5 - 6 - % 7 - SELECT max(cronTimestamp) as cronTimestamp 8 - FROM __ttl_1h_mv__v1 9 - WHERE 10 - monitorId = {{ String(monitorId, '1') }} 11 - 12 -
-11
packages/tinybird/pipes/__ttl_1h_last_timestamp_workspace_get.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_1h_last_timestamp_workspace_get__v0_0 4 - SQL > 5 - 6 - % 7 - SELECT max(cronTimestamp) as cronTimestamp 8 - FROM __ttl_1h_mv__v1 9 - WHERE workspaceId = {{ String(workspaceId, '1') }} 10 - 11 -
-14
packages/tinybird/pipes/__ttl_1h_list_get.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_1h_list_get__v0_0 4 - SQL > 5 - 6 - % 7 - -- FIXME: `timestamp` is missing on 1h, 3d, 7d, 45d mv! 8 - SELECT latency, monitorId, error, region, statusCode, url, workspaceId, cronTimestamp, timestamp 9 - FROM __ttl_1h_mv__v1 10 - WHERE 11 - monitorId = {{ String(monitorId, '1') }} 12 - ORDER BY cronTimestamp DESC 13 - 14 -
-36
packages/tinybird/pipes/__ttl_1h_metrics_get.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_1h_metrics_get_0 4 - SQL > 5 - 6 - % 7 - SELECT 8 - round(quantile(0.5)(latency)) as p50Latency, 9 - round(quantile(0.75)(latency)) as p75Latency, 10 - round(quantile(0.9)(latency)) as p90Latency, 11 - round(quantile(0.95)(latency)) as p95Latency, 12 - round(quantile(0.99)(latency)) as p99Latency, 13 - count() as count, 14 - count(if(error = 0, 1, NULL)) AS ok, 15 - max(cronTimestamp) AS lastTimestamp 16 - FROM __ttl_1h_mv__v1 17 - WHERE 18 - monitorId = {{ String(monitorId, '1') }} 19 - AND time >= toDateTime64(now() - INTERVAL 1 HOUR, 3) 20 - UNION ALL 21 - SELECT 22 - round(quantile(0.5)(latency)) AS p50Latency, 23 - round(quantile(0.75)(latency)) AS p75Latency, 24 - round(quantile(0.9)(latency)) AS p90Latency, 25 - round(quantile(0.95)(latency)) AS p95Latency, 26 - round(quantile(0.99)(latency)) AS p99Latency, 27 - count() as count, 28 - count(if(error = 0, 1, NULL)) AS ok, 29 - NULL as lastTimestamp -- no need to query the `lastTimestamp` as not relevant 30 - FROM __ttl_1d_mv__v1 31 - WHERE 32 - monitorId = {{ String(monitorId, '1') }} 33 - AND time >= toDateTime64(now() - INTERVAL 2 HOUR, 3) 34 - AND time < toDateTime64(now() - INTERVAL 1 HOUR, 3) 35 - 36 -
-21
packages/tinybird/pipes/__ttl_1h_metrics_get_by_region.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_1h_metrics_get_by_region_0 4 - SQL > 5 - 6 - % 7 - SELECT 8 - region, 9 - round(quantile(0.5)(latency)) as p50Latency, 10 - round(quantile(0.75)(latency)) as p75Latency, 11 - round(quantile(0.9)(latency)) as p90Latency, 12 - round(quantile(0.95)(latency)) as p95Latency, 13 - round(quantile(0.99)(latency)) as p99Latency, 14 - count() as count, 15 - count(if(error = 0, 1, NULL)) AS ok, 16 - FROM __ttl_1h_mv__v1 17 - WHERE 18 - monitorId = {{ String(monitorId, '1') }} 19 - GROUP BY region 20 - 21 -
-22
packages/tinybird/pipes/__ttl_3d.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_3d_0 4 - SQL > 5 - 6 - SELECT 7 - toDateTime(fromUnixTimestamp64Milli(cronTimestamp)) AS time, 8 - latency, 9 - monitorId, 10 - error, 11 - region, 12 - statusCode, 13 - url, 14 - workspaceId, 15 - cronTimestamp, 16 - timestamp 17 - FROM ping_response__v8 18 - 19 - TYPE materialized 20 - DATASOURCE __ttl_3d_mv__v1 21 - 22 -
-25
packages/tinybird/pipes/__ttl_3d_chart_get.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_3d_chart_get_0 4 - SQL > 5 - 6 - % 7 - SELECT 8 - region, 9 - toStartOfInterval( 10 - toDateTime(cronTimestamp / 1000), 11 - INTERVAL {{ Int64(interval, 30) }} MINUTE 12 - ) as h, 13 - toUnixTimestamp64Milli(toDateTime64(h, 3)) as timestamp, 14 - round(quantile(0.5)(latency)) as p50Latency, 15 - round(quantile(0.75)(latency)) as p75Latency, 16 - round(quantile(0.9)(latency)) as p90Latency, 17 - round(quantile(0.95)(latency)) as p95Latency, 18 - round(quantile(0.99)(latency)) as p99Latency 19 - FROM __ttl_3d_mv__v0 20 - WHERE 21 - monitorId = {{ String(monitorId, '1') }} 22 - GROUP BY h, region 23 - ORDER BY h DESC 24 - 25 -
-14
packages/tinybird/pipes/__ttl_3d_list_get.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_3d_list_get__v1_0 4 - SQL > 5 - 6 - % 7 - SELECT latency, monitorId, error, region, statusCode, url, workspaceId, cronTimestamp, timestamp 8 - FROM __ttl_3d_mv__v1 9 - WHERE 10 - monitorId = {{ String(monitorId, '1') }} 11 - {% if defined(url) %} AND url = {{ String(url) }} {% end %} 12 - ORDER BY cronTimestamp DESC 13 - 14 -
-36
packages/tinybird/pipes/__ttl_3d_metrics_get.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_3d_metrics_get_0 4 - SQL > 5 - 6 - % 7 - SELECT 8 - round(quantile(0.5)(latency)) as p50Latency, 9 - round(quantile(0.75)(latency)) as p75Latency, 10 - round(quantile(0.9)(latency)) as p90Latency, 11 - round(quantile(0.95)(latency)) as p95Latency, 12 - round(quantile(0.99)(latency)) as p99Latency, 13 - count() as count, 14 - count(if(error = 0, 1, NULL)) AS ok, 15 - max(cronTimestamp) AS lastTimestamp 16 - FROM __ttl_3d_mv__v1 17 - WHERE 18 - monitorId = {{ String(monitorId, '1') }} 19 - AND time >= toDateTime64(now() - INTERVAL 3 DAY, 3) 20 - UNION ALL 21 - SELECT 22 - round(quantile(0.5)(latency)) AS p50Latency, 23 - round(quantile(0.75)(latency)) AS p75Latency, 24 - round(quantile(0.9)(latency)) AS p90Latency, 25 - round(quantile(0.95)(latency)) AS p95Latency, 26 - round(quantile(0.99)(latency)) AS p99Latency, 27 - count() as count, 28 - count(if(error = 0, 1, NULL)) AS ok, 29 - NULL as lastTimestamp -- no need to query the `lastTimestamp` as not relevant 30 - FROM __ttl_7d_mv__v1 31 - WHERE 32 - monitorId = {{ String(monitorId, '1') }} 33 - AND time >= toDateTime64(now() - INTERVAL 6 DAY, 3) 34 - AND time < toDateTime64(now() - INTERVAL 3 DAY, 3) 35 - 36 -
-22
packages/tinybird/pipes/__ttl_3d_metrics_get_by_region.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_3d_metrics_get_by_region_0 4 - SQL > 5 - 6 - % 7 - SELECT 8 - region, 9 - round(quantile(0.5)(latency)) as p50Latency, 10 - round(quantile(0.75)(latency)) as p75Latency, 11 - round(quantile(0.9)(latency)) as p90Latency, 12 - round(quantile(0.95)(latency)) as p95Latency, 13 - round(quantile(0.99)(latency)) as p99Latency, 14 - count() as count, 15 - count(if(error = 0, 1, NULL)) AS ok, 16 - max(cronTimestamp) AS lastTimestamp 17 - FROM __ttl_3d_mv__v0 18 - WHERE 19 - monitorId = {{ String(monitorId, '1') }} 20 - GROUP BY region 21 - 22 -
-20
packages/tinybird/pipes/__ttl_45d.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_45d_0 4 - SQL > 5 - 6 - SELECT 7 - toStartOfDay(fromUnixTimestamp64Milli(cronTimestamp)) AS time, 8 - latency, 9 - monitorId, 10 - region, 11 - statusCode, 12 - url, 13 - workspaceId, 14 - cronTimestamp 15 - FROM ping_response__v8 16 - 17 - TYPE materialized 18 - DATASOURCE __ttl_45d_mv__v1 19 - 20 -
-11
packages/tinybird/pipes/__ttl_45d_all.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_45d_all_0 4 - SQL > 5 - 6 - SELECT toDateTime(fromUnixTimestamp64Milli(cronTimestamp)) AS time, * FROM ping_response__v8 7 - 8 - TYPE materialized 9 - DATASOURCE __ttl_45d_all_mv__v1 10 - 11 -
-14
packages/tinybird/pipes/__ttl_45d_all_details_get.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_45d_all_details_get_0 4 - SQL > 5 - 6 - % 7 - SELECT * 8 - from __ttl_45d_all_mv__v1 9 - WHERE 10 - monitorId = {{ String(monitorId, '1') }} 11 - AND cronTimestamp = {{ Int64(cronTimestamp, 1709477432205) }} 12 - AND region = {{ String(region, 'ams') }} 13 - 14 -
-23
packages/tinybird/pipes/__ttl_45d_count_utc.pipe
··· 1 - VERSION 1 2 - 3 - DESCRIPTION > 4 - TODO: descripe what it is for! 5 - 6 - 7 - NODE __ttl_45d_count_utc_0 8 - SQL > 9 - 10 - SELECT 11 - toStartOfDay(toTimeZone(time, 'UTC')) AS time, 12 - monitorId, 13 - countState() AS count, 14 - countState(if(error = 0, 1, NULL)) AS ok 15 - FROM __ttl_45d_mv__v1 16 - GROUP BY 17 - time, 18 - monitorId 19 - 20 - TYPE materialized 21 - DATASOURCE __ttl_45d_count_utc_mv__v1 22 - 23 -
+3 -2
packages/tinybird/pipes/__ttl_45d_count_utc_get.pipe
··· 1 1 VERSION 1 2 + TOKEN "__ttl_45d_count_utc_get__v1_endpoint_read_7956" READ 2 3 3 4 NODE __ttl_45d_count_utc_get_0 4 5 SQL > 5 6 6 7 % 7 8 SELECT time as day, countMerge(count) as count, countMerge(ok) as ok 8 - FROM __ttl_45d_count_utc_mv__v1 9 + FROM mv__http_status_45d 9 10 WHERE 10 11 monitorId = {{ String(monitorId, '4') }} 11 12 GROUP BY day ··· 14 15 FROM 15 16 toStartOfDay(toStartOfDay(toTimeZone(now(), 'UTC'))) 16 17 TO toStartOfDay( 17 - date_sub(DAY, 7, now()) 18 + date_sub(DAY, 45, now()) 18 19 ) STEP INTERVAL -1 DAY 19 20 20 21
-38
packages/tinybird/pipes/__ttl_45d_statuspage_get.pipe
··· 1 - VERSION 1 2 - TOKEN "__ttl_45d_statuspage_get_endpoint_read_1959" READ 3 - 4 - NODE __ttl_45d_statuspage_get_0 5 - SQL > 6 - 7 - % 8 - SELECT 9 - toDateTime(cronTimestamp / 1000, 'UTC') AS day, 10 - -- only for debugging purposes 11 - toTimezone(day, {{ String(timezone, 'Europe/London') }}) as with_timezone, 12 - toStartOfDay(with_timezone) as start_of_day, 13 - statusCode 14 - -- latency 15 - FROM __ttl_45d_mv 16 - WHERE monitorId = {{ String(monitorId, '4') }} 17 - 18 - 19 - 20 - NODE __ttl_7d_statuspage_get_1 21 - SQL > 22 - 23 - % 24 - SELECT 25 - start_of_day as day, 26 - count() AS count, 27 - count(multiIf((statusCode >= 200) AND (statusCode <= 299), 1, NULL)) AS ok 28 - FROM __ttl_45d_statuspage_get_0 29 - GROUP BY start_of_day 30 - ORDER BY start_of_day DESC 31 - WITH FILL 32 - FROM 33 - toStartOfDay(toTimezone(now(), {{ String(timezone, 'Europe/London') }})) 34 - TO toStartOfDay( 35 - toTimezone(date_sub(DAY, 46, now()), {{ String(timezone, 'Europe/London') }}) 36 - ) STEP INTERVAL -1 DAY 37 - 38 -
-22
packages/tinybird/pipes/__ttl_7d.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_7d_0 4 - SQL > 5 - 6 - SELECT 7 - toDateTime(fromUnixTimestamp64Milli(cronTimestamp)) AS time, 8 - latency, 9 - monitorId, 10 - error 11 - region, 12 - statusCode, 13 - url, 14 - workspaceId, 15 - cronTimestamp, 16 - timestamp 17 - FROM ping_response__v8 18 - 19 - TYPE materialized 20 - DATASOURCE __ttl_7d_mv__v1 21 - 22 -
-11
packages/tinybird/pipes/__ttl_7d_all.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_7d_all_0 4 - SQL > 5 - 6 - SELECT toDateTime(fromUnixTimestamp64Milli(cronTimestamp)) AS time, * FROM ping_response__v8 7 - 8 - TYPE materialized 9 - DATASOURCE __ttl_7d_all_mv__v1 10 - 11 -
-14
packages/tinybird/pipes/__ttl_7d_all_details_get.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_7d_all_details_get_0 4 - SQL > 5 - 6 - % 7 - SELECT * 8 - from __ttl_7d_all_mv__v1 9 - WHERE 10 - monitorId = {{ String(monitorId, '1') }} 11 - AND cronTimestamp = {{ Int64(cronTimestamp, 1709477432205) }} 12 - AND region = {{ String(region, 'ams') }} 13 - 14 -
-23
packages/tinybird/pipes/__ttl_7d_chart_all_regions_get.pipe
··· 1 - VERSION 1 2 - TOKEN "__ttl_7d_chart_all_regions_get__v1_endpoint_read_8648" READ 3 - 4 - NODE __ttl_7d_chart_all_regions_get_0 5 - SQL > 6 - 7 - % 8 - SELECT 9 - toStartOfInterval( 10 - toDateTime(cronTimestamp / 1000), INTERVAL 1 HOUR 11 - ) as h, 12 - toUnixTimestamp64Milli(toDateTime64(h, 3)) as timestamp, 13 - round(quantile(0.5)(latency)) as p50Latency, 14 - round(quantile(0.75)(latency)) as p75Latency, 15 - round(quantile(0.9)(latency)) as p90Latency, 16 - round(quantile(0.95)(latency)) as p95Latency, 17 - round(quantile(0.99)(latency)) as p99Latency 18 - FROM __ttl_7d_mv 19 - WHERE monitorId = {{ String(monitorId, '1') }} 20 - GROUP BY h 21 - ORDER BY h DESC 22 - 23 -
-25
packages/tinybird/pipes/__ttl_7d_chart_get.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_7d_chart_get_0 4 - SQL > 5 - 6 - % 7 - SELECT 8 - region, 9 - toStartOfInterval( 10 - toDateTime(cronTimestamp / 1000), 11 - INTERVAL {{ Int64(interval, 30) }} MINUTE 12 - ) as h, 13 - toUnixTimestamp64Milli(toDateTime64(h, 3)) as timestamp, 14 - round(quantile(0.5)(latency)) as p50Latency, 15 - round(quantile(0.75)(latency)) as p75Latency, 16 - round(quantile(0.9)(latency)) as p90Latency, 17 - round(quantile(0.95)(latency)) as p95Latency, 18 - round(quantile(0.99)(latency)) as p99Latency 19 - FROM __ttl_7d_mv__v1 20 - WHERE 21 - monitorId = {{ String(monitorId, '1') }} 22 - GROUP BY h, region 23 - ORDER BY h DESC 24 - 25 -
-24
packages/tinybird/pipes/__ttl_7d_count.pipe
··· 1 - VERSION 1 2 - DESCRIPTION > 3 - TODO: descripe what it is for! 4 - 5 - 6 - NODE __ttl_7d_count_0 7 - SQL > 8 - 9 - SELECT 10 - time, 11 - monitorId, 12 - url, 13 - countState() AS count, 14 - countState(if(error = 0, 1, NULL)) AS ok 15 - FROM __ttl_45d_mv 16 - GROUP BY 17 - time, 18 - monitorId, 19 - url 20 - 21 - TYPE materialized 22 - DATASOURCE __ttl_7d_count_mv 23 - 24 -
-22
packages/tinybird/pipes/__ttl_7d_count_get.pipe
··· 1 - VERSION 1 2 - TOKEN "__ttl_7d_count_get__v1_endpoint_read_7412" READ 3 - 4 - NODE __ttl_7d_count_get_0 5 - SQL > 6 - 7 - % 8 - SELECT time as day, countMerge(count) as count, countMerge(ok) as ok 9 - FROM __ttl_7d_count_mv_test 10 - WHERE 11 - monitorId = {{ String(monitorId, '4') }} 12 - {% if defined(url) %} AND url = {{ String(url) }} {% end %} 13 - GROUP BY day 14 - ORDER BY day DESC 15 - WITH FILL 16 - FROM 17 - toStartOfDay(now()) 18 - TO toStartOfDay( 19 - date_sub(DAY, 7, now()) 20 - ) STEP INTERVAL -1 DAY 21 - 22 -
-23
packages/tinybird/pipes/__ttl_7d_count_utc.pipe
··· 1 - VERSION 1 2 - 3 - DESCRIPTION > 4 - TODO: descripe what it is for! 5 - 6 - 7 - NODE __ttl_7d_count_utc_0 8 - SQL > 9 - 10 - SELECT 11 - toStartOfDay(toTimeZone(time, 'UTC')) AS time, 12 - monitorId, 13 - countState() AS count, 14 - countState(if(error = 0, 1, NULL)) AS ok 15 - FROM __ttl_7d_mv__v1 16 - GROUP BY 17 - time, 18 - monitorId 19 - 20 - TYPE materialized 21 - DATASOURCE __ttl_7d_count_utc_mv__v1 22 - 23 -
-20
packages/tinybird/pipes/__ttl_7d_count_utc_get.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_7d_count_utc_get_0 4 - SQL > 5 - 6 - % 7 - SELECT time as day, countMerge(count) as count, countMerge(ok) as ok 8 - FROM __ttl_7d_count_utc_mv__v1 9 - WHERE 10 - monitorId = {{ String(monitorId, '4') }} 11 - GROUP BY day 12 - ORDER BY day DESC 13 - WITH FILL 14 - FROM 15 - toStartOfDay(toStartOfDay(toTimeZone(now(), 'UTC'))) 16 - TO toStartOfDay( 17 - date_sub(DAY, 7, now()) 18 - ) STEP INTERVAL -1 DAY 19 - 20 -
-14
packages/tinybird/pipes/__ttl_7d_list_get.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_7d_list_get__v1_0 4 - SQL > 5 - 6 - % 7 - SELECT latency, monitorId, error, region, statusCode, url, workspaceId, cronTimestamp, timestamp 8 - FROM __ttl_7d_mv__v1 9 - WHERE 10 - monitorId = {{ String(monitorId, '1') }} 11 - {% if defined(url) %} AND url = {{ String(url) }} {% end %} 12 - ORDER BY cronTimestamp DESC 13 - 14 -
-36
packages/tinybird/pipes/__ttl_7d_metrics_get.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_7d_metrics_get_0 4 - SQL > 5 - 6 - % 7 - SELECT 8 - round(quantile(0.5)(latency)) as p50Latency, 9 - round(quantile(0.75)(latency)) as p75Latency, 10 - round(quantile(0.9)(latency)) as p90Latency, 11 - round(quantile(0.95)(latency)) as p95Latency, 12 - round(quantile(0.99)(latency)) as p99Latency, 13 - count() as count, 14 - count(if(error = 0, 1, NULL)) AS ok, 15 - max(cronTimestamp) AS lastTimestamp 16 - FROM __ttl_7d_mv__v1 17 - WHERE 18 - monitorId = {{ String(monitorId, '1') }} 19 - AND time >= toDateTime64(now() - INTERVAL 7 DAY, 3) 20 - UNION ALL 21 - SELECT 22 - round(quantile(0.5)(latency)) AS p50Latency, 23 - round(quantile(0.75)(latency)) AS p75Latency, 24 - round(quantile(0.9)(latency)) AS p90Latency, 25 - round(quantile(0.95)(latency)) AS p95Latency, 26 - round(quantile(0.99)(latency)) AS p99Latency, 27 - count() as count, 28 - count(if(error = 0, 1, NULL)) AS ok, 29 - NULL as lastTimestamp -- no need to query the `lastTimestamp` as not relevant 30 - FROM __ttl_14d_mv__v1 31 - WHERE 32 - monitorId = {{ String(monitorId, '1') }} 33 - AND time >= toDateTime64(now() - INTERVAL 14 DAY, 3) 34 - AND time < toDateTime64(now() - INTERVAL 7 DAY, 3) 35 - 36 -
-22
packages/tinybird/pipes/__ttl_7d_metrics_get_by_region.pipe
··· 1 - VERSION 1 2 - 3 - NODE __ttl_7d_metrics_get_by_region_0 4 - SQL > 5 - 6 - % 7 - SELECT 8 - region, 9 - round(quantile(0.5)(latency)) as p50Latency, 10 - round(quantile(0.75)(latency)) as p75Latency, 11 - round(quantile(0.9)(latency)) as p90Latency, 12 - round(quantile(0.95)(latency)) as p95Latency, 13 - round(quantile(0.99)(latency)) as p99Latency, 14 - count() as count, 15 - count(if(error = 0, 1, NULL)) AS ok, 16 - max(cronTimestamp) AS lastTimestamp 17 - FROM __ttl_7d_mv__v1 18 - WHERE 19 - monitorId = {{ String(monitorId, '1') }} 20 - GROUP BY region 21 - 22 -
-38
packages/tinybird/pipes/__ttl_7d_statuspage_get.pipe
··· 1 - VERSION 1 2 - TOKEN "__ttl_7d_statuspage_get_endpoint_read_0234" READ 3 - 4 - NODE __ttl_7d_statuspage_get_0 5 - SQL > 6 - 7 - % 8 - SELECT 9 - toDateTime(cronTimestamp / 1000, 'UTC') AS day, 10 - -- only for debugging purposes 11 - toTimezone(day, {{ String(timezone, 'Europe/London') }}) as with_timezone, 12 - toStartOfDay(with_timezone) as start_of_day, 13 - statusCode 14 - -- latency 15 - FROM __ttl_7d_mv 16 - WHERE monitorId = {{ String(monitorId, '4') }} 17 - 18 - 19 - 20 - NODE __ttl_7d_statuspage_get_1 21 - SQL > 22 - 23 - % 24 - SELECT 25 - start_of_day as day, 26 - count() AS count, 27 - count(multiIf((statusCode >= 200) AND (statusCode <= 299), 1, NULL)) AS ok 28 - FROM __ttl_7d_statuspage_get_0 29 - GROUP BY start_of_day 30 - ORDER BY start_of_day DESC 31 - WITH FILL 32 - FROM 33 - toStartOfDay(toTimezone(now(), {{ String(timezone, 'Europe/London') }})) 34 - TO toStartOfDay( 35 - toTimezone(date_sub(DAY, 46, now()), {{ String(timezone, 'Europe/London') }}) 36 - ) STEP INTERVAL -1 DAY 37 - 38 -
+8 -6
packages/tinybird/pipes/get_result_for_on_demand_check_http.pipe
··· 1 1 VERSION 0 2 2 3 - NODE get_result_for_on_demand_check_http_0 3 + NODE endpoint 4 4 SQL > 5 5 6 6 % ··· 13 13 timestamp, 14 14 url, 15 15 workspaceId, 16 - timing 17 - FROM __ttl_45d_all_mv__v1 16 + timing, 17 + cronTimestamp 18 + FROM mv__http_full_30d 18 19 where 19 - cronTimestamp = {{ String(cronTimestamp, '1') }} 20 - and monitorId = {{ String(monitorId, '1') }} 21 - and url = {{ String(url , 'https://www.openstatus.dev') }} 20 + cronTimestamp = {{ String(timestamp, '1729871694536') }} and 21 + monitorId = {{ String(monitorId, '2260') }} 22 + and url = {{ String(url , 'https://www.openstatus.dev/api/ping/edge') }} 23 + order by cronTimestamp desc 22 24 23 25
+16
packages/tinybird/pipes/single_checks_get.pipe
··· 1 + VERSION 1 2 + 3 + NODE endpoint 4 + SQL > 5 + 6 + % 7 + SELECT * 8 + from check_response_http 9 + WHERE 10 + workspaceId = {{ Int16(workspaceId, 1) }} 11 + {% if defined(requestId) %} AND requestId = {{ Int16(requestId) }} {% end %} 12 + ORDER BY timestamp DESC 13 + LIMIT {{ Int32(pageSize, 10) }} 14 + OFFSET {{ Int32(page, 0) * Int32(pageSize, 10) }} 15 + 16 +
+5 -5
packages/tinybird/src/client.ts
··· 7 7 private readonly tb: Client; 8 8 9 9 constructor(token: string) { 10 - // if (process.env.NODE_ENV === "development") { 11 - // this.tb = new NoopTinybird(); 12 - // } else { 13 - this.tb = new Client({ token }); 14 - // } 10 + if (process.env.NODE_ENV === "development") { 11 + this.tb = new NoopTinybird(); 12 + } else { 13 + this.tb = new Client({ token }); 14 + } 15 15 } 16 16 17 17 public get homeStats() {