Package ai.acolite.agentsdk.core.tracing
package ai.acolite.agentsdk.core.tracing
Distributed tracing and observability for agent execution.
This package provides tracing infrastructure to monitor and debug agent execution:
TraceProvider- Global trace managementTrace- Trace context for tracking executionSpan- Individual operation trackingTraceProcessor- Interface for processing trace events
Example: Custom Trace Processor
// Register a custom trace processor
TraceProvider.getInstance().registerProcessor(new TraceProcessor() {
@Override
public void processTrace(Trace trace) {
System.out.println("Trace: " + trace.getId());
trace.getSpans().forEach(span ->
System.out.println(" Span: " + span.getName())
);
}
});
// Traces are automatically created during agent execution
Runner.run(agent, "Hello!");
OpenAI Platform Integration
Tracing data is automatically sent to the OpenAI platform for visualization when the
OPENAI_API_KEY environment variable is set.
- See Also:
-
ClassDescriptionSpan data for agent execution.BatchTraceProcessorConfiguration for BatchTraceProcessorConsoleSpanExporterSimple trace processor that prints to console.Span data for custom user-defined events.Span data for function/tool calls.Span data for LLM generation calls.Span data for guardrail checks.Span data for agent handoffs.MultiTracingProcessorNo-op span that does nothing.No-op trace that does nothing.No-op trace processor that does nothing.OpenAITraceExporterException indicating a retriable errorRetry configurationRepresents a timed operation within a trace.Base interface for all span data types.Error information captured in spans.Constant span type identifiers.Represents a single end-to-end workflow trace.TraceContextTraceContextStateTraceExporterProcessor for trace and span lifecycle events.TraceProviderTracingExporterTracingProcessorUtility functions for tracing.