public class TraceContextHelper extends Object
CloudTraceContext.| Modifier and Type | Method and Description |
|---|---|
static com.google.apphosting.base.protos.TracePb.TraceContextProto |
parseTraceContextHeader(String traceContextHeader)
Create TraceContext from header, based on
C++ source.
|
public static com.google.apphosting.base.protos.TracePb.TraceContextProto parseTraceContextHeader(String traceContextHeader)
Examples of valid X-Cloud-Trace-Context headers:
000000000000007b00000000000001c8/789;o=1 (trace, span, and options) 000000000000007b00000000000001c8/789;o= (trace and span, empty options) 000000000000007b00000000000001c8/789 (trace and span, no options) 000000000000007b00000000000001c8/;o=1 (trace and options, empty span) 000000000000007b00000000000001c8/;o= (trace, empty span and options) 000000000000007b00000000000001c8/ (trace, empty span, no options) 000000000000007b00000000000001c8;o=1 (trace and options, no span) 000000000000007b00000000000001c8;o= (trace, empty options, no span) 000000000000007b00000000000001c8 (trace, no span, no options)
traceContextHeader - a String representing the "X-Cloud-Trace-Context" which has the form
"TRACE_ID/SPAN_ID;o=TRACE_TRUE" where TRACE_TRUE = 0 or 1. See
this link
for details.NumberFormatException - if the trace id is less than 32 characters, or the trace mask or
span id are not numerical valuesCopyright © 2022. All rights reserved.