Add Serialization & Deserialization of Sink File Properties with CLI Commands #2749
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements file sink telemetry configuration for Data API Builder, enabling users to send logs to a file sink through CLI commands and JSON configuration.
Changes Made
CLI Commands Added
The following new CLI configure options are now available:
--runtime.telemetry.file.enabled
- Enable/disable file sink telemetry (default: false)--runtime.telemetry.file.path
- File path for telemetry logs (default: "/logs/dab-log.txt")--runtime.telemetry.file.rolling-interval
- Rolling interval: hour, day, week (default: day)--runtime.telemetry.file.retained-file-count-limit
- Number of retained files (default: 1, minimum: 1)--runtime.telemetry.file.file-size-limit-bytes
- Max file size in bytes (default: 1048576, minimum: 1)Usage Examples
JSON Configuration Schema
The configuration now supports the following structure under
runtime.telemetry
:Implementation Details
Object Model Changes:
FileOptions
record with proper JSON serializationRollingInterval
enum supporting hour/day/week intervalsTelemetryOptions
to include file sink configurationJSON Schema Updates:
Configuration & Validation:
dab configure
command infrastructureTesting:
Validation
All tests pass and the implementation follows existing patterns in the codebase for telemetry providers (similar to ApplicationInsights and OpenTelemetry implementations).
Fixes #2576.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.