← [ BACK_TO_NOTES ]

Observability Engineering MOC

可观测性工程总入口,先建立 Logs、Metrics、Traces 与 SLI/SLO 的通用系统观测模型,再扩展到 Agent 的 token、cost、model/tool trace、RAG 质量与 Eval。

#moc #growing #ops #ai

[!info] related notes

Observability Engineering MOC

知识总览

filters:
  and:
    - 'file.ext == "md"'
    - 'file.inFolder("z")'
    - 'this.file.links.contains(file)'
    - 'file.path != this.file.path'
formulas:
  knowledge: 'file.asLink(title)'
properties:
  formula.knowledge:
    displayName: 知识
  note.description:
    displayName: Description
  note.mastery:
    displayName: Mastery
views:
  - type: table
    name: 知识总览
    order:
      - formula.knowledge
      - note.description
      - note.mastery
    columnSize:
      formula.knowledge: 280
      note.description: 760
      note.mastery: 56

[!abstract] 核心认识 可观测性不是“接了日志平台”,而是系统能否仅凭外部信号回答:发生了什么、影响多大、卡在哪里、为什么发生、是否正在恢复。Logs、Metrics、Traces 和业务/Agent 事件必须能通过共同标识关联。

一张图看信号

Request / Run ID
   ├─ Logs: discrete facts and context
   ├─ Metrics: trend, rate, saturation, SLO
   ├─ Traces: cross-service critical path
   └─ Events / Audit: state transitions and authority

推荐阅读顺序

  1. OpenTelemetry:统一上下文传播与信号模型。
  2. Trace:Span、parent/child、critical path。
  3. 日志、指标与告警:结构化字段、RED / USE、SLI / SLO。
  4. 服务请求延迟分层排查:用证据定位层级。
  5. AI 服务可观测性:token、TTFT、model/provider、tool、RAG、fallback。
  6. Agent Evals MOC:运行信号怎样进入质量回归与发布门槛。

通用 Backend 应观察什么

Request 层

  • request rate / error rate / latency percentile;
  • route、status、tenant、request ID;
  • queue time、connection pool wait、dependency latency。

Resource 层

  • CPU、memory、GC、file descriptor;
  • thread / event loop lag;
  • DB connections、cache hit rate;
  • queue depth / consumer lag;
  • disk、network、replication health。

Business 层

  • 注册、支付、任务完成等真正业务结果;
  • 不要用“HTTP 200”替代业务成功率。

Agent 应额外观察什么

环节关键证据
Modelmodel/provider、token、latency、TTFT、finish reason
Context来源、长度、截断、版本、污染与缺口
RAGquery、retrieved docs、score、rerank、citation
Toolname、validated args、permission、duration、result、side effect
RuntimeRun / Step / state transition / checkpoint / retry / interrupt
Qualitygrader、critical slice、abstain、fallback、human override
Costper-run / per-user / per-feature token 与外部调用成本

Observability 与 Eval 的边界

Observability
→ 真实运行发生了什么

Eval
→ 这个行为是否符合质量、安全和业务标准

Trace 可以成为 Eval 样本;Eval 结果也可以作为运行指标。但“记录完整”不代表“行为正确”。

分层排障顺序

Impact / SLO
→ request or run sample
→ trace critical path
→ logs at failing span
→ dependency and resource metrics
→ recent deploy/config/model change
→ hypothesis → verification → repair

避免从海量日志中无目标搜索。

中间件关键指标

Redis        → latency / hit rate / evictions / memory / replication lag
Kafka        → consumer lag / ISR / throughput / disk / rebalance
RabbitMQ     → ready / unacked / redelivery / confirms / consumer capacity
Elasticsearch→ heap / search latency / merge / rejected ops / unassigned shards
MinIO        → capacity / drive health / quorum / request latency / errors

掌握标准

  • 一个请求能跨前端、网关、后端、Agent 和数据库关联起来。
  • 指标使用可聚合维度,不把 user ID 等高基数字段无脑做 label。
  • 日志不泄露 token、密码、PII 和完整敏感 prompt。
  • 告警围绕用户影响和 SLO,而不是所有异常都报警。
  • Trace、Event、Checkpoint 和 Audit 的职责清楚。
创建于 2026/6/30 更新于 2026/9/4
Digital Biome
Access

键盘导航

j / k / ↑ / ↓
选择对象
Enter / o
打开选择
/ 或 Ctrl+K
全站搜索
i / f / 1–4
筛选当前列表
g → h / l / p / t / a
首页 / 笔记 / 项目 / 工具 / About
r → 1–9
打开所选对象的关联
u
返回上一页
Esc
关闭浮层 / 取消命令;输入框内清空文本