Skip to content

feat(zipkin): support b3 req header#3551

Merged
spacewander merged 2 commits into
apache:masterfrom
spacewander:b3-decode
Feb 22, 2021
Merged

feat(zipkin): support b3 req header#3551
spacewander merged 2 commits into
apache:masterfrom
spacewander:b3-decode

Conversation

@spacewander

Copy link
Copy Markdown
Member

Fix #1125
Signed-off-by: spacewander [email protected]

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

@spacewander
spacewander marked this pull request as ready for review February 7, 2021 11:15
Comment thread apisix/plugins/zipkin.lua Outdated
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 <[email protected]>
@membphis

Copy link
Copy Markdown
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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