Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(zipkin): support b3 req header #3551

Merged
merged 2 commits into from
Feb 22, 2021
Merged

Conversation

spacewander
Copy link
Member

Fix #1125
Signed-off-by: spacewander spacewanderlzx@gmail.com

What this PR does / why we need it:

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

Fix apache#1125
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
@spacewander spacewander marked this pull request as ready for review February 7, 2021 11:15
err, trace_id, request_span_id, sampled, parent_span_id = parse_b3(b3)

if err then
core.log.warn("invalid b3 header: ", b3, ", ignored: ", err)
Copy link
Member

Choose a reason for hiding this comment

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

use error is better here

Copy link
Member Author

Choose a reason for hiding this comment

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

@membphis
Raise error in a request may be considered a bug of APISIX (as it will provide 500 and backtrack).
Maybe we can return 400 to reject it?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think 400 is better, since an invalid header is always caused by client.

Copy link
Member

Choose a reason for hiding this comment

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

I think 400 is better, since an invalid header is always caused by client.

agree this too.

Raise error in a request may be considered a bug of APISIX (as it will provide 500 and backtrack).

I means core.log.error(****) ^_^

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
@membphis
Copy link
Member

@Yiyiyimu Chaos Test failed, do you have time to look at this PR?

@spacewander spacewander merged commit 9123e18 into apache:master Feb 22, 2021
@spacewander spacewander deleted the b3-decode branch February 22, 2021 01:23
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature: parse b3 single header for zipkin plugin
3 participants