Search in sources :

Example 1 with PropagatedTraceId

use of org.apache.skywalking.apm.agent.core.context.ids.PropagatedTraceId in project incubator-skywalking by apache.

the class ContextCarrier method deserialize.

/**
 * Initialize fields with the given text.
 *
 * @param text carries {@link #traceSegmentId} and {@link #spanId}, with '|' split.
 */
ContextCarrier deserialize(String text) {
    if (text != null) {
        String[] parts = text.split("\\|", 8);
        if (parts.length == 8) {
            try {
                this.traceSegmentId = new ID(parts[0]);
                this.spanId = Integer.parseInt(parts[1]);
                this.parentApplicationInstanceId = Integer.parseInt(parts[2]);
                this.entryApplicationInstanceId = Integer.parseInt(parts[3]);
                this.peerHost = parts[4];
                this.entryOperationName = parts[5];
                this.parentOperationName = parts[6];
                this.primaryDistributedTraceId = new PropagatedTraceId(parts[7]);
            } catch (NumberFormatException e) {
            }
        }
    }
    return this;
}
Also used : PropagatedTraceId(org.apache.skywalking.apm.agent.core.context.ids.PropagatedTraceId) ID(org.apache.skywalking.apm.agent.core.context.ids.ID)

Aggregations

ID (org.apache.skywalking.apm.agent.core.context.ids.ID)1 PropagatedTraceId (org.apache.skywalking.apm.agent.core.context.ids.PropagatedTraceId)1