80 lines
3.0 KiB
JSON
80 lines
3.0 KiB
JSON
{
|
|
"dashboard": {
|
|
"title": "Weather Metrics",
|
|
"uid": "weather-metrics",
|
|
"timezone": "browser",
|
|
"refresh": "1m",
|
|
"time": { "from": "now-6h", "to": "now" },
|
|
"panels": [
|
|
{
|
|
"id": 1,
|
|
"type": "timeseries",
|
|
"title": "Temperature by City (°C)",
|
|
"gridPos": { "x": 0, "y": 0, "w": 24, "h": 10 },
|
|
"datasource": { "type": "grafana-postgresql-datasource", "uid": "fission-pg" },
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "celsius",
|
|
"custom": { "lineWidth": 2, "drawStyle": "line", "showPoints": "never", "spanNulls": true }
|
|
}
|
|
},
|
|
"options": { "legend": { "displayMode": "table", "placement": "right" } },
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"rawSql": "SELECT\n recorded_at AS time,\n temperature,\n city\nFROM weather_metrics\nWHERE $__timeFilter(recorded_at)\nORDER BY recorded_at",
|
|
"format": "time_series"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": 2,
|
|
"type": "table",
|
|
"title": "Current Conditions",
|
|
"gridPos": { "x": 0, "y": 10, "w": 24, "h": 8 },
|
|
"datasource": { "type": "grafana-postgresql-datasource", "uid": "fission-pg" },
|
|
"options": { "sortBy": [{ "displayName": "City" }] },
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"rawSql": "SELECT DISTINCT ON (city)\n city,\n country,\n temperature,\n feels_like,\n humidity,\n wind_speed,\n description,\n recorded_at\nFROM weather_metrics\nORDER BY city, recorded_at DESC",
|
|
"format": "table"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": 3,
|
|
"type": "timeseries",
|
|
"title": "Humidity by City (%)",
|
|
"gridPos": { "x": 0, "y": 18, "w": 12, "h": 8 },
|
|
"datasource": { "type": "grafana-postgresql-datasource", "uid": "fission-pg" },
|
|
"fieldConfig": { "defaults": { "unit": "percent", "min": 0, "max": 100, "custom": { "lineWidth": 2, "drawStyle": "line", "showPoints": "never", "spanNulls": true } } },
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"rawSql": "SELECT\n recorded_at AS time,\n humidity,\n city\nFROM weather_metrics\nWHERE $__timeFilter(recorded_at)\nORDER BY recorded_at",
|
|
"format": "time_series"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": 4,
|
|
"type": "timeseries",
|
|
"title": "Wind Speed by City (m/s)",
|
|
"gridPos": { "x": 12, "y": 18, "w": 12, "h": 8 },
|
|
"datasource": { "type": "grafana-postgresql-datasource", "uid": "fission-pg" },
|
|
"fieldConfig": { "defaults": { "unit": "velocityms", "custom": { "lineWidth": 2, "drawStyle": "line", "showPoints": "never", "spanNulls": true } } },
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"rawSql": "SELECT\n recorded_at AS time,\n wind_speed,\n city\nFROM weather_metrics\nWHERE $__timeFilter(recorded_at)\nORDER BY recorded_at",
|
|
"format": "time_series"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"schemaVersion": 38
|
|
},
|
|
"overwrite": true
|
|
}
|