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.

@pvital pvital self-assigned this Mar 20, 2026
@pvital pvital requested a review from a team as a code owner March 20, 2026 11:57
@pvital pvital added bug refactor OTel OpenTelemetry compatibility. labels Mar 20, 2026
@pvital pvital force-pushed the extract-context branch 2 times, most recently from ef22e8f to 6ee3331 Compare March 20, 2026 16:54
@instana instana deleted a comment from github-actions bot Mar 20, 2026
Copy link
Contributor

@GSVarsha GSVarsha left a comment

Choose a reason for hiding this comment

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

Just a few suggestions

@pvital pvital requested a review from GSVarsha March 23, 2026 12:39
pvital and others added 5 commits March 23, 2026 16:44
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>
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>
Copy link
Contributor

@GSVarsha GSVarsha left a comment

Choose a reason for hiding this comment

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

Looks good to me!

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

2 participants