You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+84-8Lines changed: 84 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -210,36 +210,112 @@ Replace `YOUR_DASHBOARD_NAME` with your dashboard's pretty name from the registr
210
210
211
211
### Using Search Macros
212
212
213
-
CACA provides several search macros for easy querying:
213
+
CACA provides several search macros for easy querying. These macros help you quickly identify dashboards with issues, analyze performance, and understand usage patterns.
214
214
215
-
#### Get dashboard stats:
215
+
#### Finding Dashboards with Issues
216
+
217
+
##### Identify dashboards with health issues (errors/warnings):
218
+
```spl
219
+
`get_dashboards_with_errors`
220
+
```
221
+
**Returns:** Dashboards with errors or warnings in the last 7 days, sorted by severity
**Use case:** Get an overview of all dashboard health and activity
224
263
225
-
#### Get top dashboards by views:
264
+
#####Get top dashboards by metric type:
226
265
```spl
227
266
`get_top_dashboards(views)`
267
+
`get_top_dashboards(edits)`
228
268
```
269
+
**Returns:** Top 10 dashboards by views or edits in the last 7 days
270
+
**Use case:** Identify most-used or most-edited dashboards
229
271
230
-
#### Get dashboard performance:
272
+
#### Performance Analysis
273
+
274
+
##### Get performance rating for a specific dashboard:
231
275
```spl
232
276
`get_dashboard_performance("My Dashboard Name")`
233
277
```
278
+
**Returns:** Average load time and performance rating (Excellent/Good/Fair/Poor)
279
+
**Use case:** Check if a dashboard meets performance standards
280
+
281
+
##### Get last viewed time for a dashboard:
282
+
```spl
283
+
`get_dashboard_last_viewed("My Dashboard Name")`
284
+
```
285
+
**Returns:** Last viewed timestamp and days since last view
286
+
**Use case:** Identify stale or unused dashboards
287
+
288
+
#### Common Use Cases
289
+
290
+
**Find all dashboards needing immediate attention:**
291
+
```spl
292
+
`get_problematic_dashboards`
293
+
| where health_status="critical" OR (errors_7d > 50) OR (avg_load_time_7d > 10000)
294
+
```
234
295
235
-
#### Get slow dashboards:
296
+
**List dashboards with errors that are actively used:**
297
+
```spl
298
+
`get_dashboards_with_errors`
299
+
| where errors > 0
300
+
| join type=inner pretty_name [| mstats sum(_value) as views WHERE index=caca_metrics AND metric_name="dashboard.views" BY pretty_name span=1d | where _time >= relative_time(now(), "-7d") | stats sum(views) as views_7d by pretty_name | where views_7d > 10]
| join type=inner pretty_name [| mstats sum(_value) as views WHERE index=caca_metrics AND metric_name="dashboard.views" BY pretty_name span=1d | where _time >= relative_time(now(), "-7d") | stats sum(views) as views_7d by pretty_name]
Copy file name to clipboardExpand all lines: default/macros.conf
+31Lines changed: 31 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -92,3 +92,34 @@ definition = | mstats avg(_value) as avg_load_time WHERE index=caca_metrics AND
92
92
1=1, "Good") \
93
93
| sort -avg_load_time_7d
94
94
iseval = 0
95
+
96
+
[get_dashboards_with_errors]
97
+
definition = | mstats sum(_value) as error_count WHERE index=caca_metrics AND metric_name="dashboard.errors" BY pretty_name, severity, app span=1d \
98
+
| where _time >= relative_time(now(), "-7d") \
99
+
| stats sum(error_count) as total_errors by pretty_name, severity, app \
100
+
| eval {severity}=total_errors \
101
+
| stats sum(error) as errors sum(warn) as warnings values(error) as has_errors values(warn) as has_warns sum(total_errors) as total_issues by pretty_name, app \
102
+
| fillnull value=0 errors warnings \
103
+
| where total_issues > 0 \
104
+
| eval health_status=case(\
105
+
errors > 50, "Critical",\
106
+
errors > 10, "High",\
107
+
errors > 0, "Medium",\
108
+
warnings > 20, "Medium",\
109
+
1=1, "Low") \
110
+
| sort -errors -warnings
111
+
iseval = 0
112
+
113
+
[get_problematic_dashboards]
114
+
definition = `get_all_dashboards_summary` \
115
+
| where health_status="critical" OR health_status="warning" OR avg_load_time_7d > 5000 \
116
+
| eval issue_type=case(\
117
+
health_status="critical" AND avg_load_time_7d > 5000, "Health + Performance",\
118
+
health_status="critical", "Health Issues",\
119
+
health_status="warning" AND avg_load_time_7d > 5000, "Health + Performance",\
0 commit comments