I'm trying to generate zipkin trace id from nginx in order to be able to trace from nginx to applications. To achieve this, I want to find out how to generate 16 random bytes to be used for X-B3-SpanId since $request_id generates 32 bytes (which can be used for X-B3-TraceId).
Asked
Active
Viewed 1,761 times
1 Answers
1
FYI, this worked after generating dummy X-B3-SpanId; it works as long as X-B3-TraceId is unique.
e.g.
map $http_x_b3_traceid $_request_id {
default $http_x_b3_traceid;
"" $request_id;
}
map $http_x_b3_spanid $_span_id {
default $http_x_b3_spanid;
"" "1111111111111111";
}

Thomas Lee
- 143
- 1
- 6