Skip to content

Commit ffe3cdb

Browse files
JavaLyHnclaude
andcommitted
docs(grafana): 全部看板中文化 + 每面板加说明 + 顶部「看板说明」面板
让 Grafana 对非技术也通俗易懂: - 5 个看板(m2b/m2c/m3/cost/admin-ops)全部面板标题中文化 - 每个指标面板加 description(ⓘ 悬停说明:含义/怎么读/正常范围) - 每个看板顶部插一块 markdown 文本面板(看板用途 + 术语表:QPS/p95/RRF/ 自评/CRAG/VLM 等) - 看板级 description 同步 live 验证:provisioning 30s 重载后,API 取回标题已为中文、描述齐全、 顶部说明面板就位(m2b/m2c/cost 抽查通过)。纯 infra,不动 App/后端。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 81c1f1f commit ffe3cdb

5 files changed

Lines changed: 685 additions & 139 deletions

File tree

‎infra/grafana/dashboards/admin-ops.json‎

Lines changed: 90 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,126 @@
44
"schemaVersion": 38,
55
"version": 1,
66
"refresh": "30s",
7-
"time": {"from": "now-6h", "to": "now"},
8-
"tags": ["raguide", "admin", "kb", "profile"],
7+
"time": {
8+
"from": "now-6h",
9+
"to": "now"
10+
},
11+
"tags": [
12+
"raguide",
13+
"admin",
14+
"kb",
15+
"profile"
16+
],
917
"panels": [
18+
{
19+
"id": 100,
20+
"type": "text",
21+
"title": "",
22+
"gridPos": {
23+
"x": 0,
24+
"y": 0,
25+
"w": 24,
26+
"h": 5
27+
},
28+
"options": {
29+
"mode": "markdown",
30+
"content": "## 🛠️ 业主运营动作\n看**业主侧操作的健康度**:知识库摄入/删除、跨会话用户画像更新的成功率。\n\n`ingest`=在线摄入商品(表单/PDF) · `profile update`=每轮对话后更新用户画像 · result=ok/failed/skip/error。error 持续 >0 需排查。"
31+
},
32+
"transparent": true
33+
},
1034
{
1135
"id": 1,
1236
"type": "timeseries",
1337
"title": "1. KB 摄入结果 (ok | failed)",
1438
"description": "raguide_kb_ingest_total —— 业主在线摄入(表单/PDF)的成功与失败速率。failed 持续>0 需查 ingestion_runs.error_log。",
15-
"datasource": {"type": "prometheus", "uid": "prometheus"},
16-
"gridPos": {"x": 0, "y": 0, "w": 12, "h": 8},
39+
"datasource": {
40+
"type": "prometheus",
41+
"uid": "prometheus"
42+
},
43+
"gridPos": {
44+
"x": 0,
45+
"y": 5,
46+
"w": 12,
47+
"h": 8
48+
},
1749
"targets": [
1850
{
1951
"expr": "sum by(result) (rate(raguide_kb_ingest_total[10m]))",
2052
"legendFormat": "{{result}}",
2153
"refId": "A"
2254
}
2355
],
24-
"fieldConfig": {"defaults": {"unit": "cps", "custom": {"stacking": {"mode": "normal"}}}}
56+
"fieldConfig": {
57+
"defaults": {
58+
"unit": "cps",
59+
"custom": {
60+
"stacking": {
61+
"mode": "normal"
62+
}
63+
}
64+
}
65+
}
2566
},
2667
{
2768
"id": 2,
2869
"type": "stat",
2970
"title": "2. KB 删除次数 (10m rate)",
3071
"description": "raguide_kb_delete_total —— 业主删除商品的频率。",
31-
"datasource": {"type": "prometheus", "uid": "prometheus"},
32-
"gridPos": {"x": 12, "y": 0, "w": 12, "h": 8},
33-
"targets": [{"expr": "rate(raguide_kb_delete_total[10m])", "refId": "A"}],
34-
"fieldConfig": {"defaults": {"unit": "cps"}}
72+
"datasource": {
73+
"type": "prometheus",
74+
"uid": "prometheus"
75+
},
76+
"gridPos": {
77+
"x": 12,
78+
"y": 5,
79+
"w": 12,
80+
"h": 8
81+
},
82+
"targets": [
83+
{
84+
"expr": "rate(raguide_kb_delete_total[10m])",
85+
"refId": "A"
86+
}
87+
],
88+
"fieldConfig": {
89+
"defaults": {
90+
"unit": "cps"
91+
}
92+
}
3593
},
3694
{
3795
"id": 3,
3896
"type": "timeseries",
3997
"title": "3. 用户画像更新结果 (ok | skip | error)",
4098
"description": "raguide_profile_updates_total —— done_hook 每轮对话后更新跨会话画像的结果分布。error 持续>0 说明画像持久化有问题。",
41-
"datasource": {"type": "prometheus", "uid": "prometheus"},
42-
"gridPos": {"x": 0, "y": 8, "w": 24, "h": 8},
99+
"datasource": {
100+
"type": "prometheus",
101+
"uid": "prometheus"
102+
},
103+
"gridPos": {
104+
"x": 0,
105+
"y": 13,
106+
"w": 24,
107+
"h": 8
108+
},
43109
"targets": [
44110
{
45111
"expr": "sum by(result) (rate(raguide_profile_updates_total[10m]))",
46112
"legendFormat": "{{result}}",
47113
"refId": "A"
48114
}
49115
],
50-
"fieldConfig": {"defaults": {"unit": "cps", "custom": {"stacking": {"mode": "normal"}}}}
116+
"fieldConfig": {
117+
"defaults": {
118+
"unit": "cps",
119+
"custom": {
120+
"stacking": {
121+
"mode": "normal"
122+
}
123+
}
124+
}
125+
}
51126
}
52-
]
53-
}
127+
],
128+
"description": "🛠️ 业主运营动作"
129+
}

