Package com.google.genkit.core.tracing
Class SpanContext
java.lang.Object
com.google.genkit.core.tracing.SpanContext
SpanContext contains trace and span identifiers for distributed tracing.
-
Constructor Summary
ConstructorsConstructorDescriptionSpanContext(String traceId, String spanId, String parentSpanId) Creates a new SpanContext. -
Method Summary
Modifier and TypeMethodDescriptionReturns the parent span ID.Returns the span ID.Returns the trace ID.booleanReturns true if this span has a parent.toString()
-
Constructor Details
-
SpanContext
Creates a new SpanContext.- Parameters:
traceId- the trace IDspanId- the span IDparentSpanId- the parent span ID, may be null
-
-
Method Details
-
getTraceId
Returns the trace ID.- Returns:
- the trace ID
-
getSpanId
Returns the span ID.- Returns:
- the span ID
-
getParentSpanId
Returns the parent span ID.- Returns:
- the parent span ID, or null if this is a root span
-
hasParent
public boolean hasParent()Returns true if this span has a parent.- Returns:
- true if this span has a parent
-
toString
-