Skip to content

Fix - log record customization and update config file version#470

Merged
cleverchuk merged 1 commit into
mainfrom
cc/NH-132405
Apr 23, 2026
Merged

Fix - log record customization and update config file version#470
cleverchuk merged 1 commit into
mainfrom
cc/NH-132405

Conversation

@cleverchuk
Copy link
Copy Markdown
Contributor

Fix log record customization and update config file version

TLDR

Fixed a bug where user-specified simple log record processors were silently overwritten by the default batch exporter. Also bumped the declarative config file format version to 1.0 and added tests covering exporter override behavior for all signal types.

Details

Bug fix: simple log record processor detection

The addLogExporter method checks whether the user has already configured a log record processor before injecting the default batch exporter. Previously, it only checked for batch processors:

logRecordProcessorModel.getBatch() != null

This meant users who configured a simple processor had their setup silently replaced. The analogous trace exporter method already handled both processor types. This change adds the missing getSimple() != null check to bring log handling into parity with trace handling.

Config file version bump

Updated file_format from "0.4" to "1.0" to align with the current OTel declarative configuration schema version.

New tests

Added tests verifying that user-specified exporters are not overwritten for:

  • Traces — batch and simple span processors
  • Logs — batch and simple log record processors
  • Metrics — user-provided metric reader

Test services data

  1. e-1712644058766987264
  2. e-1712643928659124224
  3. e-1742334541200846848
  4. e-1777406072376840192

Copilot AI review requested due to automatic review settings April 22, 2026 20:35
@cleverchuk cleverchuk requested review from a team as code owners April 22, 2026 20:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes declarative-config customization so that a user-configured simple log record processor is treated as “already configured”, preventing the customizer from injecting the default batch log exporter. Also updates the example SDK config file format version and adds regression tests for exporter/reader override behavior across signals.

Changes:

  • Treat simple log record processors as preconfigured in addLogExporter, matching trace behavior.
  • Bump sdk-config.yaml file_format to "1.0".
  • Add tests intended to ensure user-specified exporters/readers are not overridden for traces/logs/metrics.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
sdk-config.yaml Updates declarative config file_format to "1.0".
libs/shared/src/main/java/com/solarwinds/opentelemetry/extensions/config/provider/SharedConfigCustomizerProvider.java Fixes log exporter injection guard to recognize both batch and simple processors.
libs/shared/src/test/java/com/solarwinds/opentelemetry/extensions/config/provider/SharedConfigCustomizerProviderTest.java Adds tests for “don’t override user config” behavior for metrics/traces/logs.

Copy link
Copy Markdown

@jerrytfleung jerrytfleung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@cleverchuk cleverchuk merged commit 3436c0a into main Apr 23, 2026
20 checks passed
@cleverchuk cleverchuk deleted the cc/NH-132405 branch April 23, 2026 16:08
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.

3 participants