monitoring(overview): refine ups-climate row and climate/fan stat display
This commit is contained in:
parent
1b682cc60f
commit
82e1b87b8f
@ -647,6 +647,7 @@ def stat_panel(
|
|||||||
field_overrides=None,
|
field_overrides=None,
|
||||||
description=None,
|
description=None,
|
||||||
orientation=None,
|
orientation=None,
|
||||||
|
wide_layout=None,
|
||||||
):
|
):
|
||||||
"""Return a Grafana stat panel definition."""
|
"""Return a Grafana stat panel definition."""
|
||||||
defaults = {
|
defaults = {
|
||||||
@ -687,6 +688,8 @@ def stat_panel(
|
|||||||
}
|
}
|
||||||
if orientation:
|
if orientation:
|
||||||
panel["options"]["orientation"] = orientation
|
panel["options"]["orientation"] = orientation
|
||||||
|
if wide_layout is not None:
|
||||||
|
panel["options"]["wideLayout"] = wide_layout
|
||||||
if legend and len(panel["targets"]) == 1:
|
if legend and len(panel["targets"]) == 1:
|
||||||
panel["targets"][0]["legendFormat"] = legend
|
panel["targets"][0]["legendFormat"] = legend
|
||||||
if instant:
|
if instant:
|
||||||
@ -1337,11 +1340,12 @@ def build_overview():
|
|||||||
],
|
],
|
||||||
field_overrides=[
|
field_overrides=[
|
||||||
{"matcher": {"id": "byName", "options": "Tent Temp (°C)"}, "properties": [{"id": "unit", "value": "celsius"}]},
|
{"matcher": {"id": "byName", "options": "Tent Temp (°C)"}, "properties": [{"id": "unit", "value": "celsius"}]},
|
||||||
{"matcher": {"id": "byName", "options": "Tent Pressure (kPa)"}, "properties": [{"id": "unit", "value": "none"}]},
|
{"matcher": {"id": "byName", "options": "Tent Pressure (kPa)"}, "properties": [{"id": "unit", "value": "suffix:kPa"}]},
|
||||||
],
|
],
|
||||||
links=link_to("atlas-power"),
|
links=link_to("atlas-power"),
|
||||||
description="Current tent temperature and pressure.",
|
description="Current tent temperature and pressure.",
|
||||||
orientation="vertical",
|
orientation="vertical",
|
||||||
|
wide_layout=False,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
panels.append(
|
panels.append(
|
||||||
@ -1381,10 +1385,10 @@ def build_overview():
|
|||||||
decimals=0,
|
decimals=0,
|
||||||
text_mode="name_and_value",
|
text_mode="name_and_value",
|
||||||
targets=[
|
targets=[
|
||||||
{"refId": "A", "expr": CLIMATE_FAN_OUTLET_CURRENT, "legendFormat": "Outlet", "instant": True},
|
{"refId": "A", "expr": f"round({CLIMATE_FAN_OUTLET_CURRENT})", "legendFormat": "Outlet", "instant": True},
|
||||||
{"refId": "B", "expr": CLIMATE_FAN_INSIDE_INLET_CURRENT, "legendFormat": "Inside Inlet", "instant": True},
|
{"refId": "B", "expr": f"round({CLIMATE_FAN_INSIDE_INLET_CURRENT})", "legendFormat": "Inside Inlet", "instant": True},
|
||||||
{"refId": "C", "expr": CLIMATE_FAN_OUTSIDE_INLET_CURRENT, "legendFormat": "Outside Inlet", "instant": True},
|
{"refId": "C", "expr": f"round({CLIMATE_FAN_OUTSIDE_INLET_CURRENT})", "legendFormat": "Outside Inlet", "instant": True},
|
||||||
{"refId": "D", "expr": CLIMATE_FAN_INTERIOR_CURRENT, "legendFormat": "Interior", "instant": True},
|
{"refId": "D", "expr": f"round({CLIMATE_FAN_INTERIOR_CURRENT})", "legendFormat": "Interior", "instant": True},
|
||||||
],
|
],
|
||||||
thresholds={
|
thresholds={
|
||||||
"mode": "absolute",
|
"mode": "absolute",
|
||||||
|
|||||||
@ -1396,7 +1396,7 @@
|
|||||||
"properties": [
|
"properties": [
|
||||||
{
|
{
|
||||||
"id": "unit",
|
"id": "unit",
|
||||||
"value": "none"
|
"value": "suffix:kPa"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -1414,7 +1414,8 @@
|
|||||||
"values": false
|
"values": false
|
||||||
},
|
},
|
||||||
"textMode": "value",
|
"textMode": "value",
|
||||||
"orientation": "vertical"
|
"orientation": "vertical",
|
||||||
|
"wideLayout": false
|
||||||
},
|
},
|
||||||
"links": [
|
"links": [
|
||||||
{
|
{
|
||||||
@ -1516,25 +1517,25 @@
|
|||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"refId": "A",
|
"refId": "A",
|
||||||
"expr": "max(atlas_climate_fan_activity_level{fan_group=\"outlet\"}) or max(atlas_climate_fan_activity_level{position=\"outlet\"}) or on() vector(0)",
|
"expr": "round(max(atlas_climate_fan_activity_level{fan_group=\"outlet\"}) or max(atlas_climate_fan_activity_level{position=\"outlet\"}) or on() vector(0))",
|
||||||
"legendFormat": "Outlet",
|
"legendFormat": "Outlet",
|
||||||
"instant": true
|
"instant": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"refId": "B",
|
"refId": "B",
|
||||||
"expr": "max(atlas_climate_fan_activity_level{fan_group=\"inside_inlet\"}) or max(atlas_climate_fan_activity_level{position=\"inside_inlet\"}) or on() vector(0)",
|
"expr": "round(max(atlas_climate_fan_activity_level{fan_group=\"inside_inlet\"}) or max(atlas_climate_fan_activity_level{position=\"inside_inlet\"}) or on() vector(0))",
|
||||||
"legendFormat": "Inside Inlet",
|
"legendFormat": "Inside Inlet",
|
||||||
"instant": true
|
"instant": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"refId": "C",
|
"refId": "C",
|
||||||
"expr": "max(atlas_climate_fan_activity_level{fan_group=\"outside_inlet\"}) or max(atlas_climate_fan_activity_level{position=\"outside_inlet\"}) or on() vector(0)",
|
"expr": "round(max(atlas_climate_fan_activity_level{fan_group=\"outside_inlet\"}) or max(atlas_climate_fan_activity_level{position=\"outside_inlet\"}) or on() vector(0))",
|
||||||
"legendFormat": "Outside Inlet",
|
"legendFormat": "Outside Inlet",
|
||||||
"instant": true
|
"instant": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"refId": "D",
|
"refId": "D",
|
||||||
"expr": "max(atlas_climate_fan_activity_level{fan_group=\"interior\"}) or max(atlas_climate_fan_activity_level{position=\"interior\"}) or on() vector(0)",
|
"expr": "round(max(atlas_climate_fan_activity_level{fan_group=\"interior\"}) or max(atlas_climate_fan_activity_level{position=\"interior\"}) or on() vector(0))",
|
||||||
"legendFormat": "Interior",
|
"legendFormat": "Interior",
|
||||||
"instant": true
|
"instant": true
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1405,7 +1405,7 @@ data:
|
|||||||
"properties": [
|
"properties": [
|
||||||
{
|
{
|
||||||
"id": "unit",
|
"id": "unit",
|
||||||
"value": "none"
|
"value": "suffix:kPa"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -1423,7 +1423,8 @@ data:
|
|||||||
"values": false
|
"values": false
|
||||||
},
|
},
|
||||||
"textMode": "value",
|
"textMode": "value",
|
||||||
"orientation": "vertical"
|
"orientation": "vertical",
|
||||||
|
"wideLayout": false
|
||||||
},
|
},
|
||||||
"links": [
|
"links": [
|
||||||
{
|
{
|
||||||
@ -1525,25 +1526,25 @@ data:
|
|||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"refId": "A",
|
"refId": "A",
|
||||||
"expr": "max(atlas_climate_fan_activity_level{fan_group=\"outlet\"}) or max(atlas_climate_fan_activity_level{position=\"outlet\"}) or on() vector(0)",
|
"expr": "round(max(atlas_climate_fan_activity_level{fan_group=\"outlet\"}) or max(atlas_climate_fan_activity_level{position=\"outlet\"}) or on() vector(0))",
|
||||||
"legendFormat": "Outlet",
|
"legendFormat": "Outlet",
|
||||||
"instant": true
|
"instant": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"refId": "B",
|
"refId": "B",
|
||||||
"expr": "max(atlas_climate_fan_activity_level{fan_group=\"inside_inlet\"}) or max(atlas_climate_fan_activity_level{position=\"inside_inlet\"}) or on() vector(0)",
|
"expr": "round(max(atlas_climate_fan_activity_level{fan_group=\"inside_inlet\"}) or max(atlas_climate_fan_activity_level{position=\"inside_inlet\"}) or on() vector(0))",
|
||||||
"legendFormat": "Inside Inlet",
|
"legendFormat": "Inside Inlet",
|
||||||
"instant": true
|
"instant": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"refId": "C",
|
"refId": "C",
|
||||||
"expr": "max(atlas_climate_fan_activity_level{fan_group=\"outside_inlet\"}) or max(atlas_climate_fan_activity_level{position=\"outside_inlet\"}) or on() vector(0)",
|
"expr": "round(max(atlas_climate_fan_activity_level{fan_group=\"outside_inlet\"}) or max(atlas_climate_fan_activity_level{position=\"outside_inlet\"}) or on() vector(0))",
|
||||||
"legendFormat": "Outside Inlet",
|
"legendFormat": "Outside Inlet",
|
||||||
"instant": true
|
"instant": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"refId": "D",
|
"refId": "D",
|
||||||
"expr": "max(atlas_climate_fan_activity_level{fan_group=\"interior\"}) or max(atlas_climate_fan_activity_level{position=\"interior\"}) or on() vector(0)",
|
"expr": "round(max(atlas_climate_fan_activity_level{fan_group=\"interior\"}) or max(atlas_climate_fan_activity_level{position=\"interior\"}) or on() vector(0))",
|
||||||
"legendFormat": "Interior",
|
"legendFormat": "Interior",
|
||||||
"instant": true
|
"instant": true
|
||||||
}
|
}
|
||||||
|
|||||||
@ -296,7 +296,7 @@ spec:
|
|||||||
podAnnotations:
|
podAnnotations:
|
||||||
vault.hashicorp.com/agent-inject: "true"
|
vault.hashicorp.com/agent-inject: "true"
|
||||||
vault.hashicorp.com/role: "monitoring"
|
vault.hashicorp.com/role: "monitoring"
|
||||||
monitoring.bstein.dev/restart-rev: "9"
|
monitoring.bstein.dev/restart-rev: "10"
|
||||||
vault.hashicorp.com/agent-inject-secret-grafana-env.sh: "kv/data/atlas/monitoring/grafana-admin"
|
vault.hashicorp.com/agent-inject-secret-grafana-env.sh: "kv/data/atlas/monitoring/grafana-admin"
|
||||||
vault.hashicorp.com/agent-inject-template-grafana-env.sh: |
|
vault.hashicorp.com/agent-inject-template-grafana-env.sh: |
|
||||||
{{ with secret "kv/data/atlas/monitoring/grafana-admin" }}
|
{{ with secret "kv/data/atlas/monitoring/grafana-admin" }}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user