-
Notifications
You must be signed in to change notification settings - Fork 726
The ability to specify UA config inside AuditConfig #28539
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
base: main
Are you sure you want to change the base?
Conversation
|
⚪
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
⚪ ⚪ Ya make output | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
🟢 |
| optional EFormat Format = 1 [default = JSON]; | ||
| optional string LogName = 2; | ||
| optional string LogJsonEnvelope = 3; // Json template with text field containing %message% placeholder. For example {"my_enveloped_message": "%message%"}. %message% will be replaced with real audit log message | ||
| optional TUAClientConfig UAClientConfig = 4; // If not specified, the configuration is taken from logconfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| optional TUAClientConfig UAClientConfig = 4; // If not specified, the configuration is taken from logconfig | |
| optional TUAClientConfig UAClientConfig = 4; // If not specified, the configuration is taken from common TLogConfig section |
| auto clusterName = appConfig.HasLogConfig() && appConfig.GetLogConfig().HasClusterName() ? appConfig.GetLogConfig().GetClusterName() : ""; | ||
| const auto& dnConfig = appConfig.GetDynamicNameserviceConfig(); | ||
| auto uaCounters = GetServiceCounters(counters, "utils")->GetSubgroup("subsystem", "ua_client"); | ||
| auto logName = runConfig.AppConfig.GetAuditConfig().GetUnifiedAgentBackend().HasLogName() | ||
| ? runConfig.AppConfig.GetAuditConfig().GetUnifiedAgentBackend().GetLogName() | ||
| : uaClientConfig.GetLogName(); | ||
| auto logName = uaBackend.HasLogName() ? uaBackend.GetLogName() : uaClientConfig.GetLogName(); | ||
| auto maxStaticNodeId = dnConfig.GetMaxStaticNodeId(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these variables, except logName, could be moved outside the lambda since they don't depend on the lambda's argument.
| if (uaBackend.HasUAClientConfig()) { | ||
| logBackend = createUaLogBackend(uaBackend.GetUAClientConfig()); | ||
| } else if (appConfig.HasLogConfig() && appConfig.GetLogConfig().HasUAClientConfig()) { | ||
| logBackend = createUaLogBackend(appConfig.GetLogConfig().GetUAClientConfig()); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I would suggest moving UAClientConfig selection to a lambda and leave actual log backend creation code on a main path:
- try to select config
- drop out if there is none
- create log backend from the config found at 1)
Changelog entry
Previously, it was not possible to specify the unified agent configuration for the audit configuration. Instead, the configuration audit used the Unified Agent settings that were specified in the LogConfig section.
This was required in order to be able to separate the flows of audit and regular logging, including at the Unified Agent configuration level.
Changelog category