Tracer
interface Tracer
Observability hook surface called by com.mojentic.llm.LlmBroker and the tool runners.
Every method has a no-op default so implementations only override what they care about. NullTracer inherits all defaults; TracerSystem forwards every call to its EventStore.
Methods are suspend because TracerSystem performs a Mutex-protected append; the broker calls every recorder from a suspend context so this imposes no extra burden.
Correlation IDs are opaque strings (UUID-shaped by convention) so the public surface does not depend on still-experimental kotlin.uuid.Uuid.
Inheritors
Functions
Link copied to clipboard
Link copied to clipboard
open suspend fun recordLlmCall(model: String, messages: List<LlmMessage>, temperature: Double, tools: List<String>?, correlationId: String?)
Link copied to clipboard
open suspend fun recordLlmResponse(model: String, content: String?, toolCalls: List<LlmToolCall>?, callDuration: Duration, correlationId: String?, usage: JsonObject? = null, providerModel: String? = null, finishReason: String? = null, metadata: JsonObject? = null)
Link copied to clipboard
open suspend fun recordToolBatch(batchId: String, toolNames: List<String>, successCount: Int, failureCount: Int, callDuration: Duration, correlationId: String?, caller: String? = null)
Emitted once per parallel tool batch in addition to the per-call recordToolCall events. Serial runners do not emit batch events.
Link copied to clipboard