From 37e36418a1390ad25450e8cac369d50cd127b902 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sat, 1 Jan 2022 16:31:05 +0000 Subject: [PATCH] bvm-logger: add custom clickhouse config Just make it less spammy into the journal, sheesh. --- ops/nixos/bvm-logger/clickhouse-config.xml | 185 +++++++++++++++++++++ ops/nixos/bvm-logger/default.nix | 8 + 2 files changed, 193 insertions(+) create mode 100644 ops/nixos/bvm-logger/clickhouse-config.xml diff --git a/ops/nixos/bvm-logger/clickhouse-config.xml b/ops/nixos/bvm-logger/clickhouse-config.xml new file mode 100644 index 0000000000..927b31f867 --- /dev/null +++ b/ops/nixos/bvm-logger/clickhouse-config.xml @@ -0,0 +1,185 @@ + + + + + critical + 1 + 1000M + 10 + + + 8123 + 9000 + 9009 + + :: + + 4096 + + 3 + + 100 + 0 + 10000 + 0.9 + 4194304 + 0 + 8589934592 + 5368709120 + 1000 + 134217728 + 10000 + /var/lib/clickhouse/ + /var/lib/clickhouse/tmp/ + /var/lib/clickhouse/user_files/ + + + + users.xml + + + + /var/lib/clickhouse/access/ + + + default + + default + true + false + 3600 + 3600 + 60 + + + + + /metrics + 0 + + true + true + true + true + + + + system + query_log
+ toYYYYMM(event_date) + event_date + INTERVAL 30 DAY DELETE + 7500 +
+ + system + text_log
+ 7500 + event_date + INTERVAL 30 DAY DELETE + trace +
+ + system + trace_log
+ + toYYYYMM(event_date) + event_date + INTERVAL 30 DAY DELETE + 7500 +
+ + system + query_thread_log
+ toYYYYMM(event_date) + event_date + INTERVAL 30 DAY DELETE + 7500 +
+ + system + metric_log
+ 7500 + 1000 +
+ + system + asynchronous_metric_log
+ 7000 +
+ + + system + crash_log
+ + + 1000 +
+ + + + + + + + *_dictionary.xml + + + /var/lib/clickhouse/format_schemas/ + + + + + hide encrypt/decrypt arguments + ((?:aes_)?(?:encrypt|decrypt)(?:_mysql)?)\s*\(\s*(?:'(?:\\'|.)+'|.*?)\s*\) + + \1(???) + + + + + + + + false + + false + + + https://6f33034cfe684dd7a3ab9875e57b1c8d@o388870.ingest.sentry.io/5226277 + +
diff --git a/ops/nixos/bvm-logger/default.nix b/ops/nixos/bvm-logger/default.nix index 5d4f9cf193..7ce449b7be 100644 --- a/ops/nixos/bvm-logger/default.nix +++ b/ops/nixos/bvm-logger/default.nix @@ -29,6 +29,14 @@ in { my.ip.tailscale = "100.68.134.82"; services.clickhouse.enable = true; + services.clickhouse.package = pkgs.symlinkJoin { + name = "clickhouse-overridden"; + paths = [ pkgs.clickhouse ]; + postBuild = '' + rm $out/etc/clickhouse-server/config.xml + cp ${./clickhouse-config.xml} $out/etc/clickhouse-server/config.xml + ''; + }; time.timeZone = "Etc/UTC"; systemd.services.journal2clickhouse = {