← Back to AI Infrastructure Mind Map
🖥️ AI InfrastructureID: monitoring-observability

Monitoring & Observability

监控与可观测性
🎯Core Definition
LLM serving monitoring has three layers: ① system-level metrics — latency (P50/P95/P99), throughput (QPS, tokens/sec), error rate (4xx/5xx and timeouts), GPU utilization, KV-cache hit rate and queue depth; ② token-level metrics — TTFT (time to first token, from request arrival to the first returned token) and TPOT (time per output token), with total latency T=TTFT+TPOT×(N−1)T = TTFT + TPOT \times (N-1) where TPOT=TdecodeN−1TPOT = \frac{T_{\text{decode}}}{N-1}; ③ logs & traces — recording requests/responses, parameters and tool-call chains as distributed traces, so one multi-turn conversation is one queryable trace; ④ alerting & RCA — tiered alerts tied to an SLO budget, tracing anomalies back to the input side (very long prompts), serving side (queuing, OOM, autoscaling) or model side (degraded outputs).
💡Use Cases
day-to-day stability and incident response for production LLM services; interviews ask how to measure and optimize TTFT/TPOT, why P99 matters more than average latency, and how to localize a bottleneck under a QPS spike.
⚡Key Problems Solved
a black box only says “it got slower”, observability says where: a high TTFT points at prefill or queuing, a high TPOT at decode-side bandwidth/compute limits; averages hide long tails that P99 exposes (huge prompts, imbalanced batches); traces stitch multi-replica, multi-service, multi-tool-call chains together, cutting root-cause time from hours to minutes and supplying the data behind rate limiting, autoscaling and SLO decisions.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of Monitoring & Observability.
Use Cases
In production engineering, what are the primary use cases for Monitoring & Observability and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
What do TTFT and TPOT measure and how do they interact? How is T=TTFT+TPOT×(N−1)T = TTFT + TPOT \times (N-1) used?
2
Why track P99 latency instead of the average? Where do tail requests come from in LLM serving?
3
Under a QPS spike, how do traces separate input-side, serving-side and model-side bottlenecks?
4
How to set SLOs and alerts? How to design thresholds and severity tiers for error rate and latency?
5
How do serving-side metrics — KV-cache hit rate, GPU utilization, queue depth — drive scaling decisions?
Updated 2026-08-12
🎯
Verify Mastery: Practice Exam Questions for "Monitoring & Observability"
Take pitfall multiple-choice questions with derivation options; mistakes are automatically logged.
🚀 Start Card Practice ➔
← Previous CardModel Testing & GatesNext Card →Security & Privacy

🔗 More AI Infrastructure Knowledge Cards

引用出处: TalentMe 450+ 工业级 AI 架构考点知识库 (Tech Vault) · 遵循 CC-BY-4.0 知识共享协议
URL: https://talentme.airsota.com/resources/tech/roadmap/mindmap/AI_Infra/card/monitoring-observability
中文速览与面试要点

监控与可观测性 (Monitoring & Observability)

定义: LLM 服务监控分三层: ① 系统级指标——延迟(P50/P95/P99)、吞吐(QPS、tokens/sec)、错误率(4xx/5xx 与超时)、GPU 利用率、KV cache 命中率与排队长度;② Token 级指标——TTFT(Time To First Token,请求发出到首个 token 返回的时间)与 TPOT(Time Per Output Token,单个 token 的生成耗时),总延迟 T = TTFT + TPOT (N-1),其中 TPOT = T_ decodeN-1(解码总耗时除以生成的 token 数);③ 日志与 trace——记录请求/响应、参数、工具调用链路的分布式追踪,把一次多跳对话串成一条完整 trace,支撑按请求维度定位;④ 告警与根因分析——围绕 SLO 预算设置分级告警,异常时沿 trace 区分输入侧(超长 prompt)、服务侧(排队、显存 OOM、pod 扩容)还是模型侧(输出退化)。 使用场景: 线上推理服务的日常稳定性保障与故障排查;面试常问 TTFT/TPOT 如何测量与优化、为什么看 P99 而不是平均延迟、QPS 突增时如何定位瓶颈。 解决的问题: 黑盒只能告诉你“变慢了”,可观测性告诉你“慢在哪一段”——TTFT 高指向 prefill 或排队,TPOT 高指向 decode 的带宽/算力瓶颈;平均延迟会被长尾请求稀释,P99 才能暴露超长 prompt 或批次不均造成的体验问题;trace 把多副本、多服务、多次工具调用的调用链串起来,根因定位从小时级缩短到分钟级,为限流、扩容、SLO 赔付提供数据支撑。

核心要点

  • TTFT 和 TPOT 各衡量什么、互相怎么影响?总延迟公式 T = TTFT + TPOT (N-1) 如何使用?
  • 为什么监控延迟要看 P99 而不是平均值?LLM 服务的长尾请求来自哪里?
  • QPS 突增时,如何用 trace 区分输入侧/服务侧/模型侧瓶颈?
  • SLO 与告警怎么设?错误率、延迟告警的阈值与分级如何设计?
  • KV cache 命中率、GPU 利用率、排队长度这些服务侧指标如何指导扩缩容?