-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[ShippingService] Parent span not set properly #1318
Comments
In the following snippet, shouldn't the async fn request_quote(count: u32) -> Result<f64, Box<dyn std::error::Error>> {
// TODO: better testing here and default quote_service_addr
let quote_service_addr: String = format!(
"{}{}",
env::var("QUOTE_SERVICE_ADDR").expect("$QUOTE_SERVICE_ADDR is not set"),
"/getquote"
);
let mut reqbody = HashMap::new();
reqbody.insert("numberOfItems", count);
let client = ClientBuilder::new(reqwest::Client::new())
.with(TracingMiddleware::<SpanBackendWithUrl>::new())
.build();
let req = client.request(Method::POST, quote_service_addr);
let mut headers = HeaderMap::new();
let cx = Context::current();
global::get_text_map_propagator(|propagator| {
propagator.inject_context(&cx, &mut HeaderInjector(&mut headers))
});
let resp = req
.json(&reqbody)
.headers(headers)
.send()
.await?
.text_with_charset("utf-8")
.await?;
debug!("{:?}", resp);
match resp.parse::<f64>() {
Ok(f) => Ok(f),
Err(error) => Err(Box::new(error)),
}
} @TommyCpp do you spot where we are doing the context propagation wrong here? |
Feel free to assign this to me. I can take a look this week |
Thank you @TommyCpp! |
I think the issue lie with
But that happens after we setup the header
and somewhere before the request is sent. The quick patch would be disable the |
By default the propgation on the |
Thank you @TommyCpp! We can definitely wait for the better fix. |
Yep I can open the issue on their side. I also want to construct some examples between rust client and rust server to help investigation |
@TommyCpp did you happen to have opened a ticket on their side? Do I need to provide any extra info other than what you've detailed here: #1318 (comment)? |
Bug Report
Which version of the demo you are using?
v1.7.0
Symptom
When
shippingservice
callsquoteservice
the parent_id sent is not from the caller, but from the caller's parent.The trace is currenly looking like this:
But it should be something like this:
Reproduce
Simply run the demo with
docker compose up
and check any trace containingshippingservice
spans.The text was updated successfully, but these errors were encountered: