You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding 'Configure' options to CLI for File Sink (#2818)
## Why make this change?
- Fixes issue #2577
- We want to allow the file sink properties to be configurable through
the CLI command `dab configure`.
## What is this change?
This change adds the file sink properties to the configure command and
allows the user to change those properties through the CLI. It also
ensures that the path property exists if file sink is enabled.
- `ConfigOptions.cs`: Adds file sink properties to CLI command so that
they can be configured by the user.
- `ConfigGenerator.cs`: Writes the file sink properties to the config
file, and errors out if the user tries to add an invalid value.
- `RuntimeConfigValidator.cs`: Validates that
`runtime.telemetry.file.path` is not empty or null if the file sink is
enabled.
## How was this tested?
- [ ] Integration Tests
- [X] Unit Tests
Added tests that ensure the configure commands and validation work.
Also refactored the validation tests that followed the same pattern.
## Sample Request(s)
--runtime.telemetry.file.enabled
--runtime.telemetry.file.path
--runtime.telemetry.file.rolling-interval
--runtime.telemetry.file.retained-file-count-limit
--runtime.telemetry.file.file-size-limit-bytes
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
[Option("runtime.telemetry.azure-log-analytics.auth.dce-endpoint",Required=false,HelpText="Configure DCE Endpoint for Azure Log Analytics to find table to send telemetry data")]
runtimeConfig=runtimeConfig!with{Runtime=runtimeConfig.Runtime!with{Telemetry=runtimeConfig.Runtime!.Telemetryis not null?runtimeConfig.Runtime!.Telemetrywith{File=updatedFileSinkOptions}:newTelemetryOptions(File:updatedFileSinkOptions)}};
_logger.LogInformation($"Updated configuration with runtime.telemetry.file.rolling-interval as '{options.FileSinkRollingInterval}'");
1253
+
}
1254
+
1255
+
// Runtime.Telemetry.File.RetainedFileCountLimit
1256
+
if(options.FileSinkRetainedFileCountLimitis not null)
1257
+
{
1258
+
if(options.FileSinkRetainedFileCountLimit<=0)
1259
+
{
1260
+
_logger.LogError("Failed to update configuration with runtime.telemetry.file.retained-file-count-limit. Value must be a positive integer greater than 0.");
_logger.LogInformation($"Updated configuration with runtime.telemetry.file.retained-file-count-limit as '{options.FileSinkRetainedFileCountLimit}'");
1266
+
}
1267
+
1268
+
// Runtime.Telemetry.File.FileSizeLimitBytes
1269
+
if(options.FileSinkFileSizeLimitBytesis not null)
1270
+
{
1271
+
if(options.FileSinkFileSizeLimitBytes<=0)
1272
+
{
1273
+
_logger.LogError("Failed to update configuration with runtime.telemetry.file.file-size-limit-bytes. Value must be a positive integer greater than 0.");
0 commit comments