-
Notifications
You must be signed in to change notification settings - Fork 891
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
Add Initial OpenTracing compatibility requirements #768
Add Initial OpenTracing compatibility requirements #768
Conversation
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.
Is there a way to minimize throwing exceptions when no equivalent OTEL API is available? This effectively means that the shim is not fully OpenTracing compatible and might require instrumentation changes.
That's a good point. Error reporting guidelines have changed ever since we created the Shim for Java, which means that for such operations so should not throw any error - but maybe we can log it (as a relatively severe warning), in order to allow users to see that. @yurishkuro @tedsuo any feedback on this? |
@pavolloffay Updated it to include the timestamp mentions (had totally overseen that, thanks) and for unrecognized tag types, we don't generate any error, but try to log a warning instead. |
Updated. Please review @pavolloffay @bogdandrutu @yurishkuro |
Curious to know if collector receivers should be in scope for the compatibility requirements? |
### Set Baggage Item | ||
|
||
Creates a newly associated `SpanContext` shim object with a new `CorrelationContext` | ||
containing the specified name/value pair. |
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.
I am not sure I understand this. Can this even be supported transparently? In OT the SetBaggage is a void function. If it were to be translated into OTel CorrelationContext change, would it not result in the creation of a new instance of the Context object (which may or may not need to be made "current")?
### SpanContext | ||
|
||
The `SpanContext` interface MUST be implemented using a OpenTelemetry `SpanContext` | ||
in conjunction with an associated `CorrelationContext`. |
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.
"must be implemented" is unclear, did you mean "must embed/encapsulate ..."?
Hey @yurishkuro Thanks for the feedback, applied. I'm still not sure we need (nor want) to create a new In general, such approach does not quite appeal to me (at this moment), as Such case is tricky as you could have:
|
@carlosalberto I was looking at it with this in mind:
Given these constraints, the only way to update baggage in OTel is to create a new Context with a new CorrContext inside, regardless of whether we're doing it via OTel API directly or via OT-shim. But OT-shim does not return anything from SetBaggage calls. That might still work with thread-local based context managers, but not with explicit contexts (e.g. Go). |
Some writing suggestions for clarity:
|
### SpanContext | ||
|
||
The `SpanContext` interface MUST be implemented using a OpenTelemetry `SpanContext` | ||
in conjunction with an associated `CorrelationContext`. |
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.
Please mention how the individual OT SpanContext methods match to the underlying OTel methods.
One more point: This doc almost covers all the OT method calls. Some method calls are described in their own headers, some calls are mixed in with the object descriptions, and some calls are missing. Normalizing the format of this document to something like the following could help comprehension. NewOpenTracingShim
OpenTracing [ObjectName]
[ObjectName].[MethodName]
|
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
Hey @tedsuo @yurishkuro I have a pair of doubts on how to tackle the (Note: Both of this -inusual- cases become tricky when the user is allowed to mix Baggage being overwritten by OTelActivating try (io.opentracing.Scope scope = tracer.activateSpan(opentracingSpan)) {
try (io.opentelemetry.context.Scope scope2 = setCurrentBaggage(otelBaggageObj)) {
// Will return the contents of `otelBaggageObj`.
getCurrentBaggage().getEntryValue();
// Should *still* return the contents of the `Baggage` obj linked to `opentracingSpan`, right?
opentracingSpan.getBaggageItem();
}
} Proposal: Do keep the invariant above. OT Shim will always get the linked Always keeping the activated Span's Baggage in the CURRENT Contexttry (io.opentracing.Scope scope = tracer.activateSpan(opentracingSpan)) {
// Changes the `Baggage` obj linked to `opentracingSpan`. Easily doable.
opentracingSpan.setBaggageItem();
// PROBLEM: to reflect this at the underneath OTel Baggage API, we need to
// create a new Scope/Context with the resulting Baggage from the previous call.
getCurrentBaggage().getEntryValues();
}
Proposal 1: Do not create new Proposal 2: When |
Ping @yurishkuro @tedsuo ;) |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
@carlosalberto Proposal 2 looks cleaner, and feels like it is inline with how baggage is added in OpenTelemetry (you always create a new context). I would suggest going with that. |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
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.
I suggest changing all usage of "OT" to "OpenTracing", because from top-level README.md:
Please refrain from using "OT" in order to avoid confusion with the now deprecated "OpenTracing" project.
I also suggest keeping with consistent usage of "OpenTelemetry" instead of "OTel". It'll then make it easier for the reader to pickup that the document is only talking about "OpenTracing" and "OpenTelemetry" and not a third thing.
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
Fixes #114
This PR tries to mostly describe the current state (mostly in the Java/Python shims). This documented will definitely need to be augmented, once feedback arises after more OT bridges are written (and used). There are a pair of required follow-ups already:
cc @yurishkuro @codeboten @ocelotl @pavolloffay @tedsuo