From 592bb7f9a6c4b916ebf2176b7f1d1393495127d1 Mon Sep 17 00:00:00 2001 From: Edmund Noble Date: Sat, 25 May 2024 12:11:06 -0400 Subject: [PATCH] log: disable telemetry backend by default Just to be clear for any readers: "telemetry" is structured logging for node operators to use to monitor their nodes. It is not sent to Kadena. By default, it is sent to stdout, and it can be configured to be sent to an Elasticsearch instance of the user's choosing. This commit disables even logging telemetry to the terminal by default, because usually it's very verbose and not useful. Change-Id: I83ed57c79fa99151909c76d7de70f6edc88106f8 --- changes/2024-05-30T145746-0400.txt | 1 + src/Chainweb/Logging/Config.hs | 3 +-- src/Chainweb/Utils.hs | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 changes/2024-05-30T145746-0400.txt diff --git a/changes/2024-05-30T145746-0400.txt b/changes/2024-05-30T145746-0400.txt new file mode 100644 index 0000000000..498a9e7a82 --- /dev/null +++ b/changes/2024-05-30T145746-0400.txt @@ -0,0 +1 @@ +Disable telemetry backend by default for less verbosity diff --git a/src/Chainweb/Logging/Config.hs b/src/Chainweb/Logging/Config.hs index f859c52091..52273f9c52 100644 --- a/src/Chainweb/Logging/Config.hs +++ b/src/Chainweb/Logging/Config.hs @@ -91,7 +91,7 @@ defaultLogConfig :: LogConfig defaultLogConfig = LogConfig { _logConfigLogger = defaultLoggerConfig , _logConfigBackend = defaultBackendConfig - , _logConfigTelemetryBackend = defaultEnableConfig defaultBackendConfig + , _logConfigTelemetryBackend = defaultDisableConfig defaultBackendConfig , _logConfigClusterId = Nothing , _logConfigFilter = mempty } @@ -183,4 +183,3 @@ pFilter_ prefix = id then return $ LogFilter [] l (Probability r) else Left "failed to read log rule rate. The value must be between zero and one" _ -> Left $ "expecting LOGLEVEL[:RATE], but got " <> s - diff --git a/src/Chainweb/Utils.hs b/src/Chainweb/Utils.hs index ab5effa190..4b2cf78d7a 100644 --- a/src/Chainweb/Utils.hs +++ b/src/Chainweb/Utils.hs @@ -154,6 +154,7 @@ module Chainweb.Utils , enableConfigConfig , enableConfigEnabled , defaultEnableConfig +, defaultDisableConfig , pEnableConfig , enabledConfig , validateEnableConfig @@ -986,6 +987,14 @@ defaultEnableConfig a = EnableConfig , _enableConfigConfig = a } +-- | The default is that the configured component is disabled. +-- +defaultDisableConfig :: a -> EnableConfig a +defaultDisableConfig a = EnableConfig + { _enableConfigEnabled = False + , _enableConfigConfig = a + } + enableConfigProperties :: ToJSON a => KeyValue e kv => EnableConfig a -> [kv] enableConfigProperties o = [ "enabled" .= _enableConfigEnabled o