diff --git a/dashboards/dashboard_base.py b/dashboards/dashboard_base.py index ccb4803ea7086365e4160fa761866bfb474b0bb4..652287cd2cd2f83a458bf4ae43638f0b5577b92f 100644 --- a/dashboards/dashboard_base.py +++ b/dashboards/dashboard_base.py @@ -111,6 +111,7 @@ def get_stat_panel(title: str, dataSource: str, stat_query: Query, **kwargs): graphMode='area', reduceCalc='last', orientation='auto', + transparent=True, targets=[ get_influx_target(str(stat_query), alias="$tag_name") ], diff --git a/dashboards/dashboard_list.py b/dashboards/dashboard_list.py index 036b957ffeb8417b1b4bf28c49172eb74fcb23ba..59b78cf2a3188539667d382a678cb8710f16e0c4 100644 --- a/dashboards/dashboard_list.py +++ b/dashboards/dashboard_list.py @@ -249,7 +249,7 @@ def dashboard_general_infos(): return Query( select_="duration", from_=measurment_name, - where_=join_conditions([f'"name" =~ /{name_base}/', get_variable_condition('host', tag_key='name')], + where_=join_conditions([f'"name" =~ /{name_base}/', f'"name" =~ /${host_var.name}/'], "AND"), group_by=[ 'name' diff --git a/dashboards/influx_queries.py b/dashboards/influx_queries.py index e803cdf5dba98d286d06c773301a807a102cd489..6441f0b8275ddde21cbb813c2ae5cbabcaf0fa4c 100644 --- a/dashboards/influx_queries.py +++ b/dashboards/influx_queries.py @@ -38,7 +38,7 @@ def get_variable_condition(variable_name: str, *, tag_key: str = None) -> str: clean_lhs = clean_rhs if not clean_rhs: raise ValueError("Empty variable name") - return f'"{clean_lhs}" =~ /${clean_rhs}$/' + return f'"{clean_lhs}" =~ /^${clean_rhs}$/' def join_conditions(conditions: List[str], operators: Union[List[str], str]):