Class StartSpanOptions


  • public final class StartSpanOptions
    extends Object
    Represents span options that are available before span starts and describe it.
    • Constructor Detail

      • StartSpanOptions

        public StartSpanOptions​(SpanKind kind)
        Describes span with given name and kind
        Parameters:
        kind - The kind of the span to be created.
    • Method Detail

      • setAttribute

        public StartSpanOptions setAttribute​(String key,
                                             Object value)
        Sets attribute on span before its started. Such attributes may affect sampling decision.
        Parameters:
        key - attribute key.
        value - attribute value. Note that underlying tracer implementations limit supported value types:
        • String
        • int
        • double
        • boolean
        • long
        • Arrays of the above
        Returns:
        this instance for chaining.
      • getSpanKind

        public SpanKind getSpanKind()
        Gets span kind.
        Returns:
        span kind.
      • getAttributes

        public Map<String,​Object> getAttributes()
        Gets all attributes on span that should be set before span is started.
        Returns:
        attributes to be set on span and used for sampling.