Observability

Production LLM Observability Stack

Full-stack observability architecture tracking telemetry across the four pillars of enterprise GenAI: Operational Metrics, Cost, Quality, and Security.

By Bhavin Mistry, Senior Engineering Manager at Commonwealth Bank Published: 2026-08-18 Last updated: 2026-09-24 10 min read
Table of Contents (9 sections)
SYSTEM TOPOLOGY & DATA FLOW ENTERPRISE SPECIFICATION
Client Application RBAC Context Security & Gateway PII Sanitization Semantic Cache Check Rate & Token Budget Inference & Rerank BM25 + Vector Fusion Cross-Encoder Top-5 Grounded Synthesis Telemetry OpenTelemetry

The Core Problem Solved

Traditional APM tools (Datadog/NewRelic) monitor CPU, memory, and HTTP 500s, but fail to detect hallucinations, prompt drift, token bloat, or gradual accuracy decay.

When To Deploy This Architecture

All production LLM applications where reliability, customer trust, and financial predictability are vital.

Architectural Components

  • OpenTelemetry Instrumentation for GenAI
  • Trace Collector & Session Replay
  • Asynchronous Eval Worker (Sampling production traces for LLM-as-a-judge checks)
  • Drift & Anomaly Detector (Embedding cluster shift tracking)
  • Cost & Quota Attribution Ledger

Data Flow Narrative

Application Request -> OpenTelemetry Span Capture -> Async Kafka / SQS Queue -> Observability Backend (Langfuse / OpenLIT) -> Async Eval Engine -> Alerting Webhooks.

Security & Perimeter Control

Automatic client-side hashing and redaction of PII before trace serialization into telemetry stores.

Governance & Telemetry

Provides compliance records demonstrating SLA compliance, uptime, and factual accuracy metrics over time.

Identified Failure Modes & Mitigations

Telemetry queue backpressure during traffic spikes; sampling bias hiding rare catastrophic hallucination failures.

Production Code Implementation

Copy-paste ready implementation snippet demonstrating the core architectural boundary logic:

otel_genai_instrumentation.py
# OpenTelemetry GenAI Span Instrumentation & FinOps Telemetry
from opentelemetry import trace

tracer = trace.get_tracer("enterprise.genai.telemetry")

def trace_llm_call(prompt: str, model_id: str, team_id: str):
    with tracer.start_as_current_span("genai.chat.completion") as span:
        span.set_attribute("genai.system", "aws-bedrock")
        span.set_attribute("genai.request.model", model_id)
        span.set_attribute("enterprise.cost_center", team_id)
        
        response = invoke_bedrock(prompt=prompt, model=model_id)
        
        span.set_attribute("genai.usage.prompt_tokens", response.prompt_tokens)
        span.set_attribute("genai.usage.completion_tokens", response.completion_tokens)
        span.set_attribute("enterprise.cost_usd", compute_usd(model_id, response))
        
        # Dispatch trace asynchronously to continuous evaluation queue
        eval_queue.enqueue(span.get_span_context().trace_id, prompt, response.text)
        return response.text
Architectural Q&A

Frequently Asked Questions

Why can't traditional APM tools monitor enterprise LLM applications?
APM tools monitor HTTP status codes and CPU memory, but cannot detect semantic drift, hallucinated citations, prompt bloat, jailbreak exploits, or gradual accuracy decay in production.
What are the four pillars of enterprise LLM observability?
1) Operational Telemetry (latency, throughput, errors); 2) Financial FinOps (cost attribution, token unit economics); 3) Quality & Faithfulness (groundedness, hallucinations); 4) Security & Risk (prompt injections, PII leakage).
Engineering Resource

The Enterprise AI Production Checklist

A rigorous 50-point engineering, security, and FinOps verification gate before promoting Generative AI and Agentic systems to live enterprise traffic.

Zero spam. Fortnightly dispatches. Unsubscribe anytime.
Author & Engineering Leader

Bhavin Mistry

Senior Engineering Manager at Commonwealth Bank based in Melbourne, Australia. Focusing on enterprise AI architecture, hybrid RAG, agentic reliability, and technology economics.

Connected Tools & Frameworks

Cross-Referenced Production Resources

Methodology

5-Stage Maturity Framework

Stage gates from exploration to hardened multi-region deployment.

Assessment

AI Readiness Diagnostic

Benchmark organizational readiness across 12 operational dimensions.

FinOps

RAG Cost Calculator

Model vector storage, query volume, and caching ROI accurately.