Package com.azure.core.util.tracing
Class StartSpanOptions
java.lang.Object
com.azure.core.util.tracing.StartSpanOptions
Represents span options that are available before span starts and describe it.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddLink
(TracingLink link) Add link to span.Gets all attributes on span that should be set before span is started.getLinks()
Gets links to be set on span.Gets remote parent.Gets span kind.Gets span start time.setAttribute
(String key, Object value) Sets attribute on span before its started.setRemoteParent
(Context parent) Sets remote parent context.setStartTimestamp
(Instant timestamp) Sets span start timestamp.
-
Constructor Details
-
StartSpanOptions
Create start options with given kind- Parameters:
kind
- The kind of the span to be created.
-
-
Method Details
-
setAttribute
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. OpenTelemetry implementation supports following types:String
int
double
boolean
long
- Arrays of the above
- Returns:
- this instance for chaining.
-
setStartTimestamp
Sets span start timestamp. This is optional and used to record past spans. If not set, uses current time.- Parameters:
timestamp
- span start time.- Returns:
- this instance for chaining.
-
getStartTimestamp
Gets span start time.- Returns:
- start timestamp.
-
setRemoteParent
Sets remote parent context.- Parameters:
parent
- context with remote span context.- Returns:
- this instance for chaining.
-
getRemoteParent
Gets remote parent.- Returns:
- context with remote parent span context on it.
-
addLink
Add link to span.- Parameters:
link
- link.- Returns:
- this instance for chaining.
-
getSpanKind
Gets span kind.- Returns:
- span kind.
-
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.
-
getLinks
Gets links to be set on span.- Returns:
- list of links.
-