Skip to content

fix(otel): validate config before consuming provider builder - #740

Closed
zhongkechen wants to merge 4 commits into
mainfrom
fix/otel-config-validation
Closed

zhongkechen wants to merge 4 commits into
mainfrom
fix/otel-config-validation

Conversation

@zhongkechen

@zhongkechen zhongkechen commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Issue Link, if available

Extracted as an independent fix from #721.

Description

The provider-builder constructors for both OTel plugins consumed the caller's builder, built a provider, and only then dereferenced the config. A null config therefore discarded an unreachable provider whose span processors and worker threads could not be shut down.

Validate the config before touching the builder in both plugins, and apply the same explicit validation to the config-only constructors. No public API changes.

Demo/Screenshots

Not applicable.

Checklist

  • I have filled out every section of the PR template
  • I have thoroughly tested this change

Testing

Unit Tests

OtelPluginConfigValidationTest: 3 tests passed, covering all four constructor paths. Separate spies for both provider-builder constructors verify that null config rejection causes no builder interactions, including no build() call.

Both spy tests fail against the original constructors without the early validation. Formatting checks passed.

Integration Tests

Not required; this is constructor validation before plugin execution begins.

Examples

Not applicable.

@zhongkechen
zhongkechen requested a review from a team September 25, 2026 21:59
@zhongkechen
zhongkechen temporarily deployed to ai-pr-review-runtime September 25, 2026 21:59 — with GitHub Actions Inactive
@zhongkechen
zhongkechen temporarily deployed to ai-pr-review-runtime September 25, 2026 22:15 — with GitHub Actions Inactive
@github-actions

This comment has been minimized.

@zhongkechen
zhongkechen temporarily deployed to ai-pr-review-runtime September 25, 2026 23:04 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown
Contributor

Codex AI review

No actionable findings. Residual risk: tests were not executed under the review constraints; assessment is based on the SHA-anchored diff and base sources.

Reviewed commit 644420f93036545d28598ebd7b34f19994dd5404. Workflow run

@zhongkechen
zhongkechen deleted the fix/otel-config-validation branch September 29, 2026 17:30

This branch was previously deployed

1 inactive deployment
ai-pr-review-runtime — 644420f9 Deployed Sep 25, 2026 by zhongkechen via ai-pr-review / Codex review / Generate Codex review #1124
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant