Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log: disable telemetry backend by default #1947

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading