Skip to content

Conversation

@mohammedalics
Copy link
Member

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:

  • Set SLO_EXPORTER_LOGFORMAT to text and json and verified the output format aligns with the specified setting.
    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.
  • Verified that setting an invalid value for SLO_EXPORTER_LOGFORMAT (e.g., xml) falls back to text without errors, ensuring stability in cases of misconfiguration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant