-
Notifications
You must be signed in to change notification settings - Fork 172
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: support context propagation through links #837
base: main
Are you sure you want to change the base?
Conversation
a1373da
to
2c84dea
Compare
2c84dea
to
56d21c1
Compare
I think it should be ok as it is an option and the rationale behind it seems logical to me. However, I do have a few formatting suggestions, which you may consider or ignore as you see fit.
Additionally, I'm unsure whether option :propagate_with_link should be a callable or rather as an array of links (i.e. array of link is more restricted on options in my opinion). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although we already support it with URL Quantization, I am weary of adding additional extension points using code block options.
If we moved forward with this feature, I think I would prefer if this code were implemented with additional safety measures and potentially have some fallback behavior to use the parent context.
IIRC there is supposed to be something related to the Trace State that should include information about whether or not to continue a trace or start a new one, however I am not familiar with supporting Span Links for Server Span Kinds.
Is there something in the specification that states that server span kinds should support links?
👋 This pull request has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the |
@gwuah, what do you think about Ariel's comment? |
@arielvalentin This is already the case, unless i'm mistaken. If you decide not to propagate using links, the parent context will be passed to the root span.
@arielvalentin Not that I'm aware of, but this is a common use-case, as demonstrated in other libraries linked in PR description.
@xuan-cao-swi thx for the style suggestion, i'll amend it. also, it's a callable because we want to dynamically enable/disable this feature, based on stuff in headers, etc. |
Related suggestion that would have offered the same feature, and has a similar implementation in other SDKs (Go and JS, maybe others): |
I have asked about Parent/Child and Link propagation decisions in Slack1 it does not seem like there is a definitive answer, however I was pointed at this issue, which I have not had time to review yet: open-telemetry/opentelemetry-specification#3867
Let me reach out in maintainers slack to get feedback from other language maintainers. Footnotes |
Thanks, @arielvalentin for bringing this to the maintainers slack channel. What was the conclusion/next steps drawn from your conversation? |
I got very limited engagement on the topic with links to existing issues, which to be honest I have not read yet: open-telemetry/opentelemetry-specification#3877 Something that is required by Golang library instrumentations is that users have to register specific endpoints to be traced or not and have more control over what handlers should ignore in the incoming trace headers and start a new trace. That allows them more granular control of when to consider creating a new trace id as opposed to what something like Rack does where currently have a single Event Handler injected for all requests. A lot of routing is also handled by the frameworks themselves and tend not to rely on Rack figuring out what needs to process a request. I think that is what makes this more difficult to do for Ruby library instrumentations. |
Other instrumentation already use |
|
👋 This pull request has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the |
This pull request extends the rack instrumentation library to support context propagation through links.
Several libraries have this feature, for example que and otel-http lib.
Our use case is simple, we want to connect our frontend & backend traces using links, as opposed to having the frontend be the source of the root span, as that's messing with our sampling. We have had our fork running in production for a while now, just thought to upstream it.
I'm basically brute-forcing my way through ruby, so any sort of style suggestion is welcome.