Skip to main content

Overview

Basalt’s observability system gives you end-to-end visibility into your AI workloads—from HTTP handlers and background jobs down to prompts, LLM calls, tools, and evaluators. It is built on OpenTelemetry and centered on two primitives:
  • start_observe – creates root spans that represent entire requests or workflows
  • observe – creates child spans for nested operations (LLM calls, RAG, tools, etc.)

Major v1 changes

  • Unified observe / start_observe API for tracing, logging, and context
  • Full OpenTelemetry support with automatic context propagation (sync and async)
  • Auto-instrumentation for LLMs, vector DBs, and popular frameworks
  • First-class identity, experiments, and evaluators attached to traces
  • Consistent APIs for sync and async functions (same decorators / context managers)

Root spans with start_observe

Every trace starts with a root span created by start_observe. Use this at the entry points of your system (HTTP handlers, workers, CLI commands).
All spans created under this root automatically share identity, experiment, and context.

Nested spans with observe

Use observe to create child spans that describe meaningful units of work:
  • LLM generations
  • Retrieval / RAG
  • Tool and function execution
  • Generic business logic
Kinds (ObserveKind.GENERATION, RETRIEVAL, TOOL, etc.) make traces easier to explore and filter in the Basalt UI.

Enriching spans

You can attach additional information to the current active span using static helpers:
  • observe.set_identity(...) – set or update user/org identity
  • observe.metadata(...) / observe.update_metadata(...) – add metadata
  • observe.set_input(...) / observe.set_output(...) – capture inputs/outputs

Async monitoring

The same decorators work for async functions. For advanced use, explicit async variants async_start_observe and async_observe are also available.
Basalt automatically propagates trace context across async boundaries, so all spans end up in the same trace.

Client Initialization

Basic initialization

The simplest way to initialize Basalt:

With observability metadata

Attach global metadata that will be added to all traces:

With telemetry configuration

For advanced configuration of OpenTelemetry behavior and auto-instrumentation:

With selective auto-instrumentation

Enable or disable auto-instrumentation providers:

Shutdown

Always call shutdown() before your application exits to flush pending telemetry:

TelemetryConfig Reference

Supported providers for enabled_providers/disabled_providers:
  • LLMs: openai, anthropic, google_generativeai, bedrock, vertexai, ollama, mistralai, together, replicate
  • Vector DBs: chromadb, pinecone, qdrant
  • Frameworks: langchain, llamaindex, haystack

Environment Variables

You can also configure Basalt using environment variables: Use the Concepts, Patterns, and Workflows pages for deeper guidance, and the API Reference for the full Python surface area.