Aulafy
Courses/Local MLOps and model deployment/Observability with Langfuse and OpenTelemetry

Observability with Langfuse and OpenTelemetry

If a response goes wrong and you can't reconstruct which prompt, model, context, and tool were used, you don't have production—you have a black box with a pretty interface.

  • Record useful traces without leaking sensitive data.
  • Measure latency, errors, cost, and quality per route.
  • Use request_id to follow a complete request.

What to log

  • Technical identity: request_id, route, app version.
  • Model: provider, name, version, and parameters.
  • Performance: total latency, tokens, errors, and retries.
  • RAG: retrieved documents, not necessarily full text.
  • Quality: associated eval, feedback, and expected outcome.

Minimum event

TerminalCode
{
  "request_id": "req_20260703_001",
  "route": "/api/chat",
  "model": "local-qwen",
  "prompt_version": "support-v3",
  "latency_ms": 1840,
  "input_tokens": 620,
  "output_tokens": 210,
  "retrieved_docs": ["manual-001#p4", "faq-009#p1"],
  "error": null
}