Skip to Content
Deploy & ConfigureObservability (Langfuse)

Langfuse

Langfuse  is an open-source LLM observability platform. Harnesst ships with a built-in Langfuse callback that traces every agent run — model calls, tool invocations, token counts, latency, and cost — without any code changes.

What you get

  • Traces — per-message traces showing LLM calls, MCP tool calls, latencies, and token usage
  • Cost tracking — token and cost breakdowns per agent, user, or thread
  • Evaluation — score and annotate agent responses in the Langfuse UI
  • Prompt versioning — manage and compare system prompts across agents

Enable it

Open Settings → Observability as a workspace admin. Enter the Langfuse base URL, public key and secret key, choose the request timeout, then enable the integration. The keys are encrypted before they are stored in PostgreSQL.

Each agent run resolves the current workspace configuration and attaches a CallbackHandler to LangGraph invocations. The adapter propagates the thread’s session and user IDs throughout each run, including child model calls, so Langfuse can aggregate session costs. Configuration changes apply to new runs without restarting workers. Initialization failures are logged and agent execution continues without tracing.

The runtime accepts the provider-neutral RunTracing interface in app/integrations/tracing.py: callbacks, a context manager created for each run, and a shutdown flush. The Langfuse implementation lives in app/integrations/langfuse/. Another provider can implement the same interface and be selected in get_tracing() without changing the agent runtime. With no provider selected, the runtime uses empty callbacks and a no-op context.

Self-hosted Langfuse

Langfuse is itself open source. You can run it alongside Harnesst for full data ownership — follow the Langfuse self-hosting guide  and enter your instance URL under Settings → Observability.

Last updated on