diff --git a/tinybird/datasources/vercel.datasource b/tinybird/datasources/vercel.datasource new file mode 100644 index 0000000..57de6fe --- /dev/null +++ b/tinybird/datasources/vercel.datasource @@ -0,0 +1,16 @@ +TOKEN "append" APPEND + +# Refer to https://vercel.com/docs/observability/webhooks-overview#events for the event types and payload schema + +TAGS "vercel" + +SCHEMA > + `type` LowCardinality(String) `json:$.type`, + `id` String `json:$.id`, + `date` DateTime64(3) `json:$.created_at` DEFAULT now(), + `region` LowCardinality(String) `json:$.region` DEFAULT '', + `payload` JSON `json:$.payload` DEFAULT '{}' + +ENGINE "MergeTree" +ENGINE_PARTITION_KEY "toYYYYMM(date)" +ENGINE_SORTING_KEY "type, date" \ No newline at end of file diff --git a/tinybird/datasources/vercel_logs.datasource b/tinybird/datasources/vercel_logs.datasource new file mode 100644 index 0000000..86f5785 --- /dev/null +++ b/tinybird/datasources/vercel_logs.datasource @@ -0,0 +1,31 @@ +TOKEN "append" APPEND + +# Refer to https://vercel.com/docs/observability/log-drains/log-drains-reference for the logs schema + +TAGS "vercel" + +SCHEMA > + `id` String `json:$.id`, + `message` String `json:$.message`, + `date` DateTime64(3) `json:$.timestamp` DEFAULT now(), + `type` LowCardinality(String) `json:$.type` DEFAULT '', + `request_id` Nullable(String) `json:$.requestId`, + `status_code` Nullable(UInt16) `json:$.statusCode`, + `project_id` String `json:$.projectId` DEFAULT '', + `project_name` Nullable(String) `json:$.projectName`, + `deployment_id` Nullable(String) `json:$.deploymentId`, + `source` LowCardinality(String) `json:$.source` DEFAULT '', + `host` Nullable(String) `json:$.host`, + `path` Nullable(String) `json:$.path`, + `destination` Nullable(String) `json:$.destination`, + `proxy` String `json:$.proxy` DEFAULT '', + `level` LowCardinality(String) `json:$.level` DEFAULT '', + `execution_region` Nullable(String) `json:$.executionRegion`, + `environment` Nullable(String) `json:$.environment`, + `branch` Nullable(String) `json:$.branch`, + `build_id` Nullable(String) `json:$.buildId`, + `entrypoint` Nullable(String) `json:$.entrypoint` + +ENGINE "MergeTree" +ENGINE_PARTITION_KEY "toYYYYMM(date)" +ENGINE_SORTING_KEY "project_id, date" \ No newline at end of file