Module brave
Package brave

Class CurrentSpanCustomizer

  • All Implemented Interfaces:
    SpanCustomizer

    public final class CurrentSpanCustomizer
    extends java.lang.Object
    implements SpanCustomizer
    Provides a mechanism for end users to be able to customise the current span.

    Handles the case of there being no current span in scope.

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      SpanCustomizer annotate​(java.lang.String value)
      Associates an event that explains latency with the current system time.
      static CurrentSpanCustomizer create​(Tracing tracing)
      Creates a span customizer that will affect the current span in scope if present
      SpanCustomizer name​(java.lang.String name)
      Sets the string name for the logical operation this span represents.
      SpanCustomizer tag​(java.lang.String key, java.lang.String value)
      Tags give your span context for search, viewing and analysis.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • create

        public static CurrentSpanCustomizer create​(Tracing tracing)
        Creates a span customizer that will affect the current span in scope if present
      • name

        public SpanCustomizer name​(java.lang.String name)
        Sets the string name for the logical operation this span represents.
        Specified by:
        name in interface SpanCustomizer
      • tag

        public SpanCustomizer tag​(java.lang.String key,
                                  java.lang.String value)
        Tags give your span context for search, viewing and analysis. For example, a key "your_app.version" would let you lookup spans by version. A tag "sql.query" isn't searchable, but it can help in debugging when viewing a trace.
        Specified by:
        tag in interface SpanCustomizer
        Parameters:
        key - Name used to lookup spans, such as "your_app.version".
        value - String value, cannot be null.
      • annotate

        public SpanCustomizer annotate​(java.lang.String value)
        Associates an event that explains latency with the current system time.
        Specified by:
        annotate in interface SpanCustomizer
        Parameters:
        value - A short tag indicating the event, like "finagle.retry"