Package brave

Class Tag<I>

    • Constructor Detail

      • Tag

        protected Tag​(String key)
        Since:
        5.11
    • Method Detail

      • key

        public final String key()
      • parseValue

        @Nullable
        protected abstract String parseValue​(I input,
                                             @Nullable
                                             TraceContext context)
        Override to change what data from the input are parsed into the span modeling it. Any exceptions will be logged and ignored.

        Note: Overrides of Tags.ERROR must return a valid value when {@param context} is null, even if that value is "" (empty string). Otherwise, error spans will not be marked as such.

        Returns:
        The result to add as a span tag. null means no tag will be added. Note: empty string is a valid tag value!
        Since:
        5.11
      • key

        protected String key​(I input)
        Overrides the tag key based on the input
      • tag

        public final void tag​(I input,
                              ScopedSpan span)
        Tags the value parsed from the input.
        Since:
        5.11
      • tag

        public final void tag​(I input,
                              Span span)
        Tags the value parsed from the input.
        Since:
        5.11
      • tag

        public final void tag​(I input,
                              @Nullable
                              TraceContext context,
                              SpanCustomizer span)
        Tags the value parsed from the input.
        Since:
        5.11
      • tag

        public final void tag​(I input,
                              SpanCustomizer span)
        Tags the value parsed from the input.
        Since:
        5.11
      • validateNonEmpty

        protected static String validateNonEmpty​(String label,
                                                 String value)