Package com.azure.core.util.tracing
Class StartSpanOptions
- java.lang.Object
-
- com.azure.core.util.tracing.StartSpanOptions
-
public final class StartSpanOptions extends Object
Represents span options that are available before span starts and describe it.
-
-
Constructor Summary
Constructors Constructor Description StartSpanOptions(SpanKind kind)Describes span with given name and kind
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>getAttributes()Gets all attributes on span that should be set before span is started.SpanKindgetSpanKind()Gets span kind.StartSpanOptionssetAttribute(String key, Object value)Sets attribute on span before its started.
-
-
-
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:Stringintdoublebooleanlong- Arrays of the above
- Returns:
- this instance for chaining.
-
getSpanKind
public SpanKind getSpanKind()
Gets span kind.- Returns:
- span kind.
-
-