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

feat: Add add_link to span api/sdk #1623

Merged
merged 5 commits into from
Apr 9, 2024
Merged

feat: Add add_link to span api/sdk #1623

merged 5 commits into from
Apr 9, 2024

Conversation

dmathieu
Copy link
Member

@dmathieu dmathieu commented Apr 2, 2024

The specification has recently been updated to add the ability to add span links after span creation.

See:

This updates the API and SDK to add this new method.

Note: I am not fully sure how you all are handling additive changes to the API. With Ruby being very permissive with method definitions, I assume shipping everything together is fine.
If you think that could cause an issue (like the API being used with a lower version of the SDK), I'm happy to split this PR into two, so the SDK is shipped first, and the API in another release.

Copy link
Contributor

@kaylareopelle kaylareopelle left a comment

Choose a reason for hiding this comment

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

Thank you for bringing the Ruby project into compliance with this spec update!

I'll defer to the @open-telemetry/ruby-maintainers to your questions about API and SDK releases.

I have a few small documentation comments.

I'm also curious about this line in the spec:

Links added after Span creation may not be considered by Samplers.

Can you tell me how links added using the add_link method are ignored by Samplers?

api/lib/opentelemetry/trace/span.rb Outdated Show resolved Hide resolved
sdk/lib/opentelemetry/sdk/trace/span.rb Outdated Show resolved Hide resolved
dmathieu and others added 2 commits April 4, 2024 09:27
Co-authored-by: Kayla Reopelle (she/her) <87386821+kaylareopelle@users.noreply.github.com>
Co-authored-by: Kayla Reopelle (she/her) <87386821+kaylareopelle@users.noreply.github.com>
@dmathieu
Copy link
Member Author

dmathieu commented Apr 4, 2024

Can you tell me how links added using the add_link method are ignored by Samplers?

SDK samplers, which perform head sampling (not collector samplers, or any other tail sampler) run on span creation. So when add_link is called, the head sampling decision has already been made, and is not reconsidered with the new link.

@kaylareopelle
Copy link
Contributor

SDK samplers, which perform head sampling (not collector samplers, or any other tail sampler) run on span creation. ...

Thank you, @dmathieu. This connects the dots!

@fbogsany fbogsany changed the title Add add_link to span api/sdk feat: Add add_link to span api/sdk Apr 9, 2024
@fbogsany fbogsany merged commit f14bdac into open-telemetry:main Apr 9, 2024
58 checks passed
@dmathieu dmathieu deleted the add_link branch April 10, 2024 06:47
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.

3 participants