Skip to content

Commit

Permalink
Update default grafana config and refactor provisioning files
Browse files Browse the repository at this point in the history
  • Loading branch information
xbgmsharp committed Jan 12, 2024
1 parent 242a555 commit ae61072
Show file tree
Hide file tree
Showing 8 changed files with 7,179 additions and 11 deletions.
1,695 changes: 1,695 additions & 0 deletions grafana/dashboards/tpl/Electrical.json

Large diffs are not rendered by default.

472 changes: 472 additions & 0 deletions grafana/dashboards/tpl/Logbook.json

Large diffs are not rendered by default.

738 changes: 738 additions & 0 deletions grafana/dashboards/tpl/Monitor.json

Large diffs are not rendered by default.

1,341 changes: 1,341 additions & 0 deletions grafana/dashboards/tpl/RPI.json

Large diffs are not rendered by default.

635 changes: 635 additions & 0 deletions grafana/dashboards/tpl/Solar.json

Large diffs are not rendered by default.

1,987 changes: 1,987 additions & 0 deletions grafana/dashboards/tpl/Weather.json

Large diffs are not rendered by default.

297 changes: 297 additions & 0 deletions grafana/dashboards/tpl/home.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,297 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 5,
"links": [
{
"asDropdown": false,
"icon": "external link",
"includeVars": true,
"keepTime": false,
"tags": [],
"targetBlank": true,
"title": "New link",
"tooltip": "",
"type": "dashboards",
"url": ""
}
],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "postgres",
"uid": "OIttR1sVk"
},
"gridPos": {
"h": 13,
"w": 10,
"x": 0,
"y": 0
},
"id": 3,
"links": [],
"options": {
"folderId": 0,
"includeVars": false,
"keepTime": false,
"maxItems": 30,
"query": "",
"showHeadings": true,
"showRecentlyViewed": true,
"showSearch": false,
"showStarred": true,
"tags": []
},
"pluginVersion": "10.1.4",
"tags": [],
"targets": [
{
"datasource": {
"type": "postgres",
"uid": "OIttR1sVk"
},
"refId": "A"
}
],
"title": "PostgSail Dashboards",
"type": "dashlist"
},
{
"datasource": {
"type": "postgres",
"uid": "PCC52D03280B7034C"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 13,
"w": 12,
"x": 10,
"y": 0
},
"id": 5,
"maxDataPoints": 500,
"options": {
"basemap": {
"config": {},
"name": "Layer 0",
"type": "default"
},
"controls": {
"mouseWheelZoom": true,
"showAttribution": true,
"showDebug": false,
"showMeasure": false,
"showScale": false,
"showZoom": true
},
"layers": [
{
"config": {
"showLegend": true,
"style": {
"color": {
"fixed": "dark-green"
},
"opacity": 0.4,
"rotation": {
"fixed": 0,
"max": 360,
"min": -360,
"mode": "mod"
},
"size": {
"fixed": 5,
"max": 15,
"min": 2
},
"symbol": {
"fixed": "img/icons/marker/circle.svg",
"mode": "fixed"
},
"textConfig": {
"fontSize": 12,
"offsetX": 0,
"offsetY": 0,
"textAlign": "center",
"textBaseline": "middle"
}
}
},
"filterData": {
"id": "byRefId",
"options": "A"
},
"location": {
"latitude": "value",
"longitude": "value",
"mode": "auto"
},
"name": "Boat",
"tooltip": true,
"type": "markers"
}
],
"tooltip": {
"mode": "details"
},
"view": {
"allLayers": true,
"id": "fit",
"lat": 0,
"lon": 0,
"zoom": 5
}
},
"pluginVersion": "10.1.4",
"targets": [
{
"datasource": {
"type": "postgres",
"uid": "PCC52D03280B7034C"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT latitude, longitude FROM api.metrics WHERE vessel_id = '${boat}' ORDER BY time ASC LIMIT 1;",
"refId": "A",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
}
],
"title": "Location",
"type": "geomap"
}
],
"refresh": "",
"revision": 1,
"schemaVersion": 38,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"datasource": {
"type": "postgres",
"uid": "PCC52D03280B7034C"
},
"definition": "SET \"user.email\" = '${__user.email}';\nSET vessel.id = '${__user.login}';\nSELECT\n v.name AS __text,\n m.vessel_id AS __value\n FROM auth.vessels v\n JOIN api.metadata m ON v.owner_email = '${__user.email}' and m.vessel_id = v.vessel_id;",
"description": "Vessel Name",
"hide": 0,
"includeAll": false,
"label": "Boat",
"multi": false,
"name": "boat",
"options": [],
"query": "SET \"user.email\" = '${__user.email}';\nSET vessel.id = '${__user.login}';\nSELECT\n v.name AS __text,\n m.vessel_id AS __value\n FROM auth.vessels v\n JOIN api.metadata m ON v.owner_email = '${__user.email}' and m.vessel_id = v.vessel_id;",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
}
]
},
"time": {
"from": "now-90d",
"to": "now"
},
"timepicker": {
"hidden": true,
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
],
"type": "timepicker"
},
"timezone": "browser",
"title": "Home",
"uid": "d81aa15b",
"version": 1,
"weekStart": ""
}
25 changes: 14 additions & 11 deletions grafana/grafana.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@ allow_sign_up = false
auto_assign_org = true
auto_assign_org_role = Editor

[auth.proxy]
enabled = true
header_name = X-WEBAUTH-USER
header_property = email
headers = Login:X-WEBAUTH-LOGIN
auto_sign_up = true
enable_login_token = true
login_maximum_inactive_lifetime_duration = 12h
login_maximum_lifetime_duration = 1d

[dashboards]
default_home_dashboard_path = /etc/grafana/dashboards/home.json
default_home_dashboard_path = /etc/grafana/dashboards/tpl/home.json
min_refresh_interval = 1m

[alerting]
enabled = false

[unified_alerting]
enabled = false

[analytics]
feedback_links_enabled = false
reporting_enabled = false

[news]
news_feed_enabled = false

[help]
enabled = false

0 comments on commit ae61072

Please sign in to comment.