Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OTEL: preserve span.kind if set as attributes in the builder #8298

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amarziali
Copy link
Collaborator

@amarziali amarziali commented Jan 29, 2025

What Does This Do

Some opentelemetry API versions don't allow setting the span kind on the builder (i.e. using setSpanKind method)

So things like

tracer.spanBuilder("..").setAttribute("span.kind", "client").start();

will have the span created with an internal span kind. However, if setAttribute is called after the span is started, the span.kind is overridden.

This might lead to inconsistencies and we should not set it to internal if set by setAttribute

Motivation

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@amarziali amarziali requested review from a team as code owners January 29, 2025 11:08
Copy link
Contributor

Hi! 👋 Thanks for your pull request! 🎉

To help us review it, please make sure to:

  • Add at least one type, and one component or instrumentation label to the pull request

If you need help, please check our contributing guidelines.

@amarziali amarziali added type: bug inst: opentelemetry OpenTelemetry instrumentation labels Jan 29, 2025
Copy link
Contributor

@mcculls mcculls left a comment

Choose a reason for hiding this comment

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

Looks reasonable

Copy link
Contributor

@PerfectSlayer PerfectSlayer left a comment

Choose a reason for hiding this comment

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

Could you make sure the RFC gets updated it gets tested in system tests first?

@amarziali amarziali added the tag: do not merge Do not merge changes label Jan 30, 2025
@amarziali
Copy link
Collaborator Author

It's on hold since the behaviour related to how to handle properly span.kind is clarified

@amarziali amarziali marked this pull request as draft January 30, 2025 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inst: opentelemetry OpenTelemetry instrumentation tag: do not merge Do not merge changes type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants