-
Notifications
You must be signed in to change notification settings - Fork 438
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 Jaeger propagator #599
Conversation
Codecov Report
@@ Coverage Diff @@
## main #599 +/- ##
==========================================
+ Coverage 94.40% 94.45% +0.04%
==========================================
Files 191 197 +6
Lines 9066 9183 +117
==========================================
+ Hits 8559 8674 +115
- Misses 507 509 +2
|
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.
LGTM in general with few minor comments. Thanks for restructuring code to eliminate code duplication as part of this.
@@ -93,6 +93,17 @@ class Context | |||
|
|||
bool operator==(const Context &other) const noexcept { return (head_ == other.head_); } | |||
|
|||
trace::SpanContext GetCurrentSpan() const |
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.
Nit: Ideally Context
class should be agnostic of what is stored inside. Do you think we can instead keep it under propagation::detail
namespace ?
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.
Moved it to propagation::detail
, but I think the context API is somewhat unfriendly to users, especially if accessing and setting spans is probably the most common use case.
} | ||
|
||
nostd::string_view trace_id_hex = trace_fields[0]; | ||
nostd::string_view span_id_hex = trace_fields[1]; |
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 trace_fields[2]
not used?
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.
Yup, it's the deprecated parent span ID (https://www.jaegertracing.io/docs/1.22/client-libraries/#value)
Fixes #542
Changes
Adds Jaeger trace extraction and injection as specified here.
Baggage is not part of the PR as it's not supported by the otel-cpp API yet.
Miscellaneous:
GetCurrentSpan
duplication from each propagator. Moved it to context's member function.For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes