Openstatus www.openstatus.dev

🔥 tb pipe (#1039)

authored by

Thibault Le Ouay and committed by
GitHub
5b798e15 dbf89564

+266 -6
+1 -1
apps/web/src/components/content/callout.tsx
··· 45 45 const Icon = Icons[getIconName(variant)]; 46 46 return ( 47 47 <div className={cn(calloutVariants({ variant, className }))} {...props}> 48 - <Icon className="h-4 w-4 mr-2 my-1.5 shrink-0" /> 48 + <Icon className="my-1.5 mr-2 h-4 w-4 shrink-0" /> 49 49 <p>{children}</p> 50 50 </div> 51 51 );
-1
apps/web/src/components/forms/monitor/section-scheduling.tsx
··· 92 92 <FormField 93 93 control={form.control} 94 94 name="regions" 95 - // biome-ignore lint/correctness/noUnusedVariables: <explanation> 96 95 render={({ field }) => { 97 96 return ( 98 97 <FormItem>
+1 -1
apps/web/src/components/forms/shared/checkbox-label.tsx
··· 36 36 <Label 37 37 htmlFor={`${name}-${id}`} 38 38 className={cn( 39 - "flex h-full items-center gap-1 rounded-md border border-border bg-popover p-4 pr-10 hover:bg-accent hover:text-accent-foreground peer-data-[state=checked]:border-primary [&:has([data-state=checked])]:border-primary peer-disabled:hover:bg-background peer-disabled:text-muted-foreground", 39 + "flex h-full items-center gap-1 rounded-md border border-border bg-popover p-4 pr-10 hover:bg-accent hover:text-accent-foreground peer-disabled:text-muted-foreground peer-disabled:hover:bg-background peer-data-[state=checked]:border-primary [&:has([data-state=checked])]:border-primary", 40 40 className, 41 41 )} 42 42 >
+1 -1
apps/web/src/components/layout/header/app-tabs.tsx
··· 53 53 if (!open) return null; 54 54 55 55 return ( 56 - <div className="absolute right-1 top-1"> 56 + <div className="absolute top-1 right-1"> 57 57 <StatusDot status="error" active /> 58 58 </div> 59 59 );
-2
packages/react/src/widget.tsx
··· 45 45 <span className="relative flex h-2 w-2"> 46 46 {status === "operational" ? ( 47 47 <span 48 - // biome-ignore lint/nursery/useSortedClasses: color is a dynamic value 49 48 className={`absolute inline-flex h-full w-full animate-ping rounded-full ${color} opacity-75 duration-1000`} 50 49 /> 51 50 ) : null} 52 51 <span 53 - // biome-ignore lint/nursery/useSortedClasses: color is a dynamic value 54 52 className={`relative inline-flex h-2 w-2 rounded-full ${color}`} 55 53 /> 56 54 </span>
+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)"
+12
packages/tinybird/datasources/external_status.datasource
··· 1 + 2 + SCHEMA > 3 + `description` String `json:$.description`, 4 + `fetched_at` Int64 `json:$.fetched_at`, 5 + `indicator` String `json:$.indicator`, 6 + `name` String `json:$.name`, 7 + `time_zone` String `json:$.time_zone`, 8 + `updated_at` Int64 `json:$.updated_at`, 9 + `url` String `json:$.url` 10 + 11 + ENGINE "MergeTree" 12 + ENGINE_SORTING_KEY "description, time_zone, updated_at, url"
+15
packages/tinybird/datasources/tcp_response.datasource
··· 1 + VERSION 0 2 + 3 + SCHEMA > 4 + `monitorId` Int32 `json:$.monitorId`, 5 + `region` String `json:$.region`, 6 + `timestamp` Int64 `json:$.timestamp`, 7 + `timing` String `json:$.timing`, 8 + `workspaceId` Int32 `json:$.workspaceId`, 9 + `latency` Int64 `json:$.latency`, 10 + `errorMessage` Nullable(String) `json:$.errorMessage`, 11 + `error` Int16 `json:$.error` 12 + 13 + ENGINE "MergeTree" 14 + ENGINE_PARTITION_KEY "toYYYYMM(fromUnixTimestamp64Milli(timestamp))" 15 + ENGINE_SORTING_KEY "monitorId, workspaceId"
+25
packages/tinybird/datasources/web_vitals.datasource
··· 1 + VERSION 0 2 + 3 + SCHEMA > 4 + `browser` String `json:$.browser`, 5 + `city` String `json:$.city`, 6 + `continent` String `json:$.continent`, 7 + `country` String `json:$.country`, 8 + `device` String `json:$.device`, 9 + `dsn` String `json:$.dsn`, 10 + `href` String `json:$.href`, 11 + `id` String `json:$.id`, 12 + `name` String `json:$.name`, 13 + `os` String `json:$.os`, 14 + `path` String `json:$.path`, 15 + `rating` String `json:$.rating`, 16 + `region_code` String `json:$.region_code`, 17 + `screen` String `json:$.screen`, 18 + `session_id` String `json:$.session_id`, 19 + `speed` String `json:$.speed`, 20 + `timezone` String `json:$.timezone`, 21 + `value` Float32 `json:$.value`, 22 + `timestamp` Nullable(DateTime) `json:$.timestamp` 23 + 24 + ENGINE "MergeTree" 25 + ENGINE_SORTING_KEY "session_id, speed, timezone"
+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 +
+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 +
+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 +
+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 +
+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 +
+17
packages/tinybird/pipes/dashboard_request.pipe
··· 1 + VERSION 0 2 + NODE dashboard_request_0 3 + SQL > 4 + 5 + % 6 + SELECT * FROM monitor_request_count_7d_mv 7 + WHERE monitorId = {{ String(monitorId, '1') }} 8 + {% if defined(url) %} AND url = {{ String(url) }} {% end %} 9 + 10 + 11 + 12 + NODE dashboard_request_1 13 + SQL > 14 + 15 + SELECT * FROM dashboard_request_0 16 + 17 +
+12
packages/tinybird/pipes/external_status.pipe
··· 1 + VERSION 0 2 + NODE external_status_0 3 + SQL > 4 + 5 + % 6 + SELECT * 7 + FROM external_status 8 + WHERE name = {{ String(name, 'OpenAI') }} 9 + ORDER BY fetched_at DESC 10 + LIMIT {{ Int16(limit, 10000) }} 11 + 12 +