summaryrefslogtreecommitdiff
path: root/AGENT.md
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-07 16:32:10 +0200
committerPaul Buetow <paul@buetow.org>2026-02-07 16:32:10 +0200
commit3fd46f3977fb650974e5e936cba362c787c00637 (patch)
treeb49111ddd0b7af4a007bca6a304dba10efcd88ff /AGENT.md
reimport this PoC
Diffstat (limited to 'AGENT.md')
-rw-r--r--AGENT.md63
1 files changed, 63 insertions, 0 deletions
diff --git a/AGENT.md b/AGENT.md
new file mode 100644
index 0000000..d5c22e7
--- /dev/null
+++ b/AGENT.md
@@ -0,0 +1,63 @@
+Follow ~/git/conf/snippets/go/go-projects.md
+
+## Grafana Dashboard Guidelines
+
+When creating or updating Grafana dashboards:
+
+### Sorting Requirements
+**ALWAYS ensure ALL panels are sorted by value (descending):**
+
+1. **Time Series Panels:**
+ - Add to `options.legend`: `"sortBy": "Last", "sortDesc": true`
+
+2. **Bar Gauge Panels:**
+ - Use `sort_desc()` in PromQL queries
+ - Example: `sort_desc(topk(10, sum by (label) (metric)))`
+
+3. **Pie/Donut Chart Panels:**
+ - Add to `options.legend`: `"sortBy": "Value", "sortDesc": true`
+
+4. **Table Panels:**
+ - Add to `options`: `"sortBy": [{"displayName": "ColumnName", "desc": true}]`
+
+### Example Panel Configuration
+
+**Time Series:**
+```json
+{
+ "type": "timeseries",
+ "options": {
+ "legend": {
+ "displayMode": "table",
+ "placement": "right",
+ "sortBy": "Last",
+ "sortDesc": true,
+ "calcs": ["lastNotNull", "mean", "max"]
+ }
+ }
+}
+```
+
+**Bar Gauge:**
+```json
+{
+ "type": "bargauge",
+ "targets": [{
+ "expr": "sort_desc(topk(15, sum by (cust) (metric)))"
+ }],
+ "options": {
+ "orientation": "horizontal",
+ "displayMode": "gradient"
+ }
+}
+```
+
+**Table:**
+```json
+{
+ "type": "table",
+ "options": {
+ "sortBy": [{"displayName": "Count", "desc": true}]
+ }
+}
+```