Traces & Database
Laddr supports flexible observability depending on the environment you’re running in.This guide explains how to plug in each supported backend — SQLite, PostgreSQL, and Langfuse — and how Laddr automatically chooses the tracing mode.
Overview
Laddr supports three tracing modes:-
SQLite Tracing (default)
Full local traces stored internally. Ideal for development. -
PostgreSQL Operational Mode
Used in production. Stores jobs, prompts, memory, batches — but disables trace storage. -
Langfuse Tracing (recommended for production)
External, scalable, full tracing UI + cost tracking.
Backend Selection Logic
Laddr picks the tracing backend using the following priority:1. Langfuse (if enabled & credentials set)You can always verify which backend is active:
2. SQLite Internal Tracing (if using SQLite)
3. Disabled (if using Postgres without Langfuse)
1. Using SQLite (Local Development)
SQLite is the default mode and requires no configuration.Why SQLite?
- Zero setup
- Full trace storage
- Best for development/debugging
- Laddr dashboard can show all traces locally
Enable
You don’t need to set anything — Laddr defaults to:Result
- Full tracing enabled automatically
- All traces visible in the
/tracesAPI and dashboard
2. Using PostgreSQL (Production Storage)
Use PostgreSQL for production deployments where multiple Laddr agents/services run.Why PostgreSQL?
- Durable storage for jobs, prompts, agent registry, batches, memory
- Supports horizontal scaling
- Suitable for multi-instance workloads
Important:
Trace storage is automatically disabled when using Postgres. Use Langfuse for production observability.
Enable
Result
- Job/prompt/memory data stored in Postgres
- Internal trace events are not written
- Laddr expects Langfuse for observability
3. Enabling Langfuse (Recommended)
Langfuse provides the richest observability experience:- Span tree visualization
- Prompt + token usage
- Cost tracking
- Filters & analytics
- Automatic LLM metadata aggregation
Install
Configure
Result
- Laddr stops writing traces to SQLite/Postgres
- All traces streamed to Langfuse
- Langfuse becomes the single tracing backend
4. Example Configurations
Below are realistic configurations for typical deployments.Local Development (SQLite + Tracing)
- Full trace logs stored in SQLite
- Inspect traces in dashboard or
/api/traces
Production Deployment (Postgres + Langfuse)
- Reliable operational data in Postgres
- Full observability in Langfuse
- No duplicate trace writes
Hybrid Cloud Environment (Local Tracing + Remote Postgres)
Useful when you’re running a local Laddr node but using a shared Postgres cluster.- Local tracing with SQLite
- Remote Postgres for persistent job/prompt data
5. Common Commands & Usage
Check tracing backend
Get traces (SQLite only)
View prompt execution traces (WebSocket)
Check metrics
6. Troubleshooting
Traces not appearing?
Check health:- You’re using Postgres → internal traces are disabled
- Langfuse credentials missing
LANGFUSE_ENABLED=truebut SDK not installedENABLE_TRACING=false
Langfuse not receiving spans?
Check:pip install langfuse- Valid public/secret keys
- Host reachable
- Runtime logs for connection issues
SQLite issues?
- File permission errors in Linux
- Wrong directory path
- Conflicts when running multiple processes
7. Best Practices
For Development
- Use SQLite
- Always keep internal tracing enabled
- Inspect traces in the dashboard frequently
- Use Langfuse selectively when debugging advanced workflows
For Production
- Use PostgreSQL
- Never rely on internal DB for tracing
- Always enable Langfuse
- Configure retention policies
- Track LLM & tool call latency in Langfuse
For Scaling
- Separate operational data (Postgres) from observability (Langfuse)
- Use container orchestration (Docker/Kubernetes)
- Distribute agents across workers but centralize your Postgres + Langfuse
Next Steps
- Storage & Artifacts - Configure artifact storage
- Scaling & Operations - Production deployment
- Local Runtime - Local development setup
- Agent Configuration - Configure agents