diff --git a/dashboards/dashboard_base.py b/dashboards/dashboard_base.py index c22dc0d0f88769d6b0c7ad23c9bb4a9b3cc619c1..887e8daf2ce4b936f1403fe6059e883d0178d657 100644 --- a/dashboards/dashboard_base.py +++ b/dashboards/dashboard_base.py @@ -3,7 +3,7 @@ from typing import List, Union from grafanalib.core import (Annotations, Dashboard, GridPos, Panel, Repeat, RowPanel, Stat, Template, Templating, Time, - TimeSeries) + TimeSeries, Threshold) from grafanalib.influxdb import InfluxDBTarget from dashboards.annotations import Annotation @@ -137,5 +137,7 @@ def get_stat_panel(title: str, title=title, dataSource=dataSource, targets=[get_influx_target(str(stat_query), alias=alias)], - **new_kwargs, + thresholdType='percentage', + thresholds=[Threshold('green', 0, 0.0), Threshold('yellow', 1, 50.0), Threshold('red', 2, 80.0)], + ** new_kwargs, )