Skip to content

Commit

Permalink
log: disable telemetry backend by default
Browse files Browse the repository at this point in the history
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
  • Loading branch information
edmundnoble committed May 30, 2024
1 parent 5a610d7 commit 1b9bfc7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions changes/2024-05-30T145746-0400.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Disable telemetry backend by default for less verbosity
3 changes: 1 addition & 2 deletions src/Chainweb/Logging/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ defaultLogConfig :: LogConfig
defaultLogConfig = LogConfig
{ _logConfigLogger = defaultLoggerConfig
, _logConfigBackend = defaultBackendConfig
, _logConfigTelemetryBackend = defaultEnableConfig defaultBackendConfig
, _logConfigTelemetryBackend = defaultDisableConfig defaultBackendConfig
, _logConfigClusterId = Nothing
, _logConfigFilter = mempty
}
Expand Down Expand Up @@ -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

9 changes: 9 additions & 0 deletions src/Chainweb/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ module Chainweb.Utils
, enableConfigConfig
, enableConfigEnabled
, defaultEnableConfig
, defaultDisableConfig
, pEnableConfig
, enabledConfig
, validateEnableConfig
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1b9bfc7

Please sign in to comment.