‎infra/grafana/dashboards/cost.json‎

Lines changed: 120 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,103 @@
44
"schemaVersion": 38,
55
"version": 1,
66
"refresh": "30s",
7-
"time": {"from": "now-30d", "to": "now"},
8-
"tags": ["raguide", "cost", "p4"],
7+
"time": {
8+
"from": "now-30d",
9+
"to": "now"
10+
},
11+
"tags": [
12+
"raguide",
13+
"cost",
14+
"p4"
15+
],
916
"panels": [
17+
{
18+
"id": 100,
19+
"type": "text",
20+
"title": "",
21+
"gridPos": {
22+
"x": 0,
23+
"y": 0,
24+
"w": 24,
25+
"h": 5
26+
},
27+
"options": {
28+
"mode": "markdown",
29+
"content": "## 💰 成本与预算\n看**LLM 调用花了多少钱**:本月累计、预算上限、占比、趋势。\n\n占比 **80% 变黄、100% 变红**(对齐 CostBudget80 / CostBudgetExhausted 告警)。预算由业主在「成本设置」配置,0=未设。⚠️ 单 worker 计数语义(demo)。"
30+
},
31+
"transparent": true
32+
},
1033
{
1134
"id": 1,
1235
"type": "stat",
1336
"title": "1. 本月累计成本 (CNY)",
1437
"description": "raguide_cost_monthly_cny —— 本日历月 LLM 调用累计成本(单 worker 语义)。",
15-
"datasource": {"type": "prometheus", "uid": "prometheus"},
16-
"gridPos": {"x": 0, "y": 0, "w": 8, "h": 6},
17-
"targets": [{"expr": "raguide_cost_monthly_cny", "refId": "A"}],
18-
"fieldConfig": {"defaults": {"unit": "currencyCNY", "decimals": 2}}
38+
"datasource": {
39+
"type": "prometheus",
40+
"uid": "prometheus"
41+
},
42+
"gridPos": {
43+
"x": 0,
44+
"y": 5,
45+
"w": 8,
46+
"h": 6
47+
},
48+
"targets": [
49+
{
50+
"expr": "raguide_cost_monthly_cny",
51+
"refId": "A"
52+
}
53+
],
54+
"fieldConfig": {
55+
"defaults": {
56+
"unit": "currencyCNY",
57+
"decimals": 2
58+
}
59+
}
1960
},
2061
{
2162
"id": 2,
2263
"type": "stat",
2364
"title": "2. 月度预算上限 (CNY)",
2465
"description": "raguide_cost_budget_cny —— 业主在「成本设置」配置的月预算;0 = 未设。",
25-
"datasource": {"type": "prometheus", "uid": "prometheus"},
26-
"gridPos": {"x": 8, "y": 0, "w": 8, "h": 6},
27-
"targets": [{"expr": "raguide_cost_budget_cny", "refId": "A"}],
28-
"fieldConfig": {"defaults": {"unit": "currencyCNY", "decimals": 2}}
66+
"datasource": {
67+
"type": "prometheus",
68+
"uid": "prometheus"
69+
},
70+
"gridPos": {
71+
"x": 8,
72+
"y": 5,
73+
"w": 8,
74+
"h": 6
75+
},
76+
"targets": [
77+
{
78+
"expr": "raguide_cost_budget_cny",
79+
"refId": "A"
80+
}
81+
],
82+
"fieldConfig": {
83+
"defaults": {
84+
"unit": "currencyCNY",
85+
"decimals": 2
86+
}
87+
}
2988
},
3089
{
3190
"id": 3,
3291
"type": "gauge",
3392
"title": "3. 预算占比 (本月/上限)",
3493
"description": "预算消耗占比。软线 80% 黄、硬线 100% 红(对齐 CostBudget80 / CostBudgetExhausted 告警)。预算未设(=0)时显示为 0。",
35-
"datasource": {"type": "prometheus", "uid": "prometheus"},
36-
"gridPos": {"x": 16, "y": 0, "w": 8, "h": 6},
94+
"datasource": {
95+
"type": "prometheus",
96+
"uid": "prometheus"
97+
},
98+
"gridPos": {
99+
"x": 16,
100+
"y": 5,
101+
"w": 8,
102+
"h": 6
103+
},
37104
"targets": [
38105
{
39106
"expr": "raguide_cost_monthly_cny / clamp_min(raguide_cost_budget_cny, 1) * (raguide_cost_budget_cny > bool 0)",
@@ -48,9 +115,18 @@
48115
"thresholds": {
49116
"mode": "absolute",
50117
"steps": [
51-
{"color": "green", "value": null},
52-
{"color": "yellow", "value": 0.8},
53-
{"color": "red", "value": 1.0}
118+
{
119+
"color": "green",
120+
"value": null
121+
},
122+
{
123+
"color": "yellow",
124+
"value": 0.8
125+
},
126+
{
127+
"color": "red",
128+
"value": 1.0
129+
}
54130
]
55131
}
56132
}
@@ -61,13 +137,35 @@
61137
"type": "timeseries",
62138
"title": "4. 成本 vs 预算趋势",
63139
"description": "本月累计成本随时间增长曲线 + 预算上限参考线。",
64-
"datasource": {"type": "prometheus", "uid": "prometheus"},
65-
"gridPos": {"x": 0, "y": 6, "w": 24, "h": 9},
140+
"datasource": {
141+
"type": "prometheus",
142+
"uid": "prometheus"
143+
},
144+
"gridPos": {
145+
"x": 0,
146+
"y": 11,
147+
"w": 24,
148+
"h": 9
149+
},
66150
"targets": [
67-
{"expr": "raguide_cost_monthly_cny", "legendFormat": "本月累计", "refId": "A"},
68-
{"expr": "raguide_cost_budget_cny", "legendFormat": "预算上限", "refId": "B"}
151+
{
152+
"expr": "raguide_cost_monthly_cny",
153+
"legendFormat": "本月累计",
154+
"refId": "A"
155+
},
156+
{
157+
"expr": "raguide_cost_budget_cny",
158+
"legendFormat": "预算上限",
159+
"refId": "B"
160+
}
69161
],
70-
"fieldConfig": {"defaults": {"unit": "currencyCNY", "decimals": 2}}
162+
"fieldConfig": {
163+
"defaults": {
164+
"unit": "currencyCNY",
165+
"decimals": 2
166+
}
167+
}
71168
}
72-
]
73-
}
169+
],
170+
"description": "💰 成本与预算"
171+
}

0 commit comments

Comments
 (0)