diff --git a/grafonnet/alertlist.libsonnet b/grafonnet/alertlist.libsonnet index 94df3603..920ece1e 100644 --- a/grafonnet/alertlist.libsonnet +++ b/grafonnet/alertlist.libsonnet @@ -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='', @@ -26,6 +27,7 @@ transparent=null, description=null, datasource=null, + nameFilter=null, ):: { [if transparent != null then 'transparent']: transparent, @@ -39,5 +41,6 @@ onlyAlertsOnDashboard: onlyAlertsOnDashboard, [if description != null then 'description']: description, datasource: datasource, + nameFilter: nameFilter, }, } diff --git a/tests/alertlist/test.jsonnet b/tests/alertlist/test.jsonnet index d5c70a10..28ded17e 100644 --- a/tests/alertlist/test.jsonnet +++ b/tests/alertlist/test.jsonnet @@ -17,5 +17,6 @@ local alertlist = grafana.alertlist; ], onlyAlertsOnDashboard=true, transparent=true, + nameFilter='name of alert', ), } diff --git a/tests/alertlist/test_compiled.json b/tests/alertlist/test_compiled.json index ace2c70e..dc0538c5 100644 --- a/tests/alertlist/test_compiled.json +++ b/tests/alertlist/test_compiled.json @@ -3,6 +3,7 @@ "datasource": "$PROMETHEUS", "description": "description", "limit": 20, + "nameFilter": "name of alert", "onlyAlertsOnDashboard": true, "show": "current", "sortOrder": 2, @@ -18,6 +19,7 @@ "basic": { "datasource": null, "limit": 10, + "nameFilter": null, "onlyAlertsOnDashboard": true, "show": "current", "sortOrder": 1,