agentsclimarketplace

Observability

Skill dongliutony/myagent-skill/skills/observability

构建可观测性系统 — OTEL 追踪、结构化日志、指标体系、事件采样、会话重放From its SKILL.md

Install
npx -y skills add dongliutony/myagent-skill --skill observability

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

1.5 KB, as published. Nobody here has run it

可观测性设计

你在解决什么问题

让团队能回答:哪个 prompt 最差?哪个工具最慢?token 花在哪?用户在哪步退出?

参考实现 Snippets

  • snippets/observability/dual-sink-analytics.ts — 双写管线 + OTEL + 采样 + 隐私 + 指标定义

设计检查清单

  • 双写管线:第一方 + 外部服务
  • 事件队列缓冲(初始化前不丢失)
  • 数据安全标记强制(VERIFIED_NOT_CODE)
  • 用户隐私:SHA256 哈希分 30 桶
  • 基数缩减:模型名标准化、版本截断
  • 动态事件采样(Feature Flag 下发)
  • OTEL:traces + metrics + logs
  • 会话追踪:包装 API 调用为 span
  • 指标:session/cost/token/loc/tool_duration
  • Cache 失效检测追踪

必须跟踪的指标

维度指标
成本costUSD per model
Tokeninput/output/cacheRead/cacheWrite
延迟API duration (with/without retries)
工具tool duration + count
权限approve/reject count
缓存cacheBreak events + diff

常见错误

错误后果正确做法
无安全标记泄露代码强制 VERIFIED
记录原始 ID隐私违规哈希分桶
100% 采样成本高动态采样
初始化前丢事件缺启动数据队列缓冲

Keep looking

Skills are one crate of 607,533. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.