-
Notifications
You must be signed in to change notification settings - Fork 85
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
fix: Backport opentelemetry 0.18 code from main repo #9
fix: Backport opentelemetry 0.18 code from main repo #9
Conversation
This is pretty much a backport from the code that @jtescher did on the main repo Signed-off-by: Jayson Reis <[email protected]>
2d3d3ec
to
6b86ab6
Compare
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 just left comments on parts of the code that seems that the current version should stay, would you mind taking a look at them?
@@ -1104,7 +1119,7 @@ mod tests { | |||
let subscriber = tracing_subscriber::registry().with(layer().with_tracer(tracer.clone())); | |||
|
|||
tracing::subscriber::with_default(subscriber, || { | |||
tracing::debug_span!("request", otel.kind = %SpanKind::Server); | |||
tracing::debug_span!("request", otel.kind = "server"); |
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.
tracing::debug_span!("request", otel.kind = "server"); | |
tracing::debug_span!("request", otel.kind = %SpanKind::Server); |
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.
The spec doesn't define a Display
impl so this was removed in the opentelemetry
crate as it pushes for a 1.0 release, so we have to provide our own conventions in this crate for now.
@@ -1154,7 +1178,7 @@ mod tests { | |||
let _g = existing_cx.attach(); | |||
|
|||
tracing::subscriber::with_default(subscriber, || { | |||
tracing::debug_span!("request", otel.kind = %SpanKind::Server); | |||
tracing::debug_span!("request", otel.kind = "server"); |
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.
tracing::debug_span!("request", otel.kind = "server"); | |
tracing::debug_span!("request", otel.kind = %SpanKind::Server); |
|
||
// Sample or defer to existing sampling decisions | ||
let (flags, trace_state) = if let Some(result) = &builder.sampling_result { | ||
process_sampling_result(result, parent_trace_flags) | ||
} else if no_parent || remote_parent { | ||
} else { |
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.
Should the previous branch stay?
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.
no this is right
@@ -95,12 +95,6 @@ impl PreSampledTracer for Tracer { | |||
builder.sampling_result.as_ref().unwrap(), | |||
parent_trace_flags, | |||
) | |||
} else { |
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.
Should this also stay?
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.
This changed as well
Note that opentelemetry 0.19 has been released yesterday. |
@djc I've tested 0.19 with this PR, and it seems to work fine but, as this is a backport from another author, I didn't want to change the code in this PR as I don't “own” it |
Thanks for doing this PR! Sorry for the delay in reviewing this. I'll get on it shortly.
I think that for clarity of commit history, we should make upgrading to opentelemetry 0.19 a separate PR. |
|
||
// Sample or defer to existing sampling decisions | ||
let (flags, trace_state) = if let Some(result) = &builder.sampling_result { | ||
process_sampling_result(result, parent_trace_flags) | ||
} else if no_parent || remote_parent { | ||
} else { |
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.
no this is right
@@ -95,12 +95,6 @@ impl PreSampledTracer for Tracer { | |||
builder.sampling_result.as_ref().unwrap(), | |||
parent_trace_flags, | |||
) | |||
} else { |
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.
This changed as well
Hey, Any chances this gets merged soon? I'd like to use some features present in opentelemetry 0.19.0 together with tracing-opentelemetry. Thank you all o/ |
@jaysonsantos, looks like I'm eager to see this merged too (as well as the update for opentelemetry 0.19). If there is anything I can do to help, please let me know... Thanks for shepherding this! |
Signed-off-by: Jayson Reis <[email protected]>
@davidbarsky @jtescher do you mind taking a look on the latest commit? |
@davidbarsky @jtescher do you know when you'll be able to take a look at this? I'm wondering if I should wait or use a temporary fork |
Thanks @jaysonsantos! |
Motivation
I noticed that this repo got the cut-off before opentelemetry 0.18 was committed into the main repo so I tried to backport what was there.
Solution
This is pretty much a backport from the code that @jtescher did on the main repo.
Let me know if you see something wrong, I tried to adapt the rejections the best way possible.
This fix #8