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

Fix parent endpoint and peer in segment ref and tag url in entry span. #63

Merged
merged 4 commits into from
Apr 3, 2023

Conversation

jmjoy
Copy link
Member

@jmjoy jmjoy commented Mar 31, 2023

  1. Fix parent endpoint and peer in segment ref. In the past, the parent endpoint and peer of the sw8 header uses the endpoint and peer of the exit span by mistake (but it does not seem to affect the display of tracing on the UI).
  2. Fix tag url in entry span.

@jmjoy jmjoy added the bug Something isn't working label Mar 31, 2023
@jmjoy jmjoy added this to the 0.5.0 milestone Mar 31, 2023
@wu-sheng
Copy link
Member

It does when you check endpoint dependencies(endpoint dashboard). The graph would be totally wrong.

@jmjoy jmjoy marked this pull request as ready for review April 1, 2023 05:15
@jmjoy jmjoy requested a review from wu-sheng April 1, 2023 05:37
@wu-sheng
Copy link
Member

wu-sheng commented Apr 1, 2023

let sw_header = RequestContext::try_with_global_ctx(request_id, |ctx| {
Ok(encode_propagation(ctx, info.url.path(), &info.peer))
let sw_header = RequestContext::try_with_global(request_id, |req_ctx| {
let span_object = req_ctx.entry_span.span_object();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any case the entry_span is null? Usually, in Java practice. we would pick the first entry span, if it can't be found, we fall back to the first span. This is usually happens this trace starts from a timer/scheduler.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or sometimes, the plugin doesn't cover the entry. So, only the current exit span with some local spans left.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now PHP trace always start from HTTP requests, so the entry span will exist, I think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just suggest maybe it is better to add a method to retrieve the endpoint(looking for entrySpan's) rather than hard-coding this everywhere.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I has switch to use get_primary_span method.

@jmjoy
Copy link
Member Author

jmjoy commented Apr 1, 2023

@jmjoy jmjoy marked this pull request as draft April 1, 2023 13:36
@jmjoy jmjoy changed the title Fix parent endpoint and peer in segment ref. Fix parent endpoint and peer in segment ref and tag url in entry span. Apr 2, 2023
@jmjoy jmjoy marked this pull request as ready for review April 3, 2023 01:12
@jmjoy jmjoy requested a review from wu-sheng April 3, 2023 01:12
@wu-sheng wu-sheng merged commit 9fa0827 into apache:master Apr 3, 2023
@jmjoy jmjoy deleted the curl branch April 3, 2023 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants