- Version 2.0
SkyWalking Cross Process Propagation Headers Protocol v2 is also named as sw6 protocol. This protocol keeps the same purposes of v1(a.k.a. sw3), which is keep context propagation works.
The major differences of v2 and v1, comes from SkyWalking's evolution, including
- Mesh and languages are not same always, some info in headers should be optional.
- BASE64 encoding required.
- Sampling flag is included.
- Header Name:
sw6
- Header Value: Split by
-
, the parts are following. The length of header value should be less than 2k(default).
Value format example, XXXXX-XXXXX-XXXX-XXXX
Values include the following segments, all String type values are in BASE64 encoding.
- Required(s)
- Sample. 0 or 1. 0 means context exists, but could(most likely will) ignore. 1 means this trace need to be sampled and send to backend.
- Trace Id. String(BASE64 encoded). Three Longs split by
.
to represent the unique id of this trace. - Parent trace segment Id. String(BASE64 encoded). Three Longs split by
.
to represent the unique id of parent segment in parent service. - Parent span Id. Integer. Begin with 0. This span id points to the parent span in parent trace segment.
- Parent service instance Id. Integer. The instance ID of parent service.
- Entrance service instance Id. Integer. The instance ID of the entrance service.
- Target address of this request. String(BASE64 encoded). The network address(not must be IP + port) used at client side to access this target
service. This value can use exchange/compress collector service to get the id(integer) to represent the string. If you use the string, it must start with
#
, others use integer directly.
- Optional(s)
Optional values could not exist if the agent/SDK haven't those info or the length of header is over the threshold(2k default).
- Entry endpoint of the trace. String(BASE64 encoded).
This value can use exchange/compress collector service to get the id(integer) to represent the string. If you use the string, it must start with
#
, others use integer directly. - Parent endpoint of the parent service. String(BASE64 encoded).
This value can use exchange/compress collector service to get the id(integer) to represent the string. If you use the string, it must start with
#
, others use integer directly.
- Short version,
1-TRACEID-SEGMENTID-3-5-2-IPPORT
- Complete version,
1-TRACEID-SEGMENTID-3-5-2-IPPORT-ENTRYURI-PARENTURI