Skip to content

fix: zipkin trace_id and span_id format in ngx_var#12403

Merged
Baoyuantop merged 2 commits into
apache:masterfrom
Baoyuantop:fix-zipkin-trace-id
Jul 11, 2025
Merged

fix: zipkin trace_id and span_id format in ngx_var#12403
Baoyuantop merged 2 commits into
apache:masterfrom
Baoyuantop:fix-zipkin-trace-id

Conversation

@Baoyuantop

Copy link
Copy Markdown
Contributor

Description

According to Zipkin's documentation, the TraceID passed via HTTP headers uses lowercase hexadecimal encoding, not binary data. For example, the B3 specification states that the value of the X-B3-TraceId header is 16 or 32 lowercase hexadecimal characters (corresponding to 64 or 128 bits, respectively)

We need to convert the trace_id and span_id formats stored in the variables.

Which issue(s) this PR fixes:

Fixes #12271

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Jul 7, 2025
@Baoyuantop
Baoyuantop merged commit 068ea95 into apache:master Jul 11, 2025
21 of 23 checks passed
@Baoyuantop
Baoyuantop deleted the fix-zipkin-trace-id branch July 11, 2025 05:51
shreemaan-abhishek pushed a commit to shreemaan-abhishek/apisix that referenced this pull request Jan 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: zipkin plugin's traceId printed to accessLog are all escaped characters

4 participants