Class TraceManager
java.lang.Object
com.google.adk.plugins.agentanalytics.TraceManager
Manages OpenTelemetry-style trace and span context using InvocationContext callback data.
Uses a stack of SpanRecord objects to keep span, ID, ownership, and timing in sync.
-
Method Summary
Modifier and TypeMethodDescriptionvoidvoidensureInvocationSpan(InvocationContext context) com.google.adk.plugins.agentanalytics.TraceManager.SpanIdsgetFirstTokenTime(String spanId) getStartTime(String spanId) getTraceId(InvocationContext context) booleanvoidinitTrace(InvocationContext context) Optional<com.google.adk.plugins.agentanalytics.TraceManager.RecordData> popSpan()voidrecordFirstToken(String spanId)
-
Method Details
-
getRootAgentName
-
initTrace
-
getTraceId
-
hasAmbientSpan
public boolean hasAmbientSpan() -
pushSpan
-
attachCurrentSpan
-
ensureInvocationSpan
-
popSpan
@CanIgnoreReturnValue public Optional<com.google.adk.plugins.agentanalytics.TraceManager.RecordData> popSpan() -
clearStack
public void clearStack() -
getCurrentSpanAndParent
public com.google.adk.plugins.agentanalytics.TraceManager.SpanIds getCurrentSpanAndParent() -
getCurrentSpanId
-
recordFirstToken
-
getStartTime
-
getFirstTokenTime
-