StartSpanOptions Class
- java.
lang. Object - com.
azure. core. util. tracing. StartSpanOptions
- com.
public final class StartSpanOptions
Represents span options that are available before span starts and describe it.
Constructor Summary
Constructor | Description |
---|---|
StartSpanOptions(SpanKind kind) |
Create start options with given kind |
Method Summary
Modifier and Type | Method and Description |
---|---|
Start |
addLink(TracingLink link)
Add link to span. |
Map<String,Object> |
getAttributes()
Gets all attributes on span that should be set before span is started. |
List<Tracing |
getLinks()
Gets links to be set on span. |
Context |
getRemoteParent()
Gets remote parent. |
Span |
getSpanKind()
Gets span kind. |
Instant |
getStartTimestamp()
Gets span start time. |
Start |
setAttribute(String key, Object value)
Sets attribute on span before its started. |
Start |
setRemoteParent(Context parent)
Sets remote parent context. |
Start |
setStartTimestamp(Instant timestamp)
Sets span start timestamp. |
Methods inherited from java.lang.Object
Constructor Details
StartSpanOptions
public StartSpanOptions(SpanKind kind)
Create start options with given kind
Parameters:
Method Details
addLink
public StartSpanOptions addLink(TracingLink link)
Add link to span.
Parameters:
Returns:
getAttributes
public Map
Gets all attributes on span that should be set before span is started.
Returns:
getLinks
public List
Gets links to be set on span.
Returns:
getRemoteParent
public Context getRemoteParent()
Gets remote parent.
Returns:
getSpanKind
public SpanKind getSpanKind()
Gets span kind.
Returns:
getStartTimestamp
public Instant getStartTimestamp()
Gets span start time.
Returns:
setAttribute
public StartSpanOptions setAttribute(String key, Object value)
Sets attribute on span before its started. Such attributes may affect sampling decision. Adding duplicate attributes, update, or removal is discouraged, since underlying implementations behavior can vary.
Parameters:
- String
int
double
boolean
long
- Arrays of the above
Returns:
setRemoteParent
public StartSpanOptions setRemoteParent(Context parent)
Sets remote parent context.
Parameters:
Returns:
setStartTimestamp
public StartSpanOptions setStartTimestamp(Instant timestamp)
Sets span start timestamp. This is optional and used to record past spans. If not set, uses current time.
Parameters:
Returns:
Applies to
Azure SDK for Java