Skip to content

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.

  • SpanProcessor

new AgentTraceSpanProcessor(delegate): AgentTraceSpanProcessor

SpanProcessor

AgentTraceSpanProcessor

forceFlush(): Promise<void>

Forces to export all finished spans

Promise<void>

SpanProcessor.forceFlush


onEnd(span): void

Called when a ReadableSpan is ended, if the span.isRecording() returns true.

ReadableSpan

the Span that just ended.

void

SpanProcessor.onEnd


onEnding(span): void

Experimental

Called when a Span is ending, if the span.isRecording() returns true.

Span

the Span that is ending.

This method is experimental and may break in minor versions of this package

void

SpanProcessor.onEnding


onStart(span, parentContext): void

Called when a Span is started, if the span.isRecording() returns true.

Span

the Span that just started.

Context

void

SpanProcessor.onStart


shutdown(): Promise<void>

Shuts down the processor. Called when SDK is shut down. This is an opportunity for processor to do any cleanup required.

Promise<void>

SpanProcessor.shutdown