Class: AgentTraceSpanProcessor
Restrict the direct MLflow provider to chat roots and their descendants. AppKit and Mastra create other OTel roots for cache and plugin operations; forwarding those would recreate the one-trace-per-request noise this path is intended to avoid.
Implements
Section titled “Implements”SpanProcessor
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AgentTraceSpanProcessor(
delegate):AgentTraceSpanProcessor
Parameters
Section titled “Parameters”delegate
Section titled “delegate”SpanProcessor
Returns
Section titled “Returns”AgentTraceSpanProcessor
Methods
Section titled “Methods”forceFlush()
Section titled “forceFlush()”forceFlush():
Promise<void>
Forces to export all finished spans
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”SpanProcessor.forceFlush
onEnd()
Section titled “onEnd()”onEnd(
span):void
Called when a ReadableSpan is ended, if the span.isRecording()
returns true.
Parameters
Section titled “Parameters”ReadableSpan
the Span that just ended.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”SpanProcessor.onEnd
onEnding()
Section titled “onEnding()”onEnding(
span):void
Experimental
Called when a Span is ending, if the span.isRecording()
returns true.
Parameters
Section titled “Parameters”Span
the Span that is ending.
This method is experimental and may break in minor versions of this package
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”SpanProcessor.onEnding
onStart()
Section titled “onStart()”onStart(
span,parentContext):void
Called when a Span is started, if the span.isRecording()
returns true.
Parameters
Section titled “Parameters”Span
the Span that just started.
parentContext
Section titled “parentContext”Context
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”SpanProcessor.onStart
shutdown()
Section titled “shutdown()”shutdown():
Promise<void>
Shuts down the processor. Called when SDK is shut down. This is an opportunity for processor to do any cleanup required.
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”SpanProcessor.shutdown