From 6d0fdac9d4bceba5a4b71c7b6977cf8da34111ad Mon Sep 17 00:00:00 2001 From: MasterPtato Date: Wed, 29 May 2024 20:04:51 +0000 Subject: [PATCH] fix: revert #800, add http vector filter --- docs/libraries/bolt/1PASSWORD_INTEGRATION.md | 2 +- infra/tf/vector/vector.tf | 15 ++++++++++++--- svc/pkg/cf/db/log/Service.toml | 7 ------- .../log/migrations/20240517214700_init.down.sql | 0 .../db/log/migrations/20240517214700_init.up.sql | 15 --------------- 5 files changed, 13 insertions(+), 26 deletions(-) delete mode 100644 svc/pkg/cf/db/log/Service.toml delete mode 100644 svc/pkg/cf/db/log/migrations/20240517214700_init.down.sql delete mode 100644 svc/pkg/cf/db/log/migrations/20240517214700_init.up.sql diff --git a/docs/libraries/bolt/1PASSWORD_INTEGRATION.md b/docs/libraries/bolt/1PASSWORD_INTEGRATION.md index 6ab334cbf..4cc930721 100644 --- a/docs/libraries/bolt/1PASSWORD_INTEGRATION.md +++ b/docs/libraries/bolt/1PASSWORD_INTEGRATION.md @@ -50,4 +50,4 @@ Finally, you have two options for pushing your local config to 1password: ## Pulling -To pull your config from 1password, run `bolt config pull`, or `bolt config pull ` for a specific namespace. +To pull your config from 1password run `bolt config pull`, or `bolt config pull ` for a specific namespace. diff --git a/infra/tf/vector/vector.tf b/infra/tf/vector/vector.tf index e8b635cf3..ebbc571c1 100644 --- a/infra/tf/vector/vector.tf +++ b/infra/tf/vector/vector.tf @@ -78,6 +78,15 @@ resource "helm_release" "vector" { source = ".source == \"job_run\"" } } + + opengb_worker = { + type = "filter" + inputs = ["http_json"] + condition = { + type = "vrl" + source = ".path == \"/opengb\"" + } + } } sinks = { prom_exporter = { @@ -108,13 +117,13 @@ resource "helm_release" "vector" { } } - clickhouse_cf_logs = { + clickhouse_opengb_logs = { type = "clickhouse" - inputs = ["http_json"] + inputs = ["opengb_worker"] compression = "gzip" database = "db_cf_log" endpoint = "https://${var.clickhouse_host}:${var.clickhouse_port_https}" - table = "cf_tail_events" + table = "tail_events" auth = { strategy = "basic" user = "vector" diff --git a/svc/pkg/cf/db/log/Service.toml b/svc/pkg/cf/db/log/Service.toml deleted file mode 100644 index e5746039e..000000000 --- a/svc/pkg/cf/db/log/Service.toml +++ /dev/null @@ -1,7 +0,0 @@ -[service] -name = "db-cf-log" - -[runtime] -kind = "clickhouse" - -[database] diff --git a/svc/pkg/cf/db/log/migrations/20240517214700_init.down.sql b/svc/pkg/cf/db/log/migrations/20240517214700_init.down.sql deleted file mode 100644 index e69de29bb..000000000 diff --git a/svc/pkg/cf/db/log/migrations/20240517214700_init.up.sql b/svc/pkg/cf/db/log/migrations/20240517214700_init.up.sql deleted file mode 100644 index b2ce19632..000000000 --- a/svc/pkg/cf/db/log/migrations/20240517214700_init.up.sql +++ /dev/null @@ -1,15 +0,0 @@ -SET allow_experimental_object_type = 1; - -CREATE TABLE IF NOT EXISTS cf_tail_events -( - script_name String, - ts DateTime64(3), -- This is tail_event.eventTimestamp, DateTime64(3) is milliseconds - ray_id UUID, -- Extracted by tail worker - tail_event JSON, -- TODO: might need to do the trickery used in analytics event - INDEX idx_ray_id (ray_id) TYPE bloom_filter() GRANULARITY 4 -) -ENGINE = ReplicatedMergeTree() -PARTITION BY toStartOfHour(ts) -ORDER BY (script_name, ts, ray_id) -TTL toDate(ts + toIntervalDay(3)) -SETTINGS index_granularity = 8192, ttl_only_drop_parts = 1;