Class TraceparentFormat


  • public final class TraceparentFormat
    extends Object
    Implements ...
    • Method Detail

      • write

        public String write​(brave.propagation.TraceContext context)
        Writes all "traceparent" defined fields in the trace context to a hyphen delimited string.
      • writeAsBytes

        public byte[] writeAsBytes​(brave.propagation.TraceContext context)
        Like write(TraceContext), but for requests with byte array or byte buffer values. For example, ByteBuffer.wrap(byte[]) can wrap the result.
      • parse

        @Nullable
        public brave.propagation.TraceContext parse​(CharSequence parent)
      • parse

        @Nullable
        public brave.propagation.TraceContext parse​(CharSequence value,
                                                    int beginIndex,
                                                    int endIndex)
        This reads a trace context a sequence potentially larger than the format. The use-case is reducing garbage, by re-using the input value across multiple parse operations.
        Parameters:
        value - the sequence that contains a traceparent formatted trace context
        beginIndex - the inclusive begin index: index of the first character in traceparent format.
        endIndex - the exclusive end index: index after the last character in traceparent format.