Skip to content

Interface: BuildObservabilityOptions

optional enabled?: boolean

Whether to wire the Mastra OtelBridge. Mirrors MastraPluginConfig.observability:

  • undefined (auto): on only when OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_EXPORTER_OTLP_TRACES_ENDPOINT is set (same signal AppKit’s TelemetryManager uses to register a real tracer). When unset, skip the bridge entirely so Mastra does not emit [OtelBridge] No OTEL span found warnings on the noop tracer.
  • true: force on even without an OTLP endpoint.
  • false: force off.

optional requestContextKeys?: readonly string[]

RequestContext keys to extract as span metadata on every Mastra trace. Defaults to TRACE_REQUEST_CONTEXT_KEYS (user id, thread id, request id, environment, model override, …).

Supports dot notation for nested values per the Mastra docs.


optional serviceName?: string

Service name attached to the Mastra Observability config. Used as the tracer scope name on bridged OTel spans (the service.name resource attribute is owned by AppKit’s TelemetryManager instead

  • it reads OTEL_SERVICE_NAME / DATABRICKS_APP_NAME at createApp time).

Defaults to project name then "mastra".