Skip to content

support service address and implement span links#218

Merged
nikhilNava merged 3 commits intomainfrom
nikhilc/serverPort
Apr 1, 2026
Merged

support service address and implement span links#218
nikhilNava merged 3 commits intomainfrom
nikhilc/serverPort

Conversation

@nikhilNava
Copy link
Copy Markdown
Contributor

Task
Add baggage builder method to support server address and port. Required for auto instrumentation.
Add span links to support async spans

Copilot AI review requested due to automatic review settings March 31, 2026 20:44
@nikhilNava nikhilNava requested a review from a team as a code owner March 31, 2026 20:44
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 31, 2026

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA d9fe0d0.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

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

This PR extends the observability core SDK to support (1) propagating target server address/port via baggage for invoke-agent scenarios (to help auto-instrumentation), and (2) attaching OpenTelemetry span links to spans to represent causal relationships across async work.

Changes:

  • Add BaggageBuilder.invoke_agent_server(address, port) and propagate server.address / server.port onto invoke_agent spans via the span processor.
  • Add SpanDetails.span_links and wire span links through OpenTelemetryScope into OTel span creation.
  • Refactor scope/span creation to use SpanDetails (notably span kind) and add test coverage for span links and server address/port baggage propagation.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tests/observability/core/test_span_links.py New tests validating that SpanDetails.span_links are forwarded to OTel spans across scope types.
tests/observability/core/test_record_attributes.py Updates tests to pass span kind via SpanDetails instead of string kind=.
tests/observability/core/test_invoke_agent_scope.py Adds test asserting server address/port baggage is propagated onto invoke-agent spans.
tests/observability/core/test_baggage_builder.py Adds tests for the new invoke_agent_server() baggage builder method.
libraries/.../trace_processor/util.py Updates the attribute allowlists used by the baggage-to-span span processor; adds server address/port to invoke-agent attributes.
libraries/.../spans_scopes/output_scope.py Switches OutputScope to pass SpanDetails (and span links) into OpenTelemetryScope.
libraries/.../span_details.py Adds span_links to SpanDetails.
libraries/.../opentelemetry_scope.py Refactors constructor to accept SpanDetails and passes links= into tracer.start_span(...).
libraries/.../middleware/baggage_builder.py Adds invoke_agent_server(address, port) to set server address/port baggage.
libraries/.../invoke_agent_scope.py Refactors InvokeAgentScope span creation to use SpanDetails (including span links).
libraries/.../inference_scope.py Refactors InferenceScope span creation to use SpanDetails (including span links).
libraries/.../execute_tool_scope.py Refactors ExecuteToolScope span creation to use SpanDetails (including span links).

@nikhilNava nikhilNava enabled auto-merge (squash) April 1, 2026 13:47
Copilot AI review requested due to automatic review settings April 1, 2026 20:38
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

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

@nikhilNava nikhilNava merged commit 6d2e789 into main Apr 1, 2026
13 checks passed
@nikhilNava nikhilNava deleted the nikhilc/serverPort branch April 1, 2026 21:11
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.

5 participants