自动获取 Opik 追踪数据,分析使用量和成本,发送报告到 Discord
创建定时任务,每小时发送一次报告:
openclaw cron add \
--name "opik-reporter" \
--cron "0 * * * *" \
--tz "Asia/Shanghai" \
--session isolated \
--wake now \
--deliver \
--message "运行 opik-reporter: 获取 Opik 追踪数据,生成报告。报告格式用中文。"
node /Users/xufan65/.openclaw/workspace/skills/opik-reporter/scripts/reporter.cjs
功能:
📊 Opik 追踪报告
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
时间范围: 最近 1 小时
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📈 使用量统计
总请求数: 15
成功率: 93.3%
Token 使用:
输入: 12,345
输出: 6,789
总计: 19,134
成本:
总计: $0.05
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔧 工具调用
总调用: 45 次
最常用:
• web_search (15次)
• read (12次)
• exec (10次)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
❌ 错误 (1个)
• timeout in deals-morning (2分钟前)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💡 优化建议
1. deals-morning 超时,建议增加超时时间
config/settings.json{
"opik": {
"apiKey": "I5xMCUAO14m4EyckFWfqQla3O",
"workspace": "default",
"project": "openclaw"
},
"discord": {
"channel": "discord",
"to": "channel:1481801666851373138"
},
"reportSchedule": {
"hourly": true,
"daily": true,
"onError": true
}
}
🚀 让你的 Opik 追踪数据更加可视化和可操作!
共 1 个版本