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.
Requirements for Adding, Changing, or Removing a Feature
This change introduces a new feature for SLO Exporter logging output format, allowing it to be formatted in JSON for better parsing and readability in logging systems.
Description of the Change
This MR introduces support for configuring the SLO Exporter’s logging output format via the SLO_EXPORTER_LOGFORMAT environment variable, similar to the existing SLO_EXPORTER_LOGLEVEL.
Default Value: The logging format defaults to text.
New Behavior: When SLO_EXPORTER_LOGFORMAT is set to
json
, logs are outputted in JSON format for easier integration with logging tools that support structured data.This addition maintains backward compatibility as it defaults to the text format unless explicitly set to json.
Verification Process
To verify this change:
Result: Logs appear in standard text when SLO_EXPORTER_LOGFORMAT is unset or set to text.
Result: Logs are formatted as JSON when SLO_EXPORTER_LOGFORMAT is set to json.