-
Notifications
You must be signed in to change notification settings - Fork 888
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
Small clean up for Propagators. #577
Small clean up for Propagators. #577
Conversation
Sorry I haven't followed this part of the spec previously, but the Format/Carrier separation in OpenTracing was often criticized as unnecessary and confusing, leading to type-unsafe interfaces, and I was under impression that we were going to end up with a single entity in OTel. Specifically, the only role that the |
Co-Authored-By: Sergey Kanzhelev <S.Kanzhelev@live.com>
Hey @yurishkuro thanks for the feedback.
So at this moment, the
Which means there's no That being said, I feel I'm missing something from your comment. Would you mind elaborating? |
So there's even one more thing here, a Setter. Wouldn't this be simpler?
While the "format" as a concept is sort of present here, but also sort-of not, because any term/concept we introduce in the spec creates an unnecessary mental overhead. In OT the Format was actually strongly typed in some languages, but I think the whole model would be simpler if we talk about Propagators/Carriers as abstract notions with concrete subtypes suitable for different transports. |
I think it will, and it will probably happen as part of #433 anyway (at least we can revisit that possibility).
Ok, so kinda drop the |
Hey @yurishkuro
So I updated this PR to make a With these changes, Let me know if you think we should remove the few remaining (Also, the refactoring should help a lot when we restore the |
I think "carrier" is an abstraction of inter-process message that also directly implies the metadata format via the API that specific carriers expose. So on one hand we could try to express everything in terms of carriers, but on the other hand I did just use the words "metadata format". Maybe it's ok to keep those, but I would suggest trying to avoid using fixed-width |
Hey @yurishkuro thanks for the answer. So I'm trying to get the exact details done.
Does this mean we should just barely mention If not, please elaborate a little bit more ;) I'm happy to make the iterations needed to get us to a much better place, but would like to get a better understanding of your vision. |
I would only mention it when discussing "metadata format". I don't see why it needs to be any symbol in the API - why would it be an interface? The Inject/Extract methods are on the Propagator, not the format. |
Hey @yurishkuro Updated the propagators section to not use Not sure this is how you had envisioned this one. But we definitely want to keep mentioning the details of the Let me know ;) |
@yurishkuro Updated. The only remaining item is the issue regarding Propagators taking a |
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.
A changelog.md change is also required.
Co-authored-by: Christian Neumüller <christian+github@neumueller.me>
Co-authored-by: Christian Neumüller <christian+github@neumueller.me>
Co-authored-by: Christian Neumüller <christian+github@neumueller.me>
Co-authored-by: Christian Neumüller <christian+github@neumueller.me>
Co-authored-by: Christian Neumüller <christian+github@neumueller.me>
Co-authored-by: Christian Neumüller <christian+github@neumueller.me>
@Oberon00 Updated. Please leave feedback on the new changes. |
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.
Looks like a good improvement to me overall. I hope this unblocks #437 😃
|
||
### Fields | ||
|
||
The propagation fields defined. If your carrier is reused, you should delete the fields here | ||
before calling [inject](#inject). | ||
|
||
Fields are defined as string keys identifying format-specific components in a carrier. |
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.
Maybe it would be more clear to define fields as the key-value pairs and then use field key
or field name
below.
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'd rather so that as a follow up in order to make progress and merge this PR ;)
Trying to clarify: you are suggesting we only change the terms used (and update the document with them), not the actual return value (a list of strings), right?
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.
Yes, I was just trying to clarify terminology, not suggesting an actual content change.
@yurishkuro Removed the (hopefully final) requested change, regarding the default |
@carlosalberto please rebase |
@bogdandrutu @yurishkuro Ready for review ;) |
## Propagator Types | ||
|
||
A `Propagator` type defines the restrictions imposed by a specific transport | ||
and is bound to a data type, in order to propagate in-band context data across process boundaries. |
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.
@@ -68,65 +126,57 @@ The use cases of this are: | |||
- allow pre-allocation of fields, especially in systems like gRPC Metadata | |||
- allow a single-pass over an iterator | |||
|
|||
Returns list of fields that will be used by this formatter. | |||
Returns list of fields that will be used by the `HttpTextPropagator`. |
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 find this Fields section very confusing and not well-worded (e.g. what does "Returns..." refer to?) Let's revisit it in another PR. #712
|
||
`Getter` MUST be stateless and allowed to be saved as a constant to avoid runtime allocations. One of the ways to implement it is `Getter` class with `Get` method as described below. | ||
One of the ways to implement it is `Getter` class with `Get` method as described below. | ||
|
||
##### Get |
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.
Updates #453
Things that still need to be addressed:
Fields
section needs to be clearer and not part of theHttpTextFormat
: At this moment it is tied toHttpTextFormat
, and might become more general depending on how Update Binary format in the Specification #437 is solved (not sure this can be used byBinary
format, but still). I recommend creating a new ticket to track this, and depend on the outcome of Binary being restored.