Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Able to show alerts filtered by alert name in alertlist pannel #349

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions grafonnet/alertlist.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* @param transparent (optional) Whether to display the panel without a background
* @param description (optional)
* @param datasource (optional)
* @param nameFilter (optional) Filter by alert name
*/
new(
title='',
Expand All @@ -26,6 +27,7 @@
transparent=null,
description=null,
datasource=null,
nameFilter=null,
)::
{
[if transparent != null then 'transparent']: transparent,
Expand All @@ -39,5 +41,6 @@
onlyAlertsOnDashboard: onlyAlertsOnDashboard,
[if description != null then 'description']: description,
datasource: datasource,
nameFilter: nameFilter,
},
}
1 change: 1 addition & 0 deletions tests/alertlist/test.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ local alertlist = grafana.alertlist;
],
onlyAlertsOnDashboard=true,
transparent=true,
nameFilter='name of alert',
),
}
2 changes: 2 additions & 0 deletions tests/alertlist/test_compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"datasource": "$PROMETHEUS",
"description": "description",
"limit": 20,
"nameFilter": "name of alert",
"onlyAlertsOnDashboard": true,
"show": "current",
"sortOrder": 2,
Expand All @@ -18,6 +19,7 @@
"basic": {
"datasource": null,
"limit": 10,
"nameFilter": null,
"onlyAlertsOnDashboard": true,
"show": "current",
"sortOrder": 1,
Expand Down