@cloudcare/guance-front-tools 1.0.19 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/README.md +0 -64
  2. package/lib/cjs/generated/dashboardCharts.d.ts +172 -69
  3. package/lib/cjs/scripts/convert-grafana-dashboard-core.js +417 -56
  4. package/lib/esm/generated/dashboardCharts.d.ts +172 -69
  5. package/lib/esm/scripts/convert-grafana-dashboard-core.js +417 -56
  6. package/lib/example/1860_rev45.json +15536 -0
  7. package/lib/example/guance-dashboard.json +16766 -2702
  8. package/lib/scripts/convert-grafana-dashboard-core.js +1899 -1633
  9. package/package.json +1 -1
  10. package/schemas/charts/chart-schema.json +711 -1
  11. package/schemas/charts/settings/_common-settings-gradual-color-schema.json +17 -3
  12. package/schemas/charts/settings/_common-settings-legend-values-schema.json +23 -15
  13. package/{skills/grafana-to-guance-dashboard/schemas/charts/settings/chart-treemap-settings-schema.json → schemas/charts/settings/chart-change-settings-schema.json} +34 -32
  14. package/schemas/charts/settings/chart-chinamap-settings-schema.json +2 -1
  15. package/schemas/charts/settings/chart-command-settings-schema.json +16 -0
  16. package/schemas/charts/settings/chart-hexgon-settings-schema.json +2 -1
  17. package/{skills/grafana-to-guance-dashboard/schemas/charts/settings/chart-log-settings-schema.json → schemas/charts/settings/chart-monitor-settings-schema.json} +27 -30
  18. package/schemas/charts/settings/chart-sequence-settings-schema.json +2 -3
  19. package/schemas/charts/settings/chart-topology-settings-schema.json +1 -6
  20. package/schemas/charts/settings/chart-video-settings-schema.json +45 -0
  21. package/schemas/charts/settings/chart-worldmap-settings-schema.json +2 -1
  22. package/schemas/charts/settings/settings-alias-schema.json +14 -1
  23. package/schemas/charts/settings/settings-compare-schema.json +20 -12
  24. package/schemas/charts/settings/settings-schema.json +13 -1
  25. package/schemas/charts/settings/settings-time-schema.json +38 -23
  26. package/schemas/charts/settings/settings-unit-items-schema.json +222 -210
  27. package/schemas/charts/settings/settings-units-schema.json +0 -3
  28. package/test/cli.test.mjs +66 -44
  29. package/skills/grafana-to-guance-dashboard/SKILL.md +0 -490
  30. package/skills/grafana-to-guance-dashboard/agents/openai.yaml +0 -4
  31. package/skills/grafana-to-guance-dashboard/fixtures/grafana-dashboard.guance.json +0 -1029
  32. package/skills/grafana-to-guance-dashboard/fixtures/grafana-dashboard.json +0 -878
  33. package/skills/grafana-to-guance-dashboard/package.json +0 -16
  34. package/skills/grafana-to-guance-dashboard/references/conversion-audit-checklist.md +0 -183
  35. package/skills/grafana-to-guance-dashboard/references/converter-notes.md +0 -244
  36. package/skills/grafana-to-guance-dashboard/references/promql-compatibility-cheatsheet.md +0 -172
  37. package/skills/grafana-to-guance-dashboard/references/unit-inference-cheatsheet.md +0 -174
  38. package/skills/grafana-to-guance-dashboard/schemas/charts/chart-schema.json +0 -84
  39. package/skills/grafana-to-guance-dashboard/schemas/charts/common/chart-link-item-schema.json +0 -48
  40. package/skills/grafana-to-guance-dashboard/schemas/charts/common/chart-links-schema.json +0 -9
  41. package/skills/grafana-to-guance-dashboard/schemas/charts/common/common-chart-types-schema.json +0 -39
  42. package/skills/grafana-to-guance-dashboard/schemas/charts/common/common-vars-item-schema.json +0 -117
  43. package/skills/grafana-to-guance-dashboard/schemas/charts/common/common-vars-schema.json +0 -10
  44. package/skills/grafana-to-guance-dashboard/schemas/charts/dashboard-schema.json +0 -80
  45. package/skills/grafana-to-guance-dashboard/schemas/charts/query/queries-schema.json +0 -10
  46. package/skills/grafana-to-guance-dashboard/schemas/charts/query/query-item-schema.json +0 -60
  47. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/_common-settings-connect-null-schema.json +0 -7
  48. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/_common-settings-gradual-color-schema.json +0 -72
  49. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/_common-settings-groupby-schema.json +0 -22
  50. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/_common-settings-legend-position-schema.json +0 -14
  51. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/_common-settings-legend-values-schema.json +0 -19
  52. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/_common-settings-open-stack-schema.json +0 -8
  53. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/_common-settings-show-label-schema.json +0 -8
  54. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/_common-settings-show-line-schema.json +0 -8
  55. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/_common-settings-stack-content-schema.json +0 -12
  56. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/_common-settings-stack-type-schema.json +0 -11
  57. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/chart-alarm-settings-schema.json +0 -48
  58. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/chart-bar-settings-schema.json +0 -69
  59. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/chart-chinamap-settings-schema.json +0 -102
  60. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/chart-funnel-settings-schema.json +0 -34
  61. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/chart-gauge-settings-schema.json +0 -65
  62. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/chart-heatmap-settings-schema.json +0 -50
  63. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/chart-hexgon-settings-schema.json +0 -90
  64. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/chart-histogram-settings-schema.json +0 -47
  65. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/chart-iframe-settings-schema.json +0 -24
  66. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/chart-object-settings-schema.json +0 -52
  67. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/chart-picture-settings-schema.json +0 -46
  68. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/chart-pie-settings-schema.json +0 -90
  69. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/chart-sankey-settings-schema.json +0 -34
  70. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/chart-scatter-bubble-settings-schema.json +0 -31
  71. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/chart-sequence-settings-schema.json +0 -76
  72. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/chart-singlestat-settings-schema.json +0 -163
  73. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/chart-table-settings-schema.json +0 -184
  74. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/chart-text-settings-schema.json +0 -20
  75. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/chart-toplist-settings-schema.json +0 -117
  76. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/chart-topology-settings-schema.json +0 -71
  77. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/chart-worldmap-settings-schema.json +0 -102
  78. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/common-settings-schema.json +0 -82
  79. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/settings-alias-schema.json +0 -47
  80. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/settings-chart-type-schema.json +0 -27
  81. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/settings-colors-schema.json +0 -46
  82. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/settings-compare-schema.json +0 -58
  83. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/settings-fixed-time-schema.json +0 -49
  84. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/settings-levels-schema.json +0 -33
  85. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/settings-schema.json +0 -79
  86. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/settings-time-schema.json +0 -43
  87. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/settings-unit-items-schema.json +0 -228
  88. package/skills/grafana-to-guance-dashboard/schemas/charts/settings/settings-units-schema.json +0 -59
  89. package/skills/grafana-to-guance-dashboard/schemas/dashboard-schema.json +0 -5
  90. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/attribute-mutation-schema.json +0 -21
  91. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/attributes-schema.json +0 -10
  92. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/cdata-node-schema.json +0 -19
  93. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/creation-reason-schema.json +0 -17
  94. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/document-fragment-node-schema.json +0 -35
  95. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/document-node-schema.json +0 -30
  96. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/document-type-node-schema.json +0 -28
  97. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/element-node-schema.json +0 -33
  98. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/frustration-record-schema.json +0 -49
  99. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/full-snapshot-record-schema.json +0 -26
  100. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/incremental-data-schema.json +0 -36
  101. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/incremental-snapshot-record-schema.json +0 -29
  102. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/input-data-schema.json +0 -27
  103. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/input-state-schema.json +0 -27
  104. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/media-interaction-data-schema.json +0 -23
  105. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/media-interaction-schema.json +0 -20
  106. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/mouse-interaction-data-schema.json +0 -23
  107. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/mouse-interaction-schema.json +0 -47
  108. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/mouse-move-data-schema.json +0 -23
  109. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/mouse-position-schema.json +0 -26
  110. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/mutation-data-schema.json +0 -23
  111. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/mutation-payload-schema.json +0 -42
  112. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/node-added-mutation-schema.json +0 -41
  113. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/node-removed-mutation-schema.json +0 -18
  114. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/node-schema.json +0 -28
  115. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/record-schema.json +0 -30
  116. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/scroll-data-schema.json +0 -23
  117. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/scroll-position-schema.json +0 -22
  118. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/segment-metadata-schema.json +0 -28
  119. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/segment-schema.json +0 -25
  120. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/serialized-node-schema.json +0 -15
  121. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/serialized-node-with-id-schema.json +0 -21
  122. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/stylesheet-rule-add-schema.json +0 -28
  123. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/stylesheet-rule-data-schema.json +0 -23
  124. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/stylesheet-rule-delete-schema.json +0 -24
  125. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/stylesheet-rule-schema.json +0 -29
  126. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/stylesheet-schema.json +0 -30
  127. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/text-mutation-schema.json +0 -27
  128. package/skills/grafana-to-guance-dashboard/schemas/session-replay/browser/text-node-schema.json +0 -23
  129. package/skills/grafana-to-guance-dashboard/schemas/session-replay/common/_common-record-schema.json +0 -14
  130. package/skills/grafana-to-guance-dashboard/schemas/session-replay/common/_common-segment-metadata-schema.json +0 -30
  131. package/skills/grafana-to-guance-dashboard/schemas/session-replay/common/_slot-supported-common-record-schema.json +0 -21
  132. package/skills/grafana-to-guance-dashboard/schemas/session-replay/common/focus-record-schema.json +0 -34
  133. package/skills/grafana-to-guance-dashboard/schemas/session-replay/common/meta-record-schema.json +0 -42
  134. package/skills/grafana-to-guance-dashboard/schemas/session-replay/common/pointer-interaction-data-schema.json +0 -23
  135. package/skills/grafana-to-guance-dashboard/schemas/session-replay/common/pointer-interaction-schema.json +0 -34
  136. package/skills/grafana-to-guance-dashboard/schemas/session-replay/common/segment-context-schema.json +0 -46
  137. package/skills/grafana-to-guance-dashboard/schemas/session-replay/common/view-end-record-schema.json +0 -23
  138. package/skills/grafana-to-guance-dashboard/schemas/session-replay/common/viewport-resize-data-schema.json +0 -23
  139. package/skills/grafana-to-guance-dashboard/schemas/session-replay/common/viewport-resize-dimension-schema.json +0 -18
  140. package/skills/grafana-to-guance-dashboard/schemas/session-replay/common/visual-viewport-record-schema.json +0 -50
  141. package/skills/grafana-to-guance-dashboard/schemas/session-replay/full-snapshot-record-schema.json +0 -14
  142. package/skills/grafana-to-guance-dashboard/schemas/session-replay/incremental-data-schema.json +0 -14
  143. package/skills/grafana-to-guance-dashboard/schemas/session-replay/incremental-snapshot-record-schema.json +0 -14
  144. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/_common-shape-wireframe-schema.json +0 -22
  145. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/_common-shape-wireframe-update-schema.json +0 -22
  146. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/_common-wireframe-schema.json +0 -38
  147. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/_common-wireframe-update-schema.json +0 -38
  148. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/full-snapshot-record-schema.json +0 -38
  149. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/image-wireframe-schema.json +0 -43
  150. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/image-wireframe-update-schema.json +0 -43
  151. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/incremental-data-schema.json +0 -21
  152. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/incremental-snapshot-record-schema.json +0 -26
  153. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/mutation-data-schema.json +0 -23
  154. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/mutation-payload-schema.json +0 -55
  155. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/placeholder-wireframe-schema.json +0 -28
  156. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/placeholder-wireframe-update-schema.json +0 -28
  157. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/record-schema.json +0 -27
  158. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/segment-metadata-schema.json +0 -25
  159. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/segment-schema.json +0 -25
  160. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/shape-border-schema.json +0 -25
  161. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/shape-style-schema.json +0 -29
  162. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/shape-wireframe-schema.json +0 -23
  163. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/shape-wireframe-update-schema.json +0 -23
  164. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/text-position-schema.json +0 -57
  165. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/text-style-schema.json +0 -31
  166. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/text-wireframe-schema.json +0 -34
  167. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/text-wireframe-update-schema.json +0 -34
  168. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/touch-data-schema.json +0 -51
  169. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/webview-wireframe-schema.json +0 -33
  170. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/webview-wireframe-update-schema.json +0 -33
  171. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/wireframe-clip-schema.json +0 -29
  172. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/wireframe-schema.json +0 -24
  173. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mobile/wireframe-update-mutation-schema.json +0 -24
  174. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mutation-data-schema.json +0 -14
  175. package/skills/grafana-to-guance-dashboard/schemas/session-replay/mutation-payload-schema.json +0 -14
  176. package/skills/grafana-to-guance-dashboard/schemas/session-replay/record-schema.json +0 -14
  177. package/skills/grafana-to-guance-dashboard/schemas/session-replay/segment-metadata-schema.json +0 -14
  178. package/skills/grafana-to-guance-dashboard/schemas/session-replay/segment-schema.json +0 -15
  179. package/skills/grafana-to-guance-dashboard/schemas/session-replay-browser-schema.json +0 -5
  180. package/skills/grafana-to-guance-dashboard/schemas/session-replay-mobile-schema.json +0 -5
  181. package/skills/grafana-to-guance-dashboard/schemas/session-replay-schema.json +0 -33
  182. package/skills/grafana-to-guance-dashboard/scripts/convert-grafana-dashboard-core.js +0 -1675
  183. package/skills/grafana-to-guance-dashboard/scripts/convert-grafana-dashboard.mjs +0 -120
  184. package/skills/grafana-to-guance-dashboard/scripts/validate-file.mjs +0 -62
  185. package/skills/grafana-to-guance-dashboard/test/convert.test.mjs +0 -54
@@ -1,16 +0,0 @@
1
- {
2
- "name": "grafana-to-guance-dashboard-skill",
3
- "private": true,
4
- "type": "module",
5
- "engines": {
6
- "node": ">=18.0.0"
7
- },
8
- "scripts": {
9
- "convert": "node scripts/convert-grafana-dashboard.mjs",
10
- "validate:file": "node scripts/validate-file.mjs",
11
- "test": "node --test test/*.test.mjs"
12
- },
13
- "dependencies": {
14
- "ajv": "8.11.0"
15
- }
16
- }
@@ -1,183 +0,0 @@
1
- # Conversion Audit Checklist
2
-
3
- Use this checklist as the default operating sequence when handling Grafana-to-Guance conversion work with this skill.
4
-
5
- The goal is not just to produce JSON, but to produce:
6
-
7
- - a validated output
8
- - an explained audit result
9
- - a clear next action
10
-
11
- ## 1. Preflight
12
-
13
- Before converting, check:
14
-
15
- - what panel types are present
16
- - what datasource types are present
17
- - whether row panels or nested panels exist
18
- - whether variables are simple or complex
19
- - whether transformations or plugin-specific options are present
20
- - whether units appear explicit or likely need inference
21
- - whether queries look like PromQL, DQL, SQL-like text, or mixed patterns
22
-
23
- Ask:
24
-
25
- - is this likely a straightforward conversion
26
- - is `--guance-promql-compatible` likely useful
27
- - is `--keep-grafana-meta` likely useful
28
- - which panels already look risky before conversion starts
29
-
30
- ## 2. Convert
31
-
32
- Run the standalone converter with the chosen flags.
33
-
34
- Minimum expectation:
35
-
36
- - output file is created
37
- - schema validation passes or produces actionable errors
38
-
39
- If conversion fails immediately:
40
-
41
- - do not jump to a large refactor
42
- - identify whether the failure is path-related, schema-related, query-related, or panel-mapping-related
43
-
44
- ## 3. Validate
45
-
46
- After conversion, confirm:
47
-
48
- - the output file validates
49
- - the output has expected dashboard-level structure
50
- - chart count is in a plausible range
51
- - vars and groups exist when expected
52
-
53
- If validation fails:
54
-
55
- - record the failing paths
56
- - decide whether the issue is bad output or an overly strict schema
57
- - prefer fixing converter output before relaxing schemas
58
-
59
- ## 4. Audit Counts
60
-
61
- Compare input and output at a high level:
62
-
63
- - Grafana total panels
64
- - Grafana non-row panels
65
- - Guance chart count
66
- - Guance group count
67
- - input vars
68
- - output vars
69
-
70
- Ask:
71
-
72
- - which panels disappeared entirely
73
- - which panels became groups
74
- - which panels survived but may have degraded semantics
75
-
76
- ## 5. Audit Semantics
77
-
78
- For suspicious or important panels, inspect:
79
-
80
- - panel title
81
- - Grafana panel type
82
- - Guance chart type
83
- - query type
84
- - explicit unit vs inferred unit
85
- - links, thresholds, legend, mappings, transformations
86
-
87
- Classify each panel as:
88
-
89
- - `clean`
90
- - `partial`
91
- - `dropped`
92
- - `suspicious`
93
-
94
- ## 6. Audit Units
95
-
96
- Check whether each important panel has:
97
-
98
- - explicit unit
99
- - inferred unit with `high` confidence
100
- - inferred unit with `medium` or `low` confidence
101
- - no credible unit
102
-
103
- Use:
104
-
105
- - `unit-inference-cheatsheet.md`
106
-
107
- Escalate for review when:
108
-
109
- - unit materially changes interpretation
110
- - evidence conflicts
111
- - multiple weak hints disagree
112
-
113
- ## 7. Audit PromQL Compatibility
114
-
115
- Inspect important or suspicious PromQL queries and classify them:
116
-
117
- - `safe`
118
- - `suspicious`
119
- - `manual-review`
120
-
121
- Use:
122
-
123
- - `promql-compatibility-cheatsheet.md`
124
-
125
- Ask:
126
-
127
- - should the query be kept as-is
128
- - should `--guance-promql-compatible` be recommended
129
- - does the query mix naming styles
130
- - would normalization likely preserve intent
131
-
132
- ## 8. Decide Next Action
133
-
134
- Choose one next step only:
135
-
136
- - accept output
137
- - rerun with different flags
138
- - produce a debug build with `--keep-grafana-meta`
139
- - patch one small converter area
140
- - ask for manual review on specific panels or queries
141
-
142
- Do not combine many speculative fixes at once.
143
-
144
- ## 9. If Repair Is Needed
145
-
146
- Before patching:
147
-
148
- - isolate one failing panel or query pattern
149
- - compare source Grafana JSON to generated Guance JSON
150
- - name the smallest likely fix location
151
-
152
- Prefer fix locations in this order:
153
-
154
- - panel type map
155
- - query extraction
156
- - query classification
157
- - unit inference
158
- - PromQL normalization
159
- - settings conversion
160
- - variable conversion
161
- - layout conversion
162
-
163
- After patching:
164
-
165
- - rerun conversion
166
- - rerun validation
167
- - rerun audit
168
-
169
- ## 10. Report
170
-
171
- Provide a short user-facing report with:
172
-
173
- - input
174
- - output
175
- - flags
176
- - validation result
177
- - panel summary
178
- - dropped or suspicious items
179
- - unit concerns
180
- - PromQL concerns
181
- - recommended next step
182
-
183
- Default to concise reporting. Only produce a full panel-by-panel list when the user asks for it or when many panels are failing.
@@ -1,244 +0,0 @@
1
- # Converter Notes
2
-
3
- ## Skill Files
4
-
5
- - `skills/grafana-to-guance-dashboard/package.json`: standalone dependencies and convenience scripts
6
- - `skills/grafana-to-guance-dashboard/scripts/convert-grafana-dashboard.mjs`: standalone converter shipped by this skill
7
- - `skills/grafana-to-guance-dashboard/scripts/convert-grafana-dashboard-core.js`: standalone conversion core used by this skill
8
- - `skills/grafana-to-guance-dashboard/scripts/validate-file.mjs`: standalone validator for generated output
9
- - `skills/grafana-to-guance-dashboard/schemas/dashboard-schema.json`: standalone Guance dashboard schema entrypoint
10
- - `skills/grafana-to-guance-dashboard/fixtures/grafana-dashboard.json`: bundled standalone fixture dashboard
11
- - `skills/grafana-to-guance-dashboard/test/convert.test.mjs`: bundled end-to-end regression test
12
-
13
- ## Current Mapping Notes
14
-
15
- Use these notes together with LLM analysis, not as a replacement for it. The script handles deterministic conversion. The LLM should handle risk analysis, output auditing, root-cause explanation, and patch planning when conversion gaps remain.
16
-
17
- For the default step-by-step operating flow, also read [conversion-audit-checklist.md](conversion-audit-checklist.md).
18
-
19
- Two especially useful LLM-only review areas are:
20
-
21
- - unit inference when Grafana leaves units implicit
22
- - PromQL dialect compatibility when Grafana query habits differ from Guance expectations
23
-
24
- For unit inference heuristics and confidence patterns, also read [unit-inference-cheatsheet.md](unit-inference-cheatsheet.md).
25
- For PromQL review heuristics and rewrite-risk patterns, also read [promql-compatibility-cheatsheet.md](promql-compatibility-cheatsheet.md).
26
-
27
- ### Variables
28
-
29
- - Supported Grafana variable types:
30
- - `query`
31
- - `custom`
32
- - Variable mapping:
33
- - `query` -> `PROMQL_QUERY`
34
- - `custom` -> `CUSTOM_LIST`
35
-
36
- Additional Grafana variable types such as `textbox`, `constant`, `interval`, and `datasource` are converted into Guance custom-list style variables by the standalone script.
37
-
38
- The standalone script also preserves extra variable metadata such as `refresh`, `skipUrlSync`, `sort`, `description`, and raw option lists under `var.extend`.
39
-
40
- ### Panels
41
-
42
- Panel type mapping should live in the standalone skill converter implementation, typically `convert-grafana-dashboard-core.js`.
43
-
44
- If a Grafana panel type is missing, the panel is filtered out before conversion. Add the panel type to the standalone script map before debugging deeper.
45
-
46
- By default, the converter does not emit raw `extend.grafana` metadata in the generated Guance dashboard. Use `--keep-grafana-meta` only when you need source-level debugging context.
47
-
48
- ### Queries
49
-
50
- The converter pulls query text from the first defined field among:
51
-
52
- 1. `target.expr`
53
- 2. `target.query`
54
- 3. `target.queryText`
55
- 4. `target.expression`
56
- 5. `target.rawSql`
57
-
58
- Generated Guance queries default to PromQL-style output unless the query looks like DQL:
59
-
60
- ```json
61
- {
62
- "datasource": "dataflux",
63
- "qtype": "promql",
64
- "type": "sequence",
65
- "query": {
66
- "q": "...",
67
- "type": "promql",
68
- "code": "a",
69
- "promqlCode": 1
70
- }
71
- }
72
- ```
73
-
74
- Variable replacement is intentionally conservative:
75
-
76
- - only known Grafana dashboard variables are rewritten from `$var` / `${var}` to `#{var}`
77
- - Grafana built-ins such as `${__from}` and `${__to}` are preserved
78
- - unknown template expressions such as JavaScript local variables in text panels stay unchanged, for example `${hotcall}`
79
-
80
- Query classification is datasource-aware:
81
-
82
- - Prometheus-like datasources stay `promql`
83
- - SQL-like datasources such as MySQL/Postgres/MSSQL are emitted as `dql`
84
- - `guance-guance-datasource` defaults to `dql`
85
- - if a `guance-guance-datasource` target explicitly sets `qtype: "promql"`, that explicit PromQL mode wins
86
- - the generated `query.type` now follows the same classification instead of falling back to `simple`
87
-
88
- Guance PromQL compatibility mode:
89
-
90
- - pass `--guance-promql-compatible` to rewrite PromQL metric selectors from `metric_name` to `measurement:field`
91
- - the rewrite is conservative and only applies to metric selector tokens outside label braces
92
- - label keys such as `app_name` and grouping keys such as `by (app_name)` are preserved
93
- - keep this mode opt-in, because some dashboards may already target Guance-native metric names
94
-
95
- PromQL compatibility review should also inspect:
96
-
97
- - whether metric names should remain untouched rather than rewritten
98
- - whether recording-rule style metric names already look Guance-native
99
- - whether label selectors, grouping keys, or function nesting may behave differently after rewrite
100
- - whether a query should be marked suspicious instead of rewritten automatically
101
-
102
- ### Layout
103
-
104
- Grafana `gridPos` is not copied directly.
105
-
106
- - `x` and `w` are kept close to Grafana values
107
- - `y` and `h` are scaled into a Guance-friendly layout ratio
108
-
109
- If the final dashboard looks vertically misaligned, inspect the layout conversion helpers first.
110
-
111
- ## Debug Checklist
112
-
113
- When output is wrong:
114
-
115
- 1. Start with a preflight or audit mindset instead of editing immediately:
116
- - what panel type is this
117
- - what datasource shape does it use
118
- - what settings or transformations look important
119
- - is the panel dropped, partially converted, or converted with wrong semantics
120
- 1. Confirm the panel type is in the standalone script panel map.
121
- 2. Confirm the panel has `gridPos`.
122
- 3. Confirm the panel has usable `targets`.
123
- 4. Check whether the query lives in `expr`, `query`, or `queryText`.
124
- 5. Check whether row panels are collapsed, because collapsed and expanded rows are handled differently.
125
- 6. Validate the generated JSON with:
126
-
127
- ```bash
128
- npm run validate:file -- ./output/guance-dashboard.json
129
- ```
130
-
131
- 7. Run `npm test` to verify the bundled standalone fixture still converts and validates cleanly.
132
- 8. If the behavior itself is wrong, patch the standalone files under `skills/grafana-to-guance-dashboard/scripts/` directly instead of relying on repository sync/build flows.
133
-
134
- ## Audit Prompts
135
-
136
- When comparing input and output, explicitly answer:
137
-
138
- - Which Grafana panels converted cleanly
139
- - Which Grafana panels were dropped
140
- - Which Grafana panels are only partially represented
141
- - Which variables converted incorrectly or not at all
142
- - Which queries appear to be misclassified as `promql` or `dql`
143
- - Which panels are missing units and what units are most likely
144
- - Which inferred units are high-confidence versus low-confidence
145
- - Which PromQL queries are safe to normalize and which should be flagged for review
146
- - Which settings are missing versus only preserved in `extend.grafana`
147
- - Whether the next fix belongs in mapping, extraction, classification, or validation
148
-
149
- When inferring units, use evidence such as:
150
-
151
- - metric suffixes like `_bytes`, `_seconds`, `_ms`, `_percent`, `_ratio`
152
- - rate-like functions such as `rate`, `irate`, `increase`, `delta`
153
- - panel titles like `latency`, `duration`, `memory`, `cpu`, `qps`, `error rate`
154
- - legend aliases and threshold semantics
155
-
156
- Always state whether the unit inference is:
157
-
158
- - high confidence
159
- - medium confidence
160
- - low confidence
161
-
162
- For PromQL compatibility review, classify each query as:
163
-
164
- - safe
165
- - normalization is straightforward and low-risk
166
- - suspicious
167
- - a rewrite may be needed, but the intent is not obvious
168
- - manual-review
169
- - automatic advice is too risky or the datasource assumptions are unclear
170
-
171
- When a query is marked `suspicious` or `manual-review`, explain why in one sentence rather than only flagging it.
172
-
173
- ## Reporting Defaults
174
-
175
- Unless the user asks for raw detail, prefer:
176
-
177
- - one dashboard-level summary
178
- - one risk summary
179
- - one short list of dropped, partial, or suspicious panels
180
- - one short list of unit or PromQL concerns
181
- - one recommended next action
182
-
183
- Do not overwhelm the user with a full panel-by-panel dump when only a few panels are problematic.
184
-
185
- ## Settings Conversion
186
-
187
- The standalone script attempts to convert:
188
-
189
- - thresholds -> Guance `levels`
190
- - Grafana value maps and range maps -> Guance `mappings`
191
- - table override mappings -> Guance `valMappings`
192
- - legend placement and legend values, including older Grafana `legend.current/avg/min/max/total`
193
- - units, decimals, min, max from both newer and older Grafana panel formats
194
- - stacking and connect-nulls behavior from both newer and older Grafana panel formats
195
- - table column organize / rename / exclude / order transformations
196
- - panel links and field links into `extend.links`
197
- - appearance metadata into `settings.extend.appearance`, including:
198
- - `lineWidth`
199
- - `fillOpacity`
200
- - `pointMode`
201
- - `graphMode`
202
- - `colorMode`
203
- - `textMode`
204
- - `reduceCalcs`
205
- - `gaugeMode`
206
-
207
- This is heuristic conversion. For plugin-specific panels, validate the generated JSON and then refine the script with a real sample.
208
-
209
- ## Repair Strategy
210
-
211
- When the user asks to fix a conversion problem:
212
-
213
- 1. Isolate one concrete failing panel, variable, or query pattern.
214
- 2. Compare original Grafana JSON to generated Guance JSON.
215
- 3. State the smallest likely fix location:
216
- - panel type map
217
- - query extraction
218
- - query classification
219
- - unit inference
220
- - PromQL normalization
221
- - settings conversion
222
- - variable conversion
223
- - layout conversion
224
- 4. Patch only that part of the standalone converter first.
225
- 5. Re-run conversion, validation, and audit.
226
-
227
- Prefer this order of operations:
228
-
229
- 1. explanation
230
- 2. smallest patch
231
- 3. validation
232
- 4. audit
233
- 5. user-facing summary
234
-
235
- ## Safe Extension Pattern
236
-
237
- When adding support for a new panel type:
238
-
239
- 1. Add the Grafana panel type to the standalone script panel map.
240
- 2. Decide the Guance chart type target.
241
- 3. Add any special-case settings generation in the standalone script.
242
- 4. Convert a real dashboard containing that panel.
243
- 5. Validate the generated output file.
244
- 6. Run `npm test` to keep the standalone fixture and validator working.
@@ -1,172 +0,0 @@
1
- # PromQL Compatibility Cheatsheet
2
-
3
- Use this reference when reviewing whether Grafana-style PromQL should be kept as-is, normalized for Guance, or flagged for manual review.
4
-
5
- This file is a review guide. It is not a guarantee that a rewrite is safe.
6
-
7
- ## Review Outcome Labels
8
-
9
- - `safe`
10
- - a rewrite or keep-as-is decision is low-risk and well-supported
11
- - `suspicious`
12
- - the query may need adjustment, but the intent is not fully obvious
13
- - `manual-review`
14
- - the query is too ambiguous or too environment-specific for confident automated advice
15
-
16
- ## Common Cases
17
-
18
- ### Plain Prometheus Metric Names
19
-
20
- Example shape:
21
-
22
- ```promql
23
- sum(rate(http_requests_total[5m])) by (service)
24
- ```
25
-
26
- Typical review:
27
-
28
- - compatible with Prometheus-style Grafana dashboards
29
- - likely candidate for `--guance-promql-compatible` if the target environment expects `measurement:field`
30
-
31
- Typical outcome:
32
-
33
- - `safe` if the whole dashboard consistently uses underscore-style metric names
34
-
35
- ### Metrics Already Containing `:`
36
-
37
- Example shape:
38
-
39
- ```promql
40
- sum(rate(http:requests_total[5m])) by (service)
41
- ```
42
-
43
- Typical review:
44
-
45
- - this may already be a recording rule or a Guance-style metric name
46
- - avoid blindly rewriting it again
47
-
48
- Typical outcome:
49
-
50
- - `suspicious` or `manual-review`
51
-
52
- ### Mixed Naming Styles
53
-
54
- Example shape:
55
-
56
- ```promql
57
- sum(rate(http_requests_total[5m])) + sum(rate(http:errors_total[5m]))
58
- ```
59
-
60
- Typical review:
61
-
62
- - mixed naming styles usually mean the dashboard is not uniformly Prometheus-native
63
- - broad normalization may break part of the query
64
-
65
- Typical outcome:
66
-
67
- - `manual-review`
68
-
69
- ### Recording Rules
70
-
71
- Example shape:
72
-
73
- ```promql
74
- job:http_requests:rate5m
75
- ```
76
-
77
- Typical review:
78
-
79
- - recording rules often compress semantics into names
80
- - avoid assuming underscore-based normalization is still appropriate
81
-
82
- Typical outcome:
83
-
84
- - `suspicious`
85
-
86
- ### Histogram Quantile Queries
87
-
88
- Example shape:
89
-
90
- ```promql
91
- histogram_quantile(0.95, sum(rate(http_request_duration_seconds_bucket[5m])) by (le, service))
92
- ```
93
-
94
- Typical review:
95
-
96
- - often safe structurally
97
- - the main question is whether metric naming should be normalized, not whether the function shape is valid
98
-
99
- Typical outcome:
100
-
101
- - `safe` if naming is consistently Prometheus-style
102
- - `suspicious` if histogram metric names already mix styles
103
-
104
- ## Label and Grouping Review
105
-
106
- Inspect carefully when queries use:
107
-
108
- - `by (...)`
109
- - `without (...)`
110
- - `on (...)`
111
- - `ignoring (...)`
112
- - `group_left`
113
- - `group_right`
114
-
115
- These constructs do not automatically mean incompatibility, but they increase rewrite risk when naming conventions are also being changed.
116
-
117
- Typical outcome:
118
-
119
- - `safe` if only metric names are normalized and label keys remain untouched
120
- - `suspicious` if a proposed rewrite would also alter grouping or selector meaning
121
-
122
- ## When To Recommend `--guance-promql-compatible`
123
-
124
- Good signals:
125
-
126
- - most queries are standard Prometheus metric selectors
127
- - metric names consistently use underscore-heavy names
128
- - no widespread use of recording-rule names already containing `:`
129
- - the user explicitly targets Guance metric naming compatibility
130
-
131
- Typical outcome:
132
-
133
- - `safe`
134
-
135
- ## When Not To Recommend It Blindly
136
-
137
- Warning signals:
138
-
139
- - the dashboard mixes Prometheus-native and Guance-native naming
140
- - many metrics already contain `:`
141
- - datasource assumptions are unclear
142
- - the queries appear heavily hand-tuned for a specific Prometheus backend
143
-
144
- Typical outcome:
145
-
146
- - `suspicious` or `manual-review`
147
-
148
- ## Review Questions
149
-
150
- When auditing a query, answer:
151
-
152
- - Is the query structurally valid PromQL?
153
- - Is the main issue naming compatibility or something deeper?
154
- - Are metric names consistently Prometheus-style, already Guance-style, or mixed?
155
- - Would normalization likely preserve intent?
156
- - Should this query be kept, rewritten, or escalated to manual review?
157
-
158
- ## Reporting Pattern
159
-
160
- Use compact notes like:
161
-
162
- ```md
163
- - query: sum(rate(http_requests_total[5m])) by (service)
164
- review: safe
165
- reason: metric names are consistently Prometheus-style and no Guance-native naming is mixed in
166
- ```
167
-
168
- ```md
169
- - query: sum(rate(http_requests_total[5m])) + sum(rate(http:errors_total[5m]))
170
- review: manual-review
171
- reason: query mixes underscore-style metrics with colon-style recording rules, so blanket normalization is risky
172
- ```