From 64c14125ca1b67fc0e655ead7f5aa7cf26956ad7 Mon Sep 17 00:00:00 2001 From: Maximilian Kaske <56969857+mxkaske@users.noreply.github.com> Date: Mon, 4 Nov 2024 19:45:07 +0100 Subject: [PATCH] chore: update tb pipes and datasources (#1081) --- .../forms/monitor/section-scheduling.tsx | 1 - .../datasources/__ttl_3d_mv.datasource | 17 --------- .../datasources/__ttl_45d_mv.datasource | 17 --------- .../datasources/__ttl_7d_all_mv.datasource | 22 ----------- .../check_response_http.datasource | 15 ++++++++ ..._mv.datasource => mv__http_14d.datasource} | 12 +++--- ...d_mv.datasource => mv__http_1d.datasource} | 11 +++--- ..._mv.datasource => mv__http_30d.datasource} | 13 ++++--- ...d_mv.datasource => mv__http_7d.datasource} | 12 +++--- ...atasource => mv__http_full_30d.datasource} | 13 ++++--- ...asource => mv__http_status_45d.datasource} | 4 +- ...tasource => mv__http_status_7d.datasource} | 4 +- .../datasources/mv__tcp_14d.datasource | 18 +++++++++ .../datasources/mv__tcp_1d.datasource | 18 +++++++++ .../datasources/mv__tcp_30d.datasource | 18 +++++++++ .../datasources/mv__tcp_7d.datasource | 18 +++++++++ .../datasources/mv__tcp_full_30d.datasource | 21 ++++++++++ .../datasources/mv__tcp_status_45d.datasource | 13 +++++++ ...atasource => mv__tcp_status_7d.datasource} | 11 +++--- .../datasources/ping_response.datasource | 6 ++- .../datasources/tcp_response.datasource | 4 +- packages/tinybird/pipes/__ttl_14d.pipe | 21 ---------- .../__ttl_14d_chart_all_regions_get.pipe | 23 ----------- .../tinybird/pipes/__ttl_14d_chart_get.pipe | 25 ------------ .../tinybird/pipes/__ttl_14d_metrics_get.pipe | 36 ------------------ .../__ttl_14d_metrics_get_by_region.pipe | 22 ----------- packages/tinybird/pipes/__ttl_1d.pipe | 22 ----------- .../tinybird/pipes/__ttl_1d_chart_get.pipe | 27 ------------- .../tinybird/pipes/__ttl_1d_list_get.pipe | 13 ------- .../tinybird/pipes/__ttl_1d_metrics_get.pipe | 36 ------------------ .../pipes/__ttl_1d_metrics_get_by_region.pipe | 21 ---------- packages/tinybird/pipes/__ttl_1h.pipe | 22 ----------- .../tinybird/pipes/__ttl_1h_chart_get.pipe | 25 ------------ .../__ttl_1h_last_timestamp_monitor_get.pipe | 12 ------ ...__ttl_1h_last_timestamp_workspace_get.pipe | 11 ------ .../tinybird/pipes/__ttl_1h_list_get.pipe | 14 ------- .../tinybird/pipes/__ttl_1h_metrics_get.pipe | 36 ------------------ .../pipes/__ttl_1h_metrics_get_by_region.pipe | 21 ---------- packages/tinybird/pipes/__ttl_3d.pipe | 22 ----------- .../tinybird/pipes/__ttl_3d_chart_get.pipe | 25 ------------ .../tinybird/pipes/__ttl_3d_list_get.pipe | 14 ------- .../tinybird/pipes/__ttl_3d_metrics_get.pipe | 36 ------------------ .../pipes/__ttl_3d_metrics_get_by_region.pipe | 22 ----------- packages/tinybird/pipes/__ttl_45d.pipe | 20 ---------- packages/tinybird/pipes/__ttl_45d_all.pipe | 11 ------ .../pipes/__ttl_45d_all_details_get.pipe | 14 ------- .../tinybird/pipes/__ttl_45d_count_utc.pipe | 23 ----------- .../pipes/__ttl_45d_count_utc_get.pipe | 5 ++- .../pipes/__ttl_45d_statuspage_get.pipe | 38 ------------------- packages/tinybird/pipes/__ttl_7d.pipe | 22 ----------- packages/tinybird/pipes/__ttl_7d_all.pipe | 11 ------ .../pipes/__ttl_7d_all_details_get.pipe | 14 ------- .../pipes/__ttl_7d_chart_all_regions_get.pipe | 23 ----------- .../tinybird/pipes/__ttl_7d_chart_get.pipe | 25 ------------ packages/tinybird/pipes/__ttl_7d_count.pipe | 24 ------------ .../tinybird/pipes/__ttl_7d_count_get.pipe | 22 ----------- .../tinybird/pipes/__ttl_7d_count_utc.pipe | 23 ----------- .../pipes/__ttl_7d_count_utc_get.pipe | 20 ---------- .../tinybird/pipes/__ttl_7d_list_get.pipe | 14 ------- .../tinybird/pipes/__ttl_7d_metrics_get.pipe | 36 ------------------ .../pipes/__ttl_7d_metrics_get_by_region.pipe | 22 ----------- .../pipes/__ttl_7d_statuspage_get.pipe | 38 ------------------- .../get_result_for_on_demand_check_http.pipe | 14 ++++--- .../tinybird/pipes/single_checks_get.pipe | 16 ++++++++ packages/tinybird/src/client.ts | 10 ++--- 65 files changed, 204 insertions(+), 1015 deletions(-) delete mode 100644 packages/tinybird/datasources/__ttl_3d_mv.datasource delete mode 100644 packages/tinybird/datasources/__ttl_45d_mv.datasource delete mode 100644 packages/tinybird/datasources/__ttl_7d_all_mv.datasource create mode 100644 packages/tinybird/datasources/check_response_http.datasource rename packages/tinybird/datasources/{__ttl_14d_mv.datasource => mv__http_14d.datasource} (61%) rename packages/tinybird/datasources/{__ttl_1d_mv.datasource => mv__http_1d.datasource} (66%) rename packages/tinybird/datasources/{__ttl_1h_mv.datasource => mv__http_30d.datasource} (58%) rename packages/tinybird/datasources/{__ttl_7d_mv.datasource => mv__http_7d.datasource} (61%) rename packages/tinybird/datasources/{__ttl_45d_all_mv.datasource => mv__http_full_30d.datasource} (56%) rename packages/tinybird/datasources/{__ttl_45d_count_utc_mv.datasource => mv__http_status_45d.datasource} (79%) rename packages/tinybird/datasources/{__ttl_7d_count_utc_mv.datasource => mv__http_status_7d.datasource} (79%) create mode 100644 packages/tinybird/datasources/mv__tcp_14d.datasource create mode 100644 packages/tinybird/datasources/mv__tcp_1d.datasource create mode 100644 packages/tinybird/datasources/mv__tcp_30d.datasource create mode 100644 packages/tinybird/datasources/mv__tcp_7d.datasource create mode 100644 packages/tinybird/datasources/mv__tcp_full_30d.datasource create mode 100644 packages/tinybird/datasources/mv__tcp_status_45d.datasource rename packages/tinybird/datasources/{__ttl_7d_count_mv.datasource => mv__tcp_status_7d.datasource} (54%) delete mode 100644 packages/tinybird/pipes/__ttl_14d.pipe delete mode 100644 packages/tinybird/pipes/__ttl_14d_chart_all_regions_get.pipe delete mode 100644 packages/tinybird/pipes/__ttl_14d_chart_get.pipe delete mode 100644 packages/tinybird/pipes/__ttl_14d_metrics_get.pipe delete mode 100644 packages/tinybird/pipes/__ttl_14d_metrics_get_by_region.pipe delete mode 100644 packages/tinybird/pipes/__ttl_1d.pipe delete mode 100644 packages/tinybird/pipes/__ttl_1d_chart_get.pipe delete mode 100644 packages/tinybird/pipes/__ttl_1d_list_get.pipe delete mode 100644 packages/tinybird/pipes/__ttl_1d_metrics_get.pipe delete mode 100644 packages/tinybird/pipes/__ttl_1d_metrics_get_by_region.pipe delete mode 100644 packages/tinybird/pipes/__ttl_1h.pipe delete mode 100644 packages/tinybird/pipes/__ttl_1h_chart_get.pipe delete mode 100644 packages/tinybird/pipes/__ttl_1h_last_timestamp_monitor_get.pipe delete mode 100644 packages/tinybird/pipes/__ttl_1h_last_timestamp_workspace_get.pipe delete mode 100644 packages/tinybird/pipes/__ttl_1h_list_get.pipe delete mode 100644 packages/tinybird/pipes/__ttl_1h_metrics_get.pipe delete mode 100644 packages/tinybird/pipes/__ttl_1h_metrics_get_by_region.pipe delete mode 100644 packages/tinybird/pipes/__ttl_3d.pipe delete mode 100644 packages/tinybird/pipes/__ttl_3d_chart_get.pipe delete mode 100644 packages/tinybird/pipes/__ttl_3d_list_get.pipe delete mode 100644 packages/tinybird/pipes/__ttl_3d_metrics_get.pipe delete mode 100644 packages/tinybird/pipes/__ttl_3d_metrics_get_by_region.pipe delete mode 100644 packages/tinybird/pipes/__ttl_45d.pipe delete mode 100644 packages/tinybird/pipes/__ttl_45d_all.pipe delete mode 100644 packages/tinybird/pipes/__ttl_45d_all_details_get.pipe delete mode 100644 packages/tinybird/pipes/__ttl_45d_count_utc.pipe delete mode 100644 packages/tinybird/pipes/__ttl_45d_statuspage_get.pipe delete mode 100644 packages/tinybird/pipes/__ttl_7d.pipe delete mode 100644 packages/tinybird/pipes/__ttl_7d_all.pipe delete mode 100644 packages/tinybird/pipes/__ttl_7d_all_details_get.pipe delete mode 100644 packages/tinybird/pipes/__ttl_7d_chart_all_regions_get.pipe delete mode 100644 packages/tinybird/pipes/__ttl_7d_chart_get.pipe delete mode 100644 packages/tinybird/pipes/__ttl_7d_count.pipe delete mode 100644 packages/tinybird/pipes/__ttl_7d_count_get.pipe delete mode 100644 packages/tinybird/pipes/__ttl_7d_count_utc.pipe delete mode 100644 packages/tinybird/pipes/__ttl_7d_count_utc_get.pipe delete mode 100644 packages/tinybird/pipes/__ttl_7d_list_get.pipe delete mode 100644 packages/tinybird/pipes/__ttl_7d_metrics_get.pipe delete mode 100644 packages/tinybird/pipes/__ttl_7d_metrics_get_by_region.pipe delete mode 100644 packages/tinybird/pipes/__ttl_7d_statuspage_get.pipe create mode 100644 packages/tinybird/pipes/single_checks_get.pipe diff --git a/apps/web/src/components/forms/monitor/section-scheduling.tsx b/apps/web/src/components/forms/monitor/section-scheduling.tsx index 425e916e..6f8b9afd 100644 --- a/apps/web/src/components/forms/monitor/section-scheduling.tsx +++ b/apps/web/src/components/forms/monitor/section-scheduling.tsx @@ -153,7 +153,6 @@ export function SectionScheduling({ form, limits, plan }: Props) { item.code, )} onCheckedChange={(checked) => { - console.log(field.value); return checked ? field.onChange([ ...(field.value diff --git a/packages/tinybird/datasources/__ttl_3d_mv.datasource b/packages/tinybird/datasources/__ttl_3d_mv.datasource deleted file mode 100644 index 27fb0811..00000000 --- a/packages/tinybird/datasources/__ttl_3d_mv.datasource +++ /dev/null @@ -1,17 +0,0 @@ -# Data Source created from Pipe '__ttl_3d__v0' -VERSION 0 - -SCHEMA > - `time` DateTime, - `latency` Int64, - `monitorId` String, - `region` LowCardinality(String), - `statusCode` Nullable(Int16), - `url` String, - `workspaceId` String, - `cronTimestamp` Int64 - -ENGINE "MergeTree" -ENGINE_PARTITION_KEY "toYYYYMM(time)" -ENGINE_SORTING_KEY "monitorId, time" -ENGINE_TTL "time + toIntervalDay(3)" diff --git a/packages/tinybird/datasources/__ttl_45d_mv.datasource b/packages/tinybird/datasources/__ttl_45d_mv.datasource deleted file mode 100644 index 28a9f2dd..00000000 --- a/packages/tinybird/datasources/__ttl_45d_mv.datasource +++ /dev/null @@ -1,17 +0,0 @@ -# Data Source created from Pipe '__ttl_45d__v0' -VERSION 0 - -SCHEMA > - `time` DateTime, - `latency` Int64, - `monitorId` String, - `region` LowCardinality(String), - `statusCode` Nullable(Int16), - `url` String, - `workspaceId` String, - `cronTimestamp` Int64 - -ENGINE "MergeTree" -ENGINE_PARTITION_KEY "toYYYYMM(time)" -ENGINE_SORTING_KEY "monitorId, time" -ENGINE_TTL "time + toIntervalDay(45)" diff --git a/packages/tinybird/datasources/__ttl_7d_all_mv.datasource b/packages/tinybird/datasources/__ttl_7d_all_mv.datasource deleted file mode 100644 index c024fe10..00000000 --- a/packages/tinybird/datasources/__ttl_7d_all_mv.datasource +++ /dev/null @@ -1,22 +0,0 @@ -VERSION 0 - -# Data Source created from Pipe '__ttl_7d_all__v0' - -SCHEMA > - `time` DateTime, - `latency` Int64, - `monitorId` String, - `region` LowCardinality(String), - `statusCode` Nullable(Int16), - `timestamp` Int64, - `url` String, - `workspaceId` String, - `cronTimestamp` Int64, - `message` Nullable(String), - `timing` Nullable(String), - `headers` Nullable(String) - -ENGINE "MergeTree" -ENGINE_PARTITION_KEY "toYYYYMM(time)" -ENGINE_SORTING_KEY "monitorId, cronTimestamp, time" -ENGINE_TTL "time + toIntervalDay(7)" diff --git a/packages/tinybird/datasources/check_response_http.datasource b/packages/tinybird/datasources/check_response_http.datasource new file mode 100644 index 00000000..0e286d05 --- /dev/null +++ b/packages/tinybird/datasources/check_response_http.datasource @@ -0,0 +1,15 @@ +VERSION 0 + +SCHEMA > + `body` String `json:$.body`, + `headers` String `json:$.headers`, + `latency` Int32 `json:$.latency`, + `region` String `json:$.region`, + `requestId` Int16 `json:$.requestId`, + `statusCode` Int16 `json:$.statusCode`, + `timestamp` Int64 `json:$.timestamp`, + `timing` String `json:$.timing`, + `workspaceId` Int16 `json:$.workspaceId` + +ENGINE "MergeTree" +ENGINE_SORTING_KEY "timestamp, timing, workspaceId" diff --git a/packages/tinybird/datasources/__ttl_14d_mv.datasource b/packages/tinybird/datasources/mv__http_14d.datasource similarity index 61% rename from packages/tinybird/datasources/__ttl_14d_mv.datasource rename to packages/tinybird/datasources/mv__http_14d.datasource index 22c76b61..5195321a 100644 --- a/packages/tinybird/datasources/__ttl_14d_mv.datasource +++ b/packages/tinybird/datasources/mv__http_14d.datasource @@ -1,15 +1,17 @@ -# Data Source created from Pipe '__ttl_14d__v0' VERSION 0 +# Data Source created from Pipe 'aggregate__http_14d__v0' SCHEMA > `time` DateTime, `latency` Int64, - `monitorId` String, + `error` Int8, `region` LowCardinality(String), + `trigger` Nullable(String), `statusCode` Nullable(Int16), - `url` String, - `workspaceId` String, - `cronTimestamp` Int64 + `timestamp` Int64, + `cronTimestamp` Int64, + `monitorId` String, + `workspaceId` String ENGINE "MergeTree" ENGINE_PARTITION_KEY "toYYYYMM(time)" diff --git a/packages/tinybird/datasources/__ttl_1d_mv.datasource b/packages/tinybird/datasources/mv__http_1d.datasource similarity index 66% rename from packages/tinybird/datasources/__ttl_1d_mv.datasource rename to packages/tinybird/datasources/mv__http_1d.datasource index bbd41ff3..764c43d4 100644 --- a/packages/tinybird/datasources/__ttl_1d_mv.datasource +++ b/packages/tinybird/datasources/mv__http_1d.datasource @@ -1,16 +1,17 @@ -# Data Source created from Pipe '__ttl_1d__v0' VERSION 0 +# Data Source created from Pipe 'aggregate__http_1d__v0' SCHEMA > `time` DateTime, `latency` Int64, - `monitorId` String, + `error` Int8, `region` LowCardinality(String), + `trigger` Nullable(String), `statusCode` Nullable(Int16), - `url` String, - `workspaceId` String, `timestamp` Int64, - `cronTimestamp` Int64 + `cronTimestamp` Int64, + `monitorId` String, + `workspaceId` String ENGINE "MergeTree" ENGINE_PARTITION_KEY "toYYYYMM(time)" diff --git a/packages/tinybird/datasources/__ttl_1h_mv.datasource b/packages/tinybird/datasources/mv__http_30d.datasource similarity index 58% rename from packages/tinybird/datasources/__ttl_1h_mv.datasource rename to packages/tinybird/datasources/mv__http_30d.datasource index 046855a6..6c116f20 100644 --- a/packages/tinybird/datasources/__ttl_1h_mv.datasource +++ b/packages/tinybird/datasources/mv__http_30d.datasource @@ -1,18 +1,19 @@ -# Data Source created from Pipe '__ttl_1h__v0' VERSION 0 +# Data Source created from Pipe 'aggregate__http_30d__v0' SCHEMA > `time` DateTime, `latency` Int64, - `monitorId` String, + `error` Int8, `region` LowCardinality(String), + `trigger` Nullable(String), `statusCode` Nullable(Int16), - `url` String, - `workspaceId` String, `timestamp` Int64, - `cronTimestamp` Int64 + `cronTimestamp` Int64, + `monitorId` String, + `workspaceId` String ENGINE "MergeTree" ENGINE_PARTITION_KEY "toYYYYMM(time)" ENGINE_SORTING_KEY "monitorId, time" -ENGINE_TTL "time + toIntervalHour(1)" +ENGINE_TTL "time + toIntervalDay(30)" diff --git a/packages/tinybird/datasources/__ttl_7d_mv.datasource b/packages/tinybird/datasources/mv__http_7d.datasource similarity index 61% rename from packages/tinybird/datasources/__ttl_7d_mv.datasource rename to packages/tinybird/datasources/mv__http_7d.datasource index 0dd7f5be..a45060c0 100644 --- a/packages/tinybird/datasources/__ttl_7d_mv.datasource +++ b/packages/tinybird/datasources/mv__http_7d.datasource @@ -1,15 +1,17 @@ -# Data Source created from Pipe '__ttl_7d__v0' VERSION 0 +# Data Source created from Pipe 'aggregate__http_7d__v0' SCHEMA > `time` DateTime, `latency` Int64, - `monitorId` String, + `error` Int8, `region` LowCardinality(String), + `trigger` Nullable(String), `statusCode` Nullable(Int16), - `url` String, - `workspaceId` String, - `cronTimestamp` Int64 + `timestamp` Int64, + `cronTimestamp` Int64, + `monitorId` String, + `workspaceId` String ENGINE "MergeTree" ENGINE_PARTITION_KEY "toYYYYMM(time)" diff --git a/packages/tinybird/datasources/__ttl_45d_all_mv.datasource b/packages/tinybird/datasources/mv__http_full_30d.datasource similarity index 56% rename from packages/tinybird/datasources/__ttl_45d_all_mv.datasource rename to packages/tinybird/datasources/mv__http_full_30d.datasource index 1e4ed03e..8a86b69b 100644 --- a/packages/tinybird/datasources/__ttl_45d_all_mv.datasource +++ b/packages/tinybird/datasources/mv__http_full_30d.datasource @@ -1,6 +1,5 @@ VERSION 0 - -# Data Source created from Pipe '__ttl_45d_all__v0' +# Data Source created from Pipe 'aggregate__http_full_30d__v0' SCHEMA > `time` DateTime, @@ -8,15 +7,19 @@ SCHEMA > `monitorId` String, `region` LowCardinality(String), `statusCode` Nullable(Int16), + `error` Int8, `timestamp` Int64, `url` String, `workspaceId` String, `cronTimestamp` Int64, `message` Nullable(String), `timing` Nullable(String), - `headers` Nullable(String) + `headers` Nullable(String), + `assertions` Nullable(String), + `body` Nullable(String), + `trigger` Nullable(String) ENGINE "MergeTree" ENGINE_PARTITION_KEY "toYYYYMM(time)" -ENGINE_SORTING_KEY "monitorId, cronTimestamp, time" -ENGINE_TTL "time + toIntervalDay(45)" +ENGINE_SORTING_KEY "monitorId, time" +ENGINE_TTL "time + toIntervalDay(30)" diff --git a/packages/tinybird/datasources/__ttl_45d_count_utc_mv.datasource b/packages/tinybird/datasources/mv__http_status_45d.datasource similarity index 79% rename from packages/tinybird/datasources/__ttl_45d_count_utc_mv.datasource rename to packages/tinybird/datasources/mv__http_status_45d.datasource index 9653d865..ca1b3799 100644 --- a/packages/tinybird/datasources/__ttl_45d_count_utc_mv.datasource +++ b/packages/tinybird/datasources/mv__http_status_45d.datasource @@ -1,5 +1,5 @@ -# Data Source created from Pipe '__ttl_45d_count_utc__v1' -VERSION 1 +VERSION 0 +# Data Source created from Pipe 'aggregate__http_status_45d__v0' SCHEMA > `time` DateTime('UTC'), diff --git a/packages/tinybird/datasources/__ttl_7d_count_utc_mv.datasource b/packages/tinybird/datasources/mv__http_status_7d.datasource similarity index 79% rename from packages/tinybird/datasources/__ttl_7d_count_utc_mv.datasource rename to packages/tinybird/datasources/mv__http_status_7d.datasource index 03d716e7..1c2e74fe 100644 --- a/packages/tinybird/datasources/__ttl_7d_count_utc_mv.datasource +++ b/packages/tinybird/datasources/mv__http_status_7d.datasource @@ -1,5 +1,5 @@ -# Data Source created from Pipe '__ttl_7d_count_utc__v1' -VERSION 1 +VERSION 0 +# Data Source created from Pipe 'aggregate__http_status_7d__v0' SCHEMA > `time` DateTime('UTC'), diff --git a/packages/tinybird/datasources/mv__tcp_14d.datasource b/packages/tinybird/datasources/mv__tcp_14d.datasource new file mode 100644 index 00000000..79098c67 --- /dev/null +++ b/packages/tinybird/datasources/mv__tcp_14d.datasource @@ -0,0 +1,18 @@ +VERSION 0 +# Data Source created from Pipe 'aggregate__tcp_14d__v0' + +SCHEMA > + `time` DateTime, + `latency` Int64, + `error` Int16, + `region` String, + `trigger` Nullable(String), + `timestamp` Int64, + `cronTimestamp` Int64, + `monitorId` Int32, + `workspaceId` Int32 + +ENGINE "MergeTree" +ENGINE_PARTITION_KEY "toYYYYMM(time)" +ENGINE_SORTING_KEY "monitorId, time" +ENGINE_TTL "time + toIntervalDay(14)" diff --git a/packages/tinybird/datasources/mv__tcp_1d.datasource b/packages/tinybird/datasources/mv__tcp_1d.datasource new file mode 100644 index 00000000..4621e547 --- /dev/null +++ b/packages/tinybird/datasources/mv__tcp_1d.datasource @@ -0,0 +1,18 @@ +VERSION 0 +# Data Source created from Pipe 'aggregate__tcp_1d__v0' + +SCHEMA > + `time` DateTime, + `latency` Int64, + `error` Int16, + `region` String, + `trigger` Nullable(String), + `timestamp` Int64, + `cronTimestamp` Int64, + `monitorId` Int32, + `workspaceId` Int32 + +ENGINE "MergeTree" +ENGINE_PARTITION_KEY "toYYYYMM(time)" +ENGINE_SORTING_KEY "monitorId, time" +ENGINE_TTL "time + toIntervalDay(1)" diff --git a/packages/tinybird/datasources/mv__tcp_30d.datasource b/packages/tinybird/datasources/mv__tcp_30d.datasource new file mode 100644 index 00000000..5a618550 --- /dev/null +++ b/packages/tinybird/datasources/mv__tcp_30d.datasource @@ -0,0 +1,18 @@ +VERSION 0 +# Data Source created from Pipe 'aggregate__tcp_30d__v0' + +SCHEMA > + `time` DateTime, + `latency` Int64, + `error` Int16, + `region` String, + `trigger` Nullable(String), + `timestamp` Int64, + `cronTimestamp` Int64, + `monitorId` Int32, + `workspaceId` Int32 + +ENGINE "MergeTree" +ENGINE_PARTITION_KEY "toYYYYMM(time)" +ENGINE_SORTING_KEY "monitorId, time" +ENGINE_TTL "time + toIntervalDay(30)" diff --git a/packages/tinybird/datasources/mv__tcp_7d.datasource b/packages/tinybird/datasources/mv__tcp_7d.datasource new file mode 100644 index 00000000..278da974 --- /dev/null +++ b/packages/tinybird/datasources/mv__tcp_7d.datasource @@ -0,0 +1,18 @@ +VERSION 0 +# Data Source created from Pipe 'aggregate__tcp_7d__v0' + +SCHEMA > + `time` DateTime, + `latency` Int64, + `error` Int16, + `region` String, + `trigger` Nullable(String), + `timestamp` Int64, + `cronTimestamp` Int64, + `monitorId` Int32, + `workspaceId` Int32 + +ENGINE "MergeTree" +ENGINE_PARTITION_KEY "toYYYYMM(time)" +ENGINE_SORTING_KEY "monitorId, time" +ENGINE_TTL "time + toIntervalDay(7)" diff --git a/packages/tinybird/datasources/mv__tcp_full_30d.datasource b/packages/tinybird/datasources/mv__tcp_full_30d.datasource new file mode 100644 index 00000000..86e7f9c4 --- /dev/null +++ b/packages/tinybird/datasources/mv__tcp_full_30d.datasource @@ -0,0 +1,21 @@ +VERSION 0 +# Data Source created from Pipe 'aggregate__tcp_full_30d__v0' + +SCHEMA > + `time` DateTime, + `monitorId` Int32, + `region` String, + `timestamp` Int64, + `cronTimestamp` Int64, + `timing` String, + `workspaceId` Int32, + `latency` Int64, + `errorMessage` Nullable(String), + `error` Int16, + `trigger` Nullable(String), + `uri` Nullable(String) + +ENGINE "MergeTree" +ENGINE_PARTITION_KEY "toYYYYMM(time)" +ENGINE_SORTING_KEY "monitorId, time" +ENGINE_TTL "time + toIntervalDay(30)" diff --git a/packages/tinybird/datasources/mv__tcp_status_45d.datasource b/packages/tinybird/datasources/mv__tcp_status_45d.datasource new file mode 100644 index 00000000..3bb59b74 --- /dev/null +++ b/packages/tinybird/datasources/mv__tcp_status_45d.datasource @@ -0,0 +1,13 @@ +VERSION 0 +# Data Source created from Pipe 'aggregate__tcp_status_45d__v0' + +SCHEMA > + `time` DateTime('UTC'), + `monitorId` Int32, + `count` AggregateFunction(count), + `ok` AggregateFunction(count, Nullable(UInt8)) + +ENGINE "AggregatingMergeTree" +ENGINE_PARTITION_KEY "toYYYYMM(time)" +ENGINE_SORTING_KEY "monitorId, time" +ENGINE_TTL "time + toIntervalDay(45)" diff --git a/packages/tinybird/datasources/__ttl_7d_count_mv.datasource b/packages/tinybird/datasources/mv__tcp_status_7d.datasource similarity index 54% rename from packages/tinybird/datasources/__ttl_7d_count_mv.datasource rename to packages/tinybird/datasources/mv__tcp_status_7d.datasource index df51e976..e3eea9c9 100644 --- a/packages/tinybird/datasources/__ttl_7d_count_mv.datasource +++ b/packages/tinybird/datasources/mv__tcp_status_7d.datasource @@ -1,14 +1,13 @@ -VERSION 1 -# Data Source created from Pipe '__ttl_7d_count__v1' +VERSION 0 +# Data Source created from Pipe 'aggregate__tcp_status_7d__v0' SCHEMA > - `time` DateTime, - `monitorId` String, - `url` String, + `time` DateTime('UTC'), + `monitorId` Int32, `count` AggregateFunction(count), `ok` AggregateFunction(count, Nullable(UInt8)) ENGINE "AggregatingMergeTree" ENGINE_PARTITION_KEY "toYYYYMM(time)" -ENGINE_SORTING_KEY "time, monitorId, url" +ENGINE_SORTING_KEY "monitorId, time" ENGINE_TTL "time + toIntervalDay(7)" diff --git a/packages/tinybird/datasources/ping_response.datasource b/packages/tinybird/datasources/ping_response.datasource index e5a17562..750dcad0 100644 --- a/packages/tinybird/datasources/ping_response.datasource +++ b/packages/tinybird/datasources/ping_response.datasource @@ -1,10 +1,11 @@ -VERSION 6 +VERSION 8 SCHEMA > `latency` Int64 `json:$.latency`, `monitorId` String `json:$.monitorId`, `region` LowCardinality(String) `json:$.region`, `statusCode` Nullable(Int16) `json:$.statusCode`, + `error` Int8 `json:$.error`, `timestamp` Int64 `json:$.timestamp`, `url` String `json:$.url`, `workspaceId` String `json:$.workspaceId`, @@ -12,6 +13,9 @@ SCHEMA > `message` Nullable(String) `json:$.message`, `timing` Nullable(String) `json:$.timing`, `headers` Nullable(String) `json:$.headers`, + `assertions` Nullable(String) `json:$.assertions`, + `body` Nullable(String) `json:$.body`, + `trigger` Nullable(String) `json:$.trigger`, ENGINE "MergeTree" ENGINE_SORTING_KEY "monitorId, cronTimestamp" diff --git a/packages/tinybird/datasources/tcp_response.datasource b/packages/tinybird/datasources/tcp_response.datasource index 1fef0008..5d2d62f5 100644 --- a/packages/tinybird/datasources/tcp_response.datasource +++ b/packages/tinybird/datasources/tcp_response.datasource @@ -6,12 +6,12 @@ SCHEMA > `timestamp` Int64 `json:$.timestamp`, `cronTimestamp` Int64 `json:$.timestamp`, `timing` String `json:$.timing`, - `uri` String `json:$.uri`, `workspaceId` Int32 `json:$.workspaceId`, `latency` Int64 `json:$.latency`, `errorMessage` Nullable(String) `json:$.errorMessage`, - `error` Int16 `json:$.error` + `error` Int16 `json:$.error`, `trigger` Nullable(String) `json:$.trigger`, + `uri` Nullable(String) `json:$.uri`, ENGINE "MergeTree" diff --git a/packages/tinybird/pipes/__ttl_14d.pipe b/packages/tinybird/pipes/__ttl_14d.pipe deleted file mode 100644 index f5969b22..00000000 --- a/packages/tinybird/pipes/__ttl_14d.pipe +++ /dev/null @@ -1,21 +0,0 @@ -VERSION 1 - -NODE __ttl_14d_0 -SQL > - - SELECT - toDateTime(fromUnixTimestamp64Milli(cronTimestamp)) AS time, - latency, - monitorId, - error, - region, - statusCode, - url, - workspaceId, - cronTimestamp - FROM ping_response__v7 - -TYPE materialized -DATASOURCE __ttl_14d_mv__v1 - - diff --git a/packages/tinybird/pipes/__ttl_14d_chart_all_regions_get.pipe b/packages/tinybird/pipes/__ttl_14d_chart_all_regions_get.pipe deleted file mode 100644 index d67c1fb1..00000000 --- a/packages/tinybird/pipes/__ttl_14d_chart_all_regions_get.pipe +++ /dev/null @@ -1,23 +0,0 @@ -VERSION 1 -TOKEN "__ttl_14d_chart_all_regions_get__v1_endpoint_read_6659" READ - -NODE __ttl_14d_chart_all_regions_get_0 -SQL > - - % - SELECT - toStartOfInterval( - toDateTime(cronTimestamp / 1000), INTERVAL 1 HOUR - ) as h, - toUnixTimestamp64Milli(toDateTime64(h, 3)) as timestamp, - round(quantile(0.5)(latency)) as p50Latency, - round(quantile(0.75)(latency)) as p75Latency, - round(quantile(0.9)(latency)) as p90Latency, - round(quantile(0.95)(latency)) as p95Latency, - round(quantile(0.99)(latency)) as p99Latency - FROM __ttl_14d_mv - WHERE monitorId = {{ String(monitorId, '1') }} - GROUP BY h - ORDER BY h DESC - - diff --git a/packages/tinybird/pipes/__ttl_14d_chart_get.pipe b/packages/tinybird/pipes/__ttl_14d_chart_get.pipe deleted file mode 100644 index 00ef2490..00000000 --- a/packages/tinybird/pipes/__ttl_14d_chart_get.pipe +++ /dev/null @@ -1,25 +0,0 @@ -VERSION 1 - -NODE __ttl_14d_chart_get_0 -SQL > - - % - SELECT - region, - toStartOfInterval( - toDateTime(cronTimestamp / 1000), - INTERVAL {{ Int64(interval, 30) }} MINUTE - ) as h, - toUnixTimestamp64Milli(toDateTime64(h, 3)) as timestamp, - round(quantile(0.5)(latency)) as p50Latency, - round(quantile(0.75)(latency)) as p75Latency, - round(quantile(0.9)(latency)) as p90Latency, - round(quantile(0.95)(latency)) as p95Latency, - round(quantile(0.99)(latency)) as p99Latency - FROM __ttl_14d_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - GROUP BY h, region - ORDER BY h DESC - - diff --git a/packages/tinybird/pipes/__ttl_14d_metrics_get.pipe b/packages/tinybird/pipes/__ttl_14d_metrics_get.pipe deleted file mode 100644 index 13b8fd61..00000000 --- a/packages/tinybird/pipes/__ttl_14d_metrics_get.pipe +++ /dev/null @@ -1,36 +0,0 @@ -VERSION 1 - -NODE __ttl_14d_metrics_get_0 -SQL > - - % - SELECT - round(quantile(0.5)(latency)) as p50Latency, - round(quantile(0.75)(latency)) as p75Latency, - round(quantile(0.9)(latency)) as p90Latency, - round(quantile(0.95)(latency)) as p95Latency, - round(quantile(0.99)(latency)) as p99Latency, - count() as count, - count(if(error = 0, 1, NULL)) AS ok, - max(cronTimestamp) AS lastTimestamp - FROM __ttl_14d_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - AND time >= toDateTime64(now() - INTERVAL 14 DAY, 3) - UNION ALL - SELECT - round(quantile(0.5)(latency)) AS p50Latency, - round(quantile(0.75)(latency)) AS p75Latency, - round(quantile(0.9)(latency)) AS p90Latency, - round(quantile(0.95)(latency)) AS p95Latency, - round(quantile(0.99)(latency)) AS p99Latency, - count() as count, - count(if(error = 0, 1, NULL)) AS ok, - NULL as lastTimestamp -- no need to query the `lastTimestamp` as not relevant - FROM __ttl_45d_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - AND time >= toDateTime64(now() - INTERVAL 28 DAY, 3) - AND time < toDateTime64(now() - INTERVAL 14 DAY, 3) - - diff --git a/packages/tinybird/pipes/__ttl_14d_metrics_get_by_region.pipe b/packages/tinybird/pipes/__ttl_14d_metrics_get_by_region.pipe deleted file mode 100644 index 160543f8..00000000 --- a/packages/tinybird/pipes/__ttl_14d_metrics_get_by_region.pipe +++ /dev/null @@ -1,22 +0,0 @@ -VERSION 1 - -NODE __ttl_14d_metrics_get_by_region_0 -SQL > - - % - SELECT - region, - round(quantile(0.5)(latency)) as p50Latency, - round(quantile(0.75)(latency)) as p75Latency, - round(quantile(0.9)(latency)) as p90Latency, - round(quantile(0.95)(latency)) as p95Latency, - round(quantile(0.99)(latency)) as p99Latency, - count() as count, - count(if(error = 0, 1, NULL)) AS ok, - max(cronTimestamp) AS lastTimestamp - FROM __ttl_14d_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - GROUP BY region - - diff --git a/packages/tinybird/pipes/__ttl_1d.pipe b/packages/tinybird/pipes/__ttl_1d.pipe deleted file mode 100644 index e12b539e..00000000 --- a/packages/tinybird/pipes/__ttl_1d.pipe +++ /dev/null @@ -1,22 +0,0 @@ -VERSION 1 - -NODE __ttl_1d_0 -SQL > - - SELECT - toDateTime(fromUnixTimestamp64Milli(cronTimestamp)) AS time, - latency, - monitorId, - error, - region, - statusCode, - url, - workspaceId, - timestamp, - cronTimestamp - FROM ping_response__v8 - -TYPE materialized -DATASOURCE __ttl_1d_mv__v1 - - diff --git a/packages/tinybird/pipes/__ttl_1d_chart_get.pipe b/packages/tinybird/pipes/__ttl_1d_chart_get.pipe deleted file mode 100644 index 72129941..00000000 --- a/packages/tinybird/pipes/__ttl_1d_chart_get.pipe +++ /dev/null @@ -1,27 +0,0 @@ -VERSION 1 - -TOKEN "__ttl_1d_chart_get_endpoint_read_4815" READ - -NODE __ttl_1d_chart_get_0 -SQL > - - % - SELECT - region, - toStartOfInterval( - toDateTime(cronTimestamp / 1000), - INTERVAL {{ Int64(interval, 30) }} MINUTE - ) as h, - toUnixTimestamp64Milli(toDateTime64(h, 3)) as timestamp, - round(quantile(0.5)(latency)) as p50Latency, - round(quantile(0.75)(latency)) as p75Latency, - round(quantile(0.9)(latency)) as p90Latency, - round(quantile(0.95)(latency)) as p95Latency, - round(quantile(0.99)(latency)) as p99Latency - FROM __ttl_1d_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - GROUP BY h, region - ORDER BY h DESC - - diff --git a/packages/tinybird/pipes/__ttl_1d_list_get.pipe b/packages/tinybird/pipes/__ttl_1d_list_get.pipe deleted file mode 100644 index c3b5b5b9..00000000 --- a/packages/tinybird/pipes/__ttl_1d_list_get.pipe +++ /dev/null @@ -1,13 +0,0 @@ -VERSION 1 - -NODE __ttl_1d_list_get__v0_0 -SQL > - - % - SELECT latency, monitorId, error, region, statusCode, timestamp, url, workspaceId, cronTimestamp - FROM __ttl_1d_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - ORDER BY cronTimestamp DESC - - diff --git a/packages/tinybird/pipes/__ttl_1d_metrics_get.pipe b/packages/tinybird/pipes/__ttl_1d_metrics_get.pipe deleted file mode 100644 index 20e2546f..00000000 --- a/packages/tinybird/pipes/__ttl_1d_metrics_get.pipe +++ /dev/null @@ -1,36 +0,0 @@ -VERSION 1 - -NODE __ttl_1d_metrics_get_0 -SQL > - - % - SELECT - round(quantile(0.5)(latency)) as p50Latency, - round(quantile(0.75)(latency)) as p75Latency, - round(quantile(0.9)(latency)) as p90Latency, - round(quantile(0.95)(latency)) as p95Latency, - round(quantile(0.99)(latency)) as p99Latency, - count() as count, - count(if(error = 0, 1, NULL)) AS ok, - max(cronTimestamp) AS lastTimestamp - FROM __ttl_1d_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - AND time >= toDateTime64(now() - INTERVAL 1 DAY, 3) - UNION ALL - SELECT - round(quantile(0.5)(latency)) AS p50Latency, - round(quantile(0.75)(latency)) AS p75Latency, - round(quantile(0.9)(latency)) AS p90Latency, - round(quantile(0.95)(latency)) AS p95Latency, - round(quantile(0.99)(latency)) AS p99Latency, - count() as count, - count(if(error = 0, 1, NULL)) AS ok, - NULL as lastTimestamp -- no need to query the `lastTimestamp` as not relevant - FROM __ttl_3d_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - AND time >= toDateTime64(now() - INTERVAL 2 DAY, 3) - AND time < toDateTime64(now() - INTERVAL 1 DAY, 3) - - diff --git a/packages/tinybird/pipes/__ttl_1d_metrics_get_by_region.pipe b/packages/tinybird/pipes/__ttl_1d_metrics_get_by_region.pipe deleted file mode 100644 index d6b551c7..00000000 --- a/packages/tinybird/pipes/__ttl_1d_metrics_get_by_region.pipe +++ /dev/null @@ -1,21 +0,0 @@ -VERSION 1 - -NODE __ttl_1d_metrics_get_by_region_0 -SQL > - - % - SELECT - region, - round(quantile(0.5)(latency)) as p50Latency, - round(quantile(0.75)(latency)) as p75Latency, - round(quantile(0.9)(latency)) as p90Latency, - round(quantile(0.95)(latency)) as p95Latency, - round(quantile(0.99)(latency)) as p99Latency, - count() as count, - count(if(error = 0, 1, NULL)) AS ok - FROM __ttl_1d_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - GROUP BY region - - diff --git a/packages/tinybird/pipes/__ttl_1h.pipe b/packages/tinybird/pipes/__ttl_1h.pipe deleted file mode 100644 index 3886bb36..00000000 --- a/packages/tinybird/pipes/__ttl_1h.pipe +++ /dev/null @@ -1,22 +0,0 @@ -VERSION 1 - -NODE __ttl_1h_0 -SQL > - - SELECT - toDateTime(fromUnixTimestamp64Milli(cronTimestamp)) AS time, - latency, - monitorId, - error, - region, - statusCode, - url, - workspaceId, - timestamp, - cronTimestamp - FROM ping_response__v8 - -TYPE materialized -DATASOURCE __ttl_1h_mv__v1 - - diff --git a/packages/tinybird/pipes/__ttl_1h_chart_get.pipe b/packages/tinybird/pipes/__ttl_1h_chart_get.pipe deleted file mode 100644 index fa999b06..00000000 --- a/packages/tinybird/pipes/__ttl_1h_chart_get.pipe +++ /dev/null @@ -1,25 +0,0 @@ -VERSION 1 - -NODE __ttl_1h_chart_get_0 -SQL > - - % - SELECT - region, - toStartOfInterval( - toDateTime(cronTimestamp / 1000), - INTERVAL {{ Int64(interval, 30) }} MINUTE - ) as h, - toUnixTimestamp64Milli(toDateTime64(h, 3)) as timestamp, - round(quantile(0.5)(latency)) as p50Latency, - round(quantile(0.75)(latency)) as p75Latency, - round(quantile(0.9)(latency)) as p90Latency, - round(quantile(0.95)(latency)) as p95Latency, - round(quantile(0.99)(latency)) as p99Latency - FROM __ttl_1h_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - GROUP BY h, region - ORDER BY h DESC - - diff --git a/packages/tinybird/pipes/__ttl_1h_last_timestamp_monitor_get.pipe b/packages/tinybird/pipes/__ttl_1h_last_timestamp_monitor_get.pipe deleted file mode 100644 index 4ec0173e..00000000 --- a/packages/tinybird/pipes/__ttl_1h_last_timestamp_monitor_get.pipe +++ /dev/null @@ -1,12 +0,0 @@ -VERSION 1 - -NODE __ttl_1h_last_timestamp_monitor_get__v0_0 -SQL > - - % - SELECT max(cronTimestamp) as cronTimestamp - FROM __ttl_1h_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - - diff --git a/packages/tinybird/pipes/__ttl_1h_last_timestamp_workspace_get.pipe b/packages/tinybird/pipes/__ttl_1h_last_timestamp_workspace_get.pipe deleted file mode 100644 index a86ee313..00000000 --- a/packages/tinybird/pipes/__ttl_1h_last_timestamp_workspace_get.pipe +++ /dev/null @@ -1,11 +0,0 @@ -VERSION 1 - -NODE __ttl_1h_last_timestamp_workspace_get__v0_0 -SQL > - - % - SELECT max(cronTimestamp) as cronTimestamp - FROM __ttl_1h_mv__v1 - WHERE workspaceId = {{ String(workspaceId, '1') }} - - diff --git a/packages/tinybird/pipes/__ttl_1h_list_get.pipe b/packages/tinybird/pipes/__ttl_1h_list_get.pipe deleted file mode 100644 index 0e9c1dbf..00000000 --- a/packages/tinybird/pipes/__ttl_1h_list_get.pipe +++ /dev/null @@ -1,14 +0,0 @@ -VERSION 1 - -NODE __ttl_1h_list_get__v0_0 -SQL > - - % - -- FIXME: `timestamp` is missing on 1h, 3d, 7d, 45d mv! - SELECT latency, monitorId, error, region, statusCode, url, workspaceId, cronTimestamp, timestamp - FROM __ttl_1h_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - ORDER BY cronTimestamp DESC - - diff --git a/packages/tinybird/pipes/__ttl_1h_metrics_get.pipe b/packages/tinybird/pipes/__ttl_1h_metrics_get.pipe deleted file mode 100644 index 2f637884..00000000 --- a/packages/tinybird/pipes/__ttl_1h_metrics_get.pipe +++ /dev/null @@ -1,36 +0,0 @@ -VERSION 1 - -NODE __ttl_1h_metrics_get_0 -SQL > - - % - SELECT - round(quantile(0.5)(latency)) as p50Latency, - round(quantile(0.75)(latency)) as p75Latency, - round(quantile(0.9)(latency)) as p90Latency, - round(quantile(0.95)(latency)) as p95Latency, - round(quantile(0.99)(latency)) as p99Latency, - count() as count, - count(if(error = 0, 1, NULL)) AS ok, - max(cronTimestamp) AS lastTimestamp - FROM __ttl_1h_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - AND time >= toDateTime64(now() - INTERVAL 1 HOUR, 3) - UNION ALL - SELECT - round(quantile(0.5)(latency)) AS p50Latency, - round(quantile(0.75)(latency)) AS p75Latency, - round(quantile(0.9)(latency)) AS p90Latency, - round(quantile(0.95)(latency)) AS p95Latency, - round(quantile(0.99)(latency)) AS p99Latency, - count() as count, - count(if(error = 0, 1, NULL)) AS ok, - NULL as lastTimestamp -- no need to query the `lastTimestamp` as not relevant - FROM __ttl_1d_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - AND time >= toDateTime64(now() - INTERVAL 2 HOUR, 3) - AND time < toDateTime64(now() - INTERVAL 1 HOUR, 3) - - diff --git a/packages/tinybird/pipes/__ttl_1h_metrics_get_by_region.pipe b/packages/tinybird/pipes/__ttl_1h_metrics_get_by_region.pipe deleted file mode 100644 index fe3f91e1..00000000 --- a/packages/tinybird/pipes/__ttl_1h_metrics_get_by_region.pipe +++ /dev/null @@ -1,21 +0,0 @@ -VERSION 1 - -NODE __ttl_1h_metrics_get_by_region_0 -SQL > - - % - SELECT - region, - round(quantile(0.5)(latency)) as p50Latency, - round(quantile(0.75)(latency)) as p75Latency, - round(quantile(0.9)(latency)) as p90Latency, - round(quantile(0.95)(latency)) as p95Latency, - round(quantile(0.99)(latency)) as p99Latency, - count() as count, - count(if(error = 0, 1, NULL)) AS ok, - FROM __ttl_1h_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - GROUP BY region - - diff --git a/packages/tinybird/pipes/__ttl_3d.pipe b/packages/tinybird/pipes/__ttl_3d.pipe deleted file mode 100644 index 5d3b6a8f..00000000 --- a/packages/tinybird/pipes/__ttl_3d.pipe +++ /dev/null @@ -1,22 +0,0 @@ -VERSION 1 - -NODE __ttl_3d_0 -SQL > - - SELECT - toDateTime(fromUnixTimestamp64Milli(cronTimestamp)) AS time, - latency, - monitorId, - error, - region, - statusCode, - url, - workspaceId, - cronTimestamp, - timestamp - FROM ping_response__v8 - -TYPE materialized -DATASOURCE __ttl_3d_mv__v1 - - diff --git a/packages/tinybird/pipes/__ttl_3d_chart_get.pipe b/packages/tinybird/pipes/__ttl_3d_chart_get.pipe deleted file mode 100644 index 68e27169..00000000 --- a/packages/tinybird/pipes/__ttl_3d_chart_get.pipe +++ /dev/null @@ -1,25 +0,0 @@ -VERSION 1 - -NODE __ttl_3d_chart_get_0 -SQL > - - % - SELECT - region, - toStartOfInterval( - toDateTime(cronTimestamp / 1000), - INTERVAL {{ Int64(interval, 30) }} MINUTE - ) as h, - toUnixTimestamp64Milli(toDateTime64(h, 3)) as timestamp, - round(quantile(0.5)(latency)) as p50Latency, - round(quantile(0.75)(latency)) as p75Latency, - round(quantile(0.9)(latency)) as p90Latency, - round(quantile(0.95)(latency)) as p95Latency, - round(quantile(0.99)(latency)) as p99Latency - FROM __ttl_3d_mv__v0 - WHERE - monitorId = {{ String(monitorId, '1') }} - GROUP BY h, region - ORDER BY h DESC - - diff --git a/packages/tinybird/pipes/__ttl_3d_list_get.pipe b/packages/tinybird/pipes/__ttl_3d_list_get.pipe deleted file mode 100644 index a3a2339d..00000000 --- a/packages/tinybird/pipes/__ttl_3d_list_get.pipe +++ /dev/null @@ -1,14 +0,0 @@ -VERSION 1 - -NODE __ttl_3d_list_get__v1_0 -SQL > - - % - SELECT latency, monitorId, error, region, statusCode, url, workspaceId, cronTimestamp, timestamp - FROM __ttl_3d_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - {% if defined(url) %} AND url = {{ String(url) }} {% end %} - ORDER BY cronTimestamp DESC - - diff --git a/packages/tinybird/pipes/__ttl_3d_metrics_get.pipe b/packages/tinybird/pipes/__ttl_3d_metrics_get.pipe deleted file mode 100644 index 157dad7f..00000000 --- a/packages/tinybird/pipes/__ttl_3d_metrics_get.pipe +++ /dev/null @@ -1,36 +0,0 @@ -VERSION 1 - -NODE __ttl_3d_metrics_get_0 -SQL > - - % - SELECT - round(quantile(0.5)(latency)) as p50Latency, - round(quantile(0.75)(latency)) as p75Latency, - round(quantile(0.9)(latency)) as p90Latency, - round(quantile(0.95)(latency)) as p95Latency, - round(quantile(0.99)(latency)) as p99Latency, - count() as count, - count(if(error = 0, 1, NULL)) AS ok, - max(cronTimestamp) AS lastTimestamp - FROM __ttl_3d_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - AND time >= toDateTime64(now() - INTERVAL 3 DAY, 3) - UNION ALL - SELECT - round(quantile(0.5)(latency)) AS p50Latency, - round(quantile(0.75)(latency)) AS p75Latency, - round(quantile(0.9)(latency)) AS p90Latency, - round(quantile(0.95)(latency)) AS p95Latency, - round(quantile(0.99)(latency)) AS p99Latency, - count() as count, - count(if(error = 0, 1, NULL)) AS ok, - NULL as lastTimestamp -- no need to query the `lastTimestamp` as not relevant - FROM __ttl_7d_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - AND time >= toDateTime64(now() - INTERVAL 6 DAY, 3) - AND time < toDateTime64(now() - INTERVAL 3 DAY, 3) - - diff --git a/packages/tinybird/pipes/__ttl_3d_metrics_get_by_region.pipe b/packages/tinybird/pipes/__ttl_3d_metrics_get_by_region.pipe deleted file mode 100644 index e04067d7..00000000 --- a/packages/tinybird/pipes/__ttl_3d_metrics_get_by_region.pipe +++ /dev/null @@ -1,22 +0,0 @@ -VERSION 1 - -NODE __ttl_3d_metrics_get_by_region_0 -SQL > - - % - SELECT - region, - round(quantile(0.5)(latency)) as p50Latency, - round(quantile(0.75)(latency)) as p75Latency, - round(quantile(0.9)(latency)) as p90Latency, - round(quantile(0.95)(latency)) as p95Latency, - round(quantile(0.99)(latency)) as p99Latency, - count() as count, - count(if(error = 0, 1, NULL)) AS ok, - max(cronTimestamp) AS lastTimestamp - FROM __ttl_3d_mv__v0 - WHERE - monitorId = {{ String(monitorId, '1') }} - GROUP BY region - - diff --git a/packages/tinybird/pipes/__ttl_45d.pipe b/packages/tinybird/pipes/__ttl_45d.pipe deleted file mode 100644 index f7287ee2..00000000 --- a/packages/tinybird/pipes/__ttl_45d.pipe +++ /dev/null @@ -1,20 +0,0 @@ -VERSION 1 - -NODE __ttl_45d_0 -SQL > - - SELECT - toStartOfDay(fromUnixTimestamp64Milli(cronTimestamp)) AS time, - latency, - monitorId, - region, - statusCode, - url, - workspaceId, - cronTimestamp - FROM ping_response__v8 - -TYPE materialized -DATASOURCE __ttl_45d_mv__v1 - - diff --git a/packages/tinybird/pipes/__ttl_45d_all.pipe b/packages/tinybird/pipes/__ttl_45d_all.pipe deleted file mode 100644 index 3956a0fa..00000000 --- a/packages/tinybird/pipes/__ttl_45d_all.pipe +++ /dev/null @@ -1,11 +0,0 @@ -VERSION 1 - -NODE __ttl_45d_all_0 -SQL > - - SELECT toDateTime(fromUnixTimestamp64Milli(cronTimestamp)) AS time, * FROM ping_response__v8 - -TYPE materialized -DATASOURCE __ttl_45d_all_mv__v1 - - diff --git a/packages/tinybird/pipes/__ttl_45d_all_details_get.pipe b/packages/tinybird/pipes/__ttl_45d_all_details_get.pipe deleted file mode 100644 index 825b1399..00000000 --- a/packages/tinybird/pipes/__ttl_45d_all_details_get.pipe +++ /dev/null @@ -1,14 +0,0 @@ -VERSION 1 - -NODE __ttl_45d_all_details_get_0 -SQL > - - % - SELECT * - from __ttl_45d_all_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - AND cronTimestamp = {{ Int64(cronTimestamp, 1709477432205) }} - AND region = {{ String(region, 'ams') }} - - diff --git a/packages/tinybird/pipes/__ttl_45d_count_utc.pipe b/packages/tinybird/pipes/__ttl_45d_count_utc.pipe deleted file mode 100644 index e3796dcf..00000000 --- a/packages/tinybird/pipes/__ttl_45d_count_utc.pipe +++ /dev/null @@ -1,23 +0,0 @@ -VERSION 1 - -DESCRIPTION > - TODO: descripe what it is for! - - -NODE __ttl_45d_count_utc_0 -SQL > - - SELECT - toStartOfDay(toTimeZone(time, 'UTC')) AS time, - monitorId, - countState() AS count, - countState(if(error = 0, 1, NULL)) AS ok - FROM __ttl_45d_mv__v1 - GROUP BY - time, - monitorId - -TYPE materialized -DATASOURCE __ttl_45d_count_utc_mv__v1 - - diff --git a/packages/tinybird/pipes/__ttl_45d_count_utc_get.pipe b/packages/tinybird/pipes/__ttl_45d_count_utc_get.pipe index c21f323e..8270880f 100644 --- a/packages/tinybird/pipes/__ttl_45d_count_utc_get.pipe +++ b/packages/tinybird/pipes/__ttl_45d_count_utc_get.pipe @@ -1,11 +1,12 @@ VERSION 1 +TOKEN "__ttl_45d_count_utc_get__v1_endpoint_read_7956" READ NODE __ttl_45d_count_utc_get_0 SQL > % SELECT time as day, countMerge(count) as count, countMerge(ok) as ok - FROM __ttl_45d_count_utc_mv__v1 + FROM mv__http_status_45d WHERE monitorId = {{ String(monitorId, '4') }} GROUP BY day @@ -14,7 +15,7 @@ SQL > FROM toStartOfDay(toStartOfDay(toTimeZone(now(), 'UTC'))) TO toStartOfDay( - date_sub(DAY, 7, now()) + date_sub(DAY, 45, now()) ) STEP INTERVAL -1 DAY diff --git a/packages/tinybird/pipes/__ttl_45d_statuspage_get.pipe b/packages/tinybird/pipes/__ttl_45d_statuspage_get.pipe deleted file mode 100644 index 079283d9..00000000 --- a/packages/tinybird/pipes/__ttl_45d_statuspage_get.pipe +++ /dev/null @@ -1,38 +0,0 @@ -VERSION 1 -TOKEN "__ttl_45d_statuspage_get_endpoint_read_1959" READ - -NODE __ttl_45d_statuspage_get_0 -SQL > - - % - SELECT - toDateTime(cronTimestamp / 1000, 'UTC') AS day, - -- only for debugging purposes - toTimezone(day, {{ String(timezone, 'Europe/London') }}) as with_timezone, - toStartOfDay(with_timezone) as start_of_day, - statusCode - -- latency - FROM __ttl_45d_mv - WHERE monitorId = {{ String(monitorId, '4') }} - - - -NODE __ttl_7d_statuspage_get_1 -SQL > - - % - SELECT - start_of_day as day, - count() AS count, - count(multiIf((statusCode >= 200) AND (statusCode <= 299), 1, NULL)) AS ok - FROM __ttl_45d_statuspage_get_0 - GROUP BY start_of_day - ORDER BY start_of_day DESC - WITH FILL - FROM - toStartOfDay(toTimezone(now(), {{ String(timezone, 'Europe/London') }})) - TO toStartOfDay( - toTimezone(date_sub(DAY, 46, now()), {{ String(timezone, 'Europe/London') }}) - ) STEP INTERVAL -1 DAY - - diff --git a/packages/tinybird/pipes/__ttl_7d.pipe b/packages/tinybird/pipes/__ttl_7d.pipe deleted file mode 100644 index 953600f6..00000000 --- a/packages/tinybird/pipes/__ttl_7d.pipe +++ /dev/null @@ -1,22 +0,0 @@ -VERSION 1 - -NODE __ttl_7d_0 -SQL > - - SELECT - toDateTime(fromUnixTimestamp64Milli(cronTimestamp)) AS time, - latency, - monitorId, - error - region, - statusCode, - url, - workspaceId, - cronTimestamp, - timestamp - FROM ping_response__v8 - -TYPE materialized -DATASOURCE __ttl_7d_mv__v1 - - diff --git a/packages/tinybird/pipes/__ttl_7d_all.pipe b/packages/tinybird/pipes/__ttl_7d_all.pipe deleted file mode 100644 index 387f5981..00000000 --- a/packages/tinybird/pipes/__ttl_7d_all.pipe +++ /dev/null @@ -1,11 +0,0 @@ -VERSION 1 - -NODE __ttl_7d_all_0 -SQL > - - SELECT toDateTime(fromUnixTimestamp64Milli(cronTimestamp)) AS time, * FROM ping_response__v8 - -TYPE materialized -DATASOURCE __ttl_7d_all_mv__v1 - - diff --git a/packages/tinybird/pipes/__ttl_7d_all_details_get.pipe b/packages/tinybird/pipes/__ttl_7d_all_details_get.pipe deleted file mode 100644 index 4333819d..00000000 --- a/packages/tinybird/pipes/__ttl_7d_all_details_get.pipe +++ /dev/null @@ -1,14 +0,0 @@ -VERSION 1 - -NODE __ttl_7d_all_details_get_0 -SQL > - - % - SELECT * - from __ttl_7d_all_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - AND cronTimestamp = {{ Int64(cronTimestamp, 1709477432205) }} - AND region = {{ String(region, 'ams') }} - - diff --git a/packages/tinybird/pipes/__ttl_7d_chart_all_regions_get.pipe b/packages/tinybird/pipes/__ttl_7d_chart_all_regions_get.pipe deleted file mode 100644 index 86ab46c4..00000000 --- a/packages/tinybird/pipes/__ttl_7d_chart_all_regions_get.pipe +++ /dev/null @@ -1,23 +0,0 @@ -VERSION 1 -TOKEN "__ttl_7d_chart_all_regions_get__v1_endpoint_read_8648" READ - -NODE __ttl_7d_chart_all_regions_get_0 -SQL > - - % - SELECT - toStartOfInterval( - toDateTime(cronTimestamp / 1000), INTERVAL 1 HOUR - ) as h, - toUnixTimestamp64Milli(toDateTime64(h, 3)) as timestamp, - round(quantile(0.5)(latency)) as p50Latency, - round(quantile(0.75)(latency)) as p75Latency, - round(quantile(0.9)(latency)) as p90Latency, - round(quantile(0.95)(latency)) as p95Latency, - round(quantile(0.99)(latency)) as p99Latency - FROM __ttl_7d_mv - WHERE monitorId = {{ String(monitorId, '1') }} - GROUP BY h - ORDER BY h DESC - - diff --git a/packages/tinybird/pipes/__ttl_7d_chart_get.pipe b/packages/tinybird/pipes/__ttl_7d_chart_get.pipe deleted file mode 100644 index f0483396..00000000 --- a/packages/tinybird/pipes/__ttl_7d_chart_get.pipe +++ /dev/null @@ -1,25 +0,0 @@ -VERSION 1 - -NODE __ttl_7d_chart_get_0 -SQL > - - % - SELECT - region, - toStartOfInterval( - toDateTime(cronTimestamp / 1000), - INTERVAL {{ Int64(interval, 30) }} MINUTE - ) as h, - toUnixTimestamp64Milli(toDateTime64(h, 3)) as timestamp, - round(quantile(0.5)(latency)) as p50Latency, - round(quantile(0.75)(latency)) as p75Latency, - round(quantile(0.9)(latency)) as p90Latency, - round(quantile(0.95)(latency)) as p95Latency, - round(quantile(0.99)(latency)) as p99Latency - FROM __ttl_7d_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - GROUP BY h, region - ORDER BY h DESC - - diff --git a/packages/tinybird/pipes/__ttl_7d_count.pipe b/packages/tinybird/pipes/__ttl_7d_count.pipe deleted file mode 100644 index 8c13b825..00000000 --- a/packages/tinybird/pipes/__ttl_7d_count.pipe +++ /dev/null @@ -1,24 +0,0 @@ -VERSION 1 -DESCRIPTION > - TODO: descripe what it is for! - - -NODE __ttl_7d_count_0 -SQL > - - SELECT - time, - monitorId, - url, - countState() AS count, - countState(if(error = 0, 1, NULL)) AS ok - FROM __ttl_45d_mv - GROUP BY - time, - monitorId, - url - -TYPE materialized -DATASOURCE __ttl_7d_count_mv - - diff --git a/packages/tinybird/pipes/__ttl_7d_count_get.pipe b/packages/tinybird/pipes/__ttl_7d_count_get.pipe deleted file mode 100644 index 2dbd4bc1..00000000 --- a/packages/tinybird/pipes/__ttl_7d_count_get.pipe +++ /dev/null @@ -1,22 +0,0 @@ -VERSION 1 -TOKEN "__ttl_7d_count_get__v1_endpoint_read_7412" READ - -NODE __ttl_7d_count_get_0 -SQL > - - % - SELECT time as day, countMerge(count) as count, countMerge(ok) as ok - FROM __ttl_7d_count_mv_test - WHERE - monitorId = {{ String(monitorId, '4') }} - {% if defined(url) %} AND url = {{ String(url) }} {% end %} - GROUP BY day - ORDER BY day DESC - WITH FILL - FROM - toStartOfDay(now()) - TO toStartOfDay( - date_sub(DAY, 7, now()) - ) STEP INTERVAL -1 DAY - - diff --git a/packages/tinybird/pipes/__ttl_7d_count_utc.pipe b/packages/tinybird/pipes/__ttl_7d_count_utc.pipe deleted file mode 100644 index d5958cfa..00000000 --- a/packages/tinybird/pipes/__ttl_7d_count_utc.pipe +++ /dev/null @@ -1,23 +0,0 @@ -VERSION 1 - -DESCRIPTION > - TODO: descripe what it is for! - - -NODE __ttl_7d_count_utc_0 -SQL > - - SELECT - toStartOfDay(toTimeZone(time, 'UTC')) AS time, - monitorId, - countState() AS count, - countState(if(error = 0, 1, NULL)) AS ok - FROM __ttl_7d_mv__v1 - GROUP BY - time, - monitorId - -TYPE materialized -DATASOURCE __ttl_7d_count_utc_mv__v1 - - diff --git a/packages/tinybird/pipes/__ttl_7d_count_utc_get.pipe b/packages/tinybird/pipes/__ttl_7d_count_utc_get.pipe deleted file mode 100644 index 8b6ae340..00000000 --- a/packages/tinybird/pipes/__ttl_7d_count_utc_get.pipe +++ /dev/null @@ -1,20 +0,0 @@ -VERSION 1 - -NODE __ttl_7d_count_utc_get_0 -SQL > - - % - SELECT time as day, countMerge(count) as count, countMerge(ok) as ok - FROM __ttl_7d_count_utc_mv__v1 - WHERE - monitorId = {{ String(monitorId, '4') }} - GROUP BY day - ORDER BY day DESC - WITH FILL - FROM - toStartOfDay(toStartOfDay(toTimeZone(now(), 'UTC'))) - TO toStartOfDay( - date_sub(DAY, 7, now()) - ) STEP INTERVAL -1 DAY - - diff --git a/packages/tinybird/pipes/__ttl_7d_list_get.pipe b/packages/tinybird/pipes/__ttl_7d_list_get.pipe deleted file mode 100644 index 87225dfe..00000000 --- a/packages/tinybird/pipes/__ttl_7d_list_get.pipe +++ /dev/null @@ -1,14 +0,0 @@ -VERSION 1 - -NODE __ttl_7d_list_get__v1_0 -SQL > - - % - SELECT latency, monitorId, error, region, statusCode, url, workspaceId, cronTimestamp, timestamp - FROM __ttl_7d_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - {% if defined(url) %} AND url = {{ String(url) }} {% end %} - ORDER BY cronTimestamp DESC - - diff --git a/packages/tinybird/pipes/__ttl_7d_metrics_get.pipe b/packages/tinybird/pipes/__ttl_7d_metrics_get.pipe deleted file mode 100644 index 343bfa88..00000000 --- a/packages/tinybird/pipes/__ttl_7d_metrics_get.pipe +++ /dev/null @@ -1,36 +0,0 @@ -VERSION 1 - -NODE __ttl_7d_metrics_get_0 -SQL > - - % - SELECT - round(quantile(0.5)(latency)) as p50Latency, - round(quantile(0.75)(latency)) as p75Latency, - round(quantile(0.9)(latency)) as p90Latency, - round(quantile(0.95)(latency)) as p95Latency, - round(quantile(0.99)(latency)) as p99Latency, - count() as count, - count(if(error = 0, 1, NULL)) AS ok, - max(cronTimestamp) AS lastTimestamp - FROM __ttl_7d_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - AND time >= toDateTime64(now() - INTERVAL 7 DAY, 3) - UNION ALL - SELECT - round(quantile(0.5)(latency)) AS p50Latency, - round(quantile(0.75)(latency)) AS p75Latency, - round(quantile(0.9)(latency)) AS p90Latency, - round(quantile(0.95)(latency)) AS p95Latency, - round(quantile(0.99)(latency)) AS p99Latency, - count() as count, - count(if(error = 0, 1, NULL)) AS ok, - NULL as lastTimestamp -- no need to query the `lastTimestamp` as not relevant - FROM __ttl_14d_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - AND time >= toDateTime64(now() - INTERVAL 14 DAY, 3) - AND time < toDateTime64(now() - INTERVAL 7 DAY, 3) - - diff --git a/packages/tinybird/pipes/__ttl_7d_metrics_get_by_region.pipe b/packages/tinybird/pipes/__ttl_7d_metrics_get_by_region.pipe deleted file mode 100644 index a06a7342..00000000 --- a/packages/tinybird/pipes/__ttl_7d_metrics_get_by_region.pipe +++ /dev/null @@ -1,22 +0,0 @@ -VERSION 1 - -NODE __ttl_7d_metrics_get_by_region_0 -SQL > - - % - SELECT - region, - round(quantile(0.5)(latency)) as p50Latency, - round(quantile(0.75)(latency)) as p75Latency, - round(quantile(0.9)(latency)) as p90Latency, - round(quantile(0.95)(latency)) as p95Latency, - round(quantile(0.99)(latency)) as p99Latency, - count() as count, - count(if(error = 0, 1, NULL)) AS ok, - max(cronTimestamp) AS lastTimestamp - FROM __ttl_7d_mv__v1 - WHERE - monitorId = {{ String(monitorId, '1') }} - GROUP BY region - - diff --git a/packages/tinybird/pipes/__ttl_7d_statuspage_get.pipe b/packages/tinybird/pipes/__ttl_7d_statuspage_get.pipe deleted file mode 100644 index 397c58d4..00000000 --- a/packages/tinybird/pipes/__ttl_7d_statuspage_get.pipe +++ /dev/null @@ -1,38 +0,0 @@ -VERSION 1 -TOKEN "__ttl_7d_statuspage_get_endpoint_read_0234" READ - -NODE __ttl_7d_statuspage_get_0 -SQL > - - % - SELECT - toDateTime(cronTimestamp / 1000, 'UTC') AS day, - -- only for debugging purposes - toTimezone(day, {{ String(timezone, 'Europe/London') }}) as with_timezone, - toStartOfDay(with_timezone) as start_of_day, - statusCode - -- latency - FROM __ttl_7d_mv - WHERE monitorId = {{ String(monitorId, '4') }} - - - -NODE __ttl_7d_statuspage_get_1 -SQL > - - % - SELECT - start_of_day as day, - count() AS count, - count(multiIf((statusCode >= 200) AND (statusCode <= 299), 1, NULL)) AS ok - FROM __ttl_7d_statuspage_get_0 - GROUP BY start_of_day - ORDER BY start_of_day DESC - WITH FILL - FROM - toStartOfDay(toTimezone(now(), {{ String(timezone, 'Europe/London') }})) - TO toStartOfDay( - toTimezone(date_sub(DAY, 46, now()), {{ String(timezone, 'Europe/London') }}) - ) STEP INTERVAL -1 DAY - - diff --git a/packages/tinybird/pipes/get_result_for_on_demand_check_http.pipe b/packages/tinybird/pipes/get_result_for_on_demand_check_http.pipe index 1fa29f76..5f597112 100644 --- a/packages/tinybird/pipes/get_result_for_on_demand_check_http.pipe +++ b/packages/tinybird/pipes/get_result_for_on_demand_check_http.pipe @@ -1,6 +1,6 @@ VERSION 0 -NODE get_result_for_on_demand_check_http_0 +NODE endpoint SQL > % @@ -13,11 +13,13 @@ SQL > timestamp, url, workspaceId, - timing - FROM __ttl_45d_all_mv__v1 + timing, + cronTimestamp + FROM mv__http_full_30d where - cronTimestamp = {{ String(cronTimestamp, '1') }} - and monitorId = {{ String(monitorId, '1') }} - and url = {{ String(url , 'https://www.openstatus.dev') }} + cronTimestamp = {{ String(timestamp, '1729871694536') }} and + monitorId = {{ String(monitorId, '2260') }} + and url = {{ String(url , 'https://www.openstatus.dev/api/ping/edge') }} + order by cronTimestamp desc diff --git a/packages/tinybird/pipes/single_checks_get.pipe b/packages/tinybird/pipes/single_checks_get.pipe new file mode 100644 index 00000000..913e2688 --- /dev/null +++ b/packages/tinybird/pipes/single_checks_get.pipe @@ -0,0 +1,16 @@ +VERSION 1 + +NODE endpoint +SQL > + + % + SELECT * + from check_response_http + WHERE + workspaceId = {{ Int16(workspaceId, 1) }} + {% if defined(requestId) %} AND requestId = {{ Int16(requestId) }} {% end %} + ORDER BY timestamp DESC + LIMIT {{ Int32(pageSize, 10) }} + OFFSET {{ Int32(page, 0) * Int32(pageSize, 10) }} + + diff --git a/packages/tinybird/src/client.ts b/packages/tinybird/src/client.ts index b6a41e7c..6ce30f9d 100644 --- a/packages/tinybird/src/client.ts +++ b/packages/tinybird/src/client.ts @@ -7,11 +7,11 @@ export class OSTinybird { private readonly tb: Client; constructor(token: string) { - // if (process.env.NODE_ENV === "development") { - // this.tb = new NoopTinybird(); - // } else { - this.tb = new Client({ token }); - // } + if (process.env.NODE_ENV === "development") { + this.tb = new NoopTinybird(); + } else { + this.tb = new Client({ token }); + } } public get homeStats() { -- 2.51.2