Tracing

org.llm4s.trace.Tracing
See theTracing companion trait
object Tracing

Factory for creating Tracing instances.

// From TracingSettings: falls back to NoOp, with an error logged, if the backend is missing
val tracing = Tracing.create(settings)

// The same, but a missing or failing backend is an error the caller sees
val checked: Result[Tracing] = Tracing.fromSettings(settings)

// Direct instantiation
val console = new ConsoleTracing()
val noop = new NoOpTracing()

Attributes

See also

TracingMode for available modes

org.llm4s.trace.spi.TracingBackend for adding a backend

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Tracing.type

Members list

Value members

Concrete methods

def create(settings: TracingSettings): Tracing

Create a tracing instance from configuration settings.

Create a tracing instance from configuration settings.

Never fails: when the configured backend is not on the classpath, or cannot start, this logs the reason at error level and returns a NoOpTracing, so a tracing problem cannot stop the application. Use fromSettings to see the error instead.

Value parameters

settings

Tracing configuration including mode and backend-specific options

Attributes

Returns

Configured tracing instance, or NoOpTracing

Builds the tracer settings select, reporting a missing or failing backend as an error.

Builds the tracer settings select, reporting a missing or failing backend as an error.

NoOp and Console are built directly; Console reads captureContent from the extras (llm4s.tracing.console), and a value other than true or false is a org.llm4s.error.ConfigurationError. Any other mode is dispatched to the org.llm4s.trace.spi.TracingBackend discovered for it on the classpath.

Attributes

Returns

the tracer, or a org.llm4s.error.ConfigurationError when no backend is registered for the mode - naming the llm4s module to add for langfuse (llm4s-observability) and opentelemetry (llm4s-observability-otel) - or the backend's own error when it cannot start

As fromSettings, dispatching to backends rather than to what is discovered - for an explicitly registered backend, or a shaded jar whose services files did not survive.

As fromSettings, dispatching to backends rather than to what is discovered - for an explicitly registered backend, or a shaded jar whose services files did not survive.

Attributes