Skip to content

Defer default otel_resource creation in SolarWindsApmConfig.__init__#808

Draft
tammy-baylis-swi with Copilot wants to merge 3 commits into
NH-142591-refactor-apm-resourcefrom
copilot/fix-code-review-comment-807
Draft

Defer default otel_resource creation in SolarWindsApmConfig.__init__#808
tammy-baylis-swi with Copilot wants to merge 3 commits into
NH-142591-refactor-apm-resourcefrom
copilot/fix-code-review-comment-807

Conversation

Copilot AI commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

This PR addresses the single review comment on PR #807: avoid evaluating Resource.create() in the constructor signature and apply the requested initialization pattern directly. The change is scoped to that comment only.

  • Default argument behavior

    • Replaced eager default construction in SolarWindsApmConfig.__init__:
      • from otel_resource: Resource = Resource.create()
      • to otel_resource: Optional[Resource] = None
  • Runtime initialization

    • Added in-method fallback to preserve behavior for callers that omit otel_resource:
      • if otel_resource is None: otel_resource = Resource.create()
  • Typing/docstring alignment

    • Updated parameter typing and docstring to reflect None-default semantics while keeping backward-compatible behavior.
def __init__(self, otel_resource: Optional[Resource] = None, **kwargs: int) -> None:
    if otel_resource is None:
        otel_resource = Resource.create()
    ...

Copilot AI changed the title [WIP] Fix code based on review comment for pull request 807 Defer default otel_resource creation in SolarWindsApmConfig.__init__ Jul 9, 2026
Copilot AI requested a review from tammy-baylis-swi July 9, 2026 00:27
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.

2 participants