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

Implement Baggage ( prev: CorrelationContext ) #79

Closed
reyang opened this issue May 8, 2020 · 11 comments · Fixed by #676
Closed

Implement Baggage ( prev: CorrelationContext ) #79

reyang opened this issue May 8, 2020 · 11 comments · Fixed by #676
Assignees
Labels
help wanted Good for taking. Extra help will be provided by maintainers priority:p1 Issues that are blocking release:required-for-ga To be resolved before GA release
Milestone

Comments

@reyang
Copy link
Member

reyang commented May 8, 2020

https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/correlationcontext/api.md

@reyang reyang added this to the Alpha v0.2 milestone May 8, 2020
@lalitb lalitb changed the title Implement CorrelationContext Implement Baggage ( prev: CorrelationContext ) Dec 16, 2020
@lalitb lalitb added help wanted Good for taking. Extra help will be provided by maintainers priority:p1 Issues that are blocking release:required-for-ga To be resolved before GA release labels Dec 16, 2020
@nikhil1511
Copy link
Contributor

Hi, I would like to work on this task. My understanding is that baggage will have multiple key, value pairs. Do we need new type something like shared_ptr of unordered_map<string, string> in the variant of contextval for the same ?
Clarification on this will be helpful.
Thanks in advance.

@lalitb
Copy link
Member

lalitb commented Feb 12, 2021

@nikhil1511 - Thanks for showing interest on this task. Baggage extracts and inserts information in Context object ( https://github.com/open-telemetry/opentelemetry-cpp/blob/main/api/include/opentelemetry/context/context.h). No new type should be needed for ContextValue.
Suggest you to go through baggage specs, reference implementation in other languages, and come up with the PR for C++ if the task interests you. We can further discuss on that.

@nikhil1511
Copy link
Contributor

nikhil1511 commented Feb 12, 2021

Thanks for the reply. But, baggage key "baggage" has multiple key value pairs as its value, right (example "key1=val1,key2=val2") ? So, how do we plan to support this in context ? Ideally "baggage" will be key in the context and value should be data structure representing "key1=val1,key2=val2".
Am I missing anything here ? I have taken reference from python apis.

@lalitb
Copy link
Member

lalitb commented Feb 12, 2021

If required should be fine to create a new type in variant. Just ensure not to use any STL types (vector, maps, unordered_map ) within api intrfaces and as data member within classes in api to ensure ABI stability: https://github.com/open-telemetry/opentelemetry-cpp/blob/484700a0da2547852653271d2bdc10b50830bb86/docs/abi-policy.md

@nikhil1511
Copy link
Contributor

nikhil1511 commented Mar 18, 2021

Hello Lalit,
I have implemented api, context interaction and propagation for baggage with unit tests. Currently, it is in my forked repo( nikhil1511#1 ). You have raised PR for baggage api already, how would you suggest me to go forward. Your inputs will be very helpful.
Apologies for delay from my side after last conversation.
PS. I had taken some references from trace_state implementation. The duplicated code has been already moved to common place in your PR, I can adjust my prs accordingly.

@lalitb
Copy link
Member

lalitb commented Mar 18, 2021

@nikhil1511 - My PR is still draft. I see your changes in right direction . Can you go through my PR once and incorporate required changes from there. Basically what we want is:

  • TraceState and Baggage should reuse most of the code, instead of duplication at both the places. Also see if we can reuse header parsing part.
  • Only allocate needed memory. Current implementation allocated max possible entries which can be improved.

We need baggage api merged for our beta release which is planned for March end. See if we can come up with something soon.

@lalitb
Copy link
Member

lalitb commented Mar 18, 2021

Also if you like to join our community meeting to discuss further, feel free to join coming week. You can find meeting details in repo root.

@nikhil1511
Copy link
Contributor

@nikhil1511 - My PR is still draft. I see your changes in right direction . Can you go through my PR once and incorporate required changes from there. Basically what we want is:

  • TraceState and Baggage should reuse most of the code, instead of duplication at both the places. Also see if we can reuse header parsing part.
  • Only allocate needed memory. Current implementation allocated max possible entries which can be improved.

We need baggage api merged for our beta release which is planned for March end. See if we can come up with something soon.

@lalitb working on incorporating changes from your pr. I will try to put three separate PRs instead of my current PR where all following features are added

  • Baggage API
  • Context interaction of baggage
  • Baggage Propagator

Do let me know if you think otherwise.

@nikhil1511
Copy link
Contributor

nikhil1511 commented Mar 25, 2021

@lalitb should I raise a new PR from main branch for trace_state refactoring ? I have kept many changes from your draft PR and extracted out some parsing logic of header string to common place. Also, planning to remove baggage part from the PR and add it in subsequent prs [Unit tests are not complete yet. So, I will raise after tests are complete.]
Or should I put patch on your draft PR ?

@lalitb
Copy link
Member

lalitb commented Mar 25, 2021

@lalitb should I raise a new PR from main branch for trace_state refactoring ? I have kept many changes from your draft PR and extracted out some parsing logic of header string to common place. Also, planning to remove baggage part from the PR and add it in subsequent prs [Unit tests are not complete yet. So, I will raise after tests are complete.]
Or should I put patch on your draft PR ?

Better to raise a new PR for this.

@nikhil1511
Copy link
Contributor

nikhil1511 commented Mar 26, 2021

@lalitb I have created a PR to be submitted to main branch. I am just waiting for couple of legal approvals (should be done quickly, I hope). Just wanted to give update. Link : nikhil1511#2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Good for taking. Extra help will be provided by maintainers priority:p1 Issues that are blocking release:required-for-ga To be resolved before GA release
Projects
None yet
3 participants