Skip to content

refactor(tracer): use Context instead of SpanContext#853

Open
pvital wants to merge 5 commits intoinstana:mainfrom
pvital:extract-context
Open

refactor(tracer): use Context instead of SpanContext#853
pvital wants to merge 5 commits intoinstana:mainfrom
pvital:extract-context

Conversation

@pvital
Copy link
Member

@pvital pvital commented Mar 20, 2026

To maintain OpenTelemetry API compliance, this PR contains multiple commits that change multiple parts of the code to use the context parameter instead of the deprecated span_context parameter when calling start_span() and start_as_current_span() methods.

These changes align with OpenTelemetry's API conventions and improve consistency across the codebase.

This PR consists of the following commits:

This PR fixes #847.

To maintain OpenTelemetry API compliance, this commit changes the
InstanaTracer to use OTel's `Context` instead of the Instana's
`SpanContext` as `context` parameter for `start_as_current_span()` and
`start_span()`. methods.

This commit fixes instana#847.

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
Co-authored-by: Varsha GS <varsha.gs@ibm.com>
pvital and others added 3 commits March 20, 2026 17:41
This commit updates base_propagator to use the `context` parameter
instead of the deprecated `span_context` parameter when calling
`start_span()` and `start_as_current_span()` methods. This change aligns
with OpenTelemetry's API conventions and improves consistency across
the codebase.

This commit fixes instana#847.

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
Co-authored-by: Varsha GS <varsha.gs@ibm.com>
This commit updates all instrumentation modules to use the `context`
parameter instead of the deprecated `span_context` parameter when
calling `start_span()` and `start_as_current_span()` methods. This
change aligns with OpenTelemetry's API conventions and improves
consistency across the codebase.

This commit fixes instana#847.

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
Co-authored-by: Varsha GS <varsha.gs@ibm.com>
This commit updates all tests to use the `context` parameter instead of
the deprecated `span_context` parameter when calling `start_span()` and
`start_as_current_span()` methods.

This commit fixes instana#847.

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
Co-authored-by: Varsha GS <varsha.gs@ibm.com>
Added type annotations to the binary, HTTP and text propagators and used ruff (vscode) to:
- Black-compatible code formatting.
- fix all auto-fixable violations, like unused imports.
- isort-compatible import sorting.

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
@instana instana deleted a comment from github-actions bot Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug OTel OpenTelemetry compatibility. refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: start_as_current_span() missing OpenTelemetry 'context' parameter

1 participant