Package ai.acolite.agentsdk.core.tracing
Class NoopTraceProcessor
java.lang.Object
ai.acolite.agentsdk.core.tracing.NoopTraceProcessor
- All Implemented Interfaces:
TraceProcessor,AutoCloseable
No-op trace processor that does nothing.
Used when tracing is disabled to avoid conditional checks throughout the codebase. All methods are no-ops.
Singleton pattern for efficiency.
Ported from TypeScript OpenAI Agents SDK Source: tracing/processor.ts
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()AutoCloseable implementation.Flush all pending traces/spans.voidCalled when a span ends.voidonSpanStart(Span<?> span) Called when a span starts.voidonTraceEnd(Trace trace) Called when a trace ends.voidonTraceStart(Trace trace) Called when a trace starts.shutdown(long timeoutMs) Shutdown the processor gracefully.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ai.acolite.agentsdk.core.tracing.TraceProcessor
shutdown
-
Field Details
-
INSTANCE
Singleton instance
-
-
Method Details
-
onTraceStart
Description copied from interface:TraceProcessorCalled when a trace starts. Processors can export the trace immediately or buffer it.- Specified by:
onTraceStartin interfaceTraceProcessor
-
onTraceEnd
Description copied from interface:TraceProcessorCalled when a trace ends.- Specified by:
onTraceEndin interfaceTraceProcessor
-
onSpanStart
Description copied from interface:TraceProcessorCalled when a span starts.- Specified by:
onSpanStartin interfaceTraceProcessor
-
onSpanEnd
Description copied from interface:TraceProcessorCalled when a span ends. Most processors export spans on end to capture complete data.- Specified by:
onSpanEndin interfaceTraceProcessor
-
forceFlush
Description copied from interface:TraceProcessorFlush all pending traces/spans. Blocks until all data is exported.- Specified by:
forceFlushin interfaceTraceProcessor
-
shutdown
Description copied from interface:TraceProcessorShutdown the processor gracefully. Flushes pending data and releases resources.- Specified by:
shutdownin interfaceTraceProcessor- Parameters:
timeoutMs- Maximum time to wait for shutdown (milliseconds)
-
close
public void close()Description copied from interface:TraceProcessorAutoCloseable implementation. Calls shutdown() and blocks.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceTraceProcessor
-