-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: flight data visualization (#41)
* feat: add basic grafana visualization for flight demo * chore: minor update * chore: include screenshot and updated version of greptimedb * feat: use variable to render map * chore: update style * Update README.md * Update README.md --------- Co-authored-by: david <[email protected]>
- Loading branch information
1 parent
af580bc
commit c84c395
Showing
6 changed files
with
285 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
flight-data-ingester/grafana_provisioning/dashboards/dashboards.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: 1 | ||
|
||
providers: | ||
# <string> an unique provider name. Required | ||
- name: 'greptimedb demo dashboards' | ||
# <int> Org id. Default to 1 | ||
orgId: 1 | ||
# <string> name of the dashboard folder. | ||
folder: '' | ||
# <string> folder UID. will be automatically generated if not specified | ||
folderUid: '' | ||
# <string> provider type. Default to 'file' | ||
type: file | ||
# <bool> disable dashboard deletion | ||
disableDeletion: false | ||
# <int> how often Grafana will scan for changed dashboards | ||
updateIntervalSeconds: 10 | ||
# <bool> allow updating provisioned dashboards from the UI | ||
allowUiUpdates: false | ||
options: | ||
# <string, required> path to dashboard files on disk. Required when using the 'file' type | ||
path: /etc/grafana/provisioning/dashboards | ||
# <bool> use folder names from filesystem to create folders in Grafana |
223 changes: 223 additions & 0 deletions
223
flight-data-ingester/grafana_provisioning/dashboards/map.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,223 @@ | ||
{ | ||
"annotations": { | ||
"list": [ | ||
{ | ||
"builtIn": 1, | ||
"datasource": { | ||
"type": "grafana", | ||
"uid": "-- Grafana --" | ||
}, | ||
"enable": true, | ||
"hide": true, | ||
"iconColor": "rgba(0, 211, 255, 1)", | ||
"name": "Annotations & Alerts", | ||
"type": "dashboard" | ||
} | ||
] | ||
}, | ||
"editable": true, | ||
"fiscalYearStartMonth": 0, | ||
"graphTooltip": 0, | ||
"id": 1, | ||
"links": [], | ||
"panels": [ | ||
{ | ||
"datasource": { | ||
"default": true, | ||
"type": "grafana-postgresql-datasource", | ||
"uid": "edwaq5vjcr668c" | ||
}, | ||
"fieldConfig": { | ||
"defaults": { | ||
"color": { | ||
"mode": "continuous-GrYlRd" | ||
}, | ||
"custom": { | ||
"hideFrom": { | ||
"legend": false, | ||
"tooltip": false, | ||
"viz": false | ||
} | ||
}, | ||
"mappings": [], | ||
"thresholds": { | ||
"mode": "absolute", | ||
"steps": [ | ||
{ | ||
"color": "green", | ||
"value": null | ||
} | ||
] | ||
} | ||
}, | ||
"overrides": [] | ||
}, | ||
"gridPos": { | ||
"h": 21, | ||
"w": 24, | ||
"x": 0, | ||
"y": 0 | ||
}, | ||
"id": 1, | ||
"options": { | ||
"basemap": { | ||
"config": {}, | ||
"name": "Layer 0", | ||
"opacity": 0.4, | ||
"tooltip": false, | ||
"type": "osm-standard" | ||
}, | ||
"controls": { | ||
"mouseWheelZoom": true, | ||
"showAttribution": true, | ||
"showDebug": false, | ||
"showMeasure": false, | ||
"showScale": false, | ||
"showZoom": true | ||
}, | ||
"layers": [ | ||
{ | ||
"config": { | ||
"showLegend": true, | ||
"style": { | ||
"color": { | ||
"field": "velocity", | ||
"fixed": "dark-green" | ||
}, | ||
"opacity": 1, | ||
"rotation": { | ||
"fixed": 0, | ||
"max": 360, | ||
"min": -360, | ||
"mode": "mod" | ||
}, | ||
"size": { | ||
"fixed": 15, | ||
"max": 15, | ||
"min": 2 | ||
}, | ||
"symbol": { | ||
"fixed": "img/icons/marker/plane.svg", | ||
"mode": "fixed" | ||
}, | ||
"symbolAlign": { | ||
"horizontal": "center", | ||
"vertical": "center" | ||
}, | ||
"text": { | ||
"field": "baro_altitude", | ||
"fixed": "", | ||
"mode": "field" | ||
}, | ||
"textConfig": { | ||
"fontSize": 11, | ||
"offsetX": 0, | ||
"offsetY": 20, | ||
"textAlign": "center", | ||
"textBaseline": "middle" | ||
} | ||
} | ||
}, | ||
"filterData": { | ||
"id": "byRefId", | ||
"options": "A" | ||
}, | ||
"location": { | ||
"mode": "auto" | ||
}, | ||
"name": "Flight Velocity", | ||
"tooltip": true, | ||
"type": "markers" | ||
} | ||
], | ||
"tooltip": { | ||
"mode": "details" | ||
}, | ||
"view": { | ||
"allLayers": true, | ||
"id": "fit", | ||
"lastOnly": false, | ||
"lat": 0, | ||
"layer": "Flight Velocity", | ||
"lon": 0, | ||
"padding": 10, | ||
"zoom": 13 | ||
} | ||
}, | ||
"pluginVersion": "11.2.0", | ||
"targets": [ | ||
{ | ||
"datasource": { | ||
"type": "grafana-postgresql-datasource", | ||
"uid": "edwaq5vjcr668c" | ||
}, | ||
"editorMode": "code", | ||
"format": "table", | ||
"rawQuery": true, | ||
"rawSql": "select icao24, longitude, latitude, baro_altitude, geo_altitude, velocity, geohash(latitude, longitude, 7) as geohash from icao24_state where icao24 = '$icao24' and $__timeFilter(ts) order by ts desc limit 500;", | ||
"refId": "A", | ||
"sql": { | ||
"columns": [ | ||
{ | ||
"parameters": [], | ||
"type": "function" | ||
} | ||
], | ||
"groupBy": [ | ||
{ | ||
"property": { | ||
"type": "string" | ||
}, | ||
"type": "groupBy" | ||
} | ||
], | ||
"limit": 50 | ||
} | ||
} | ||
], | ||
"title": "Flight Map", | ||
"type": "geomap" | ||
} | ||
], | ||
"refresh": "30s", | ||
"schemaVersion": 39, | ||
"tags": [], | ||
"templating": { | ||
"list": [ | ||
{ | ||
"current": { | ||
"selected": false, | ||
"text": "aac87b", | ||
"value": "aac87b" | ||
}, | ||
"datasource": { | ||
"type": "grafana-postgresql-datasource", | ||
"uid": "edwaq5vjcr668c" | ||
}, | ||
"definition": "SELECT DISTINCT icao24 FROM icao24_state where $__timeFilter(ts);", | ||
"hide": 0, | ||
"includeAll": false, | ||
"label": "icao24", | ||
"multi": false, | ||
"name": "icao24", | ||
"options": [], | ||
"query": "SELECT DISTINCT icao24 FROM icao24_state where $__timeFilter(ts);", | ||
"refresh": 2, | ||
"regex": "", | ||
"skipUrlSync": false, | ||
"sort": 0, | ||
"type": "query" | ||
} | ||
] | ||
}, | ||
"time": { | ||
"from": "now-1h", | ||
"to": "now" | ||
}, | ||
"timepicker": {}, | ||
"timezone": "browser", | ||
"title": "Flight Map", | ||
"uid": "bdwetcv3dtssge", | ||
"version": 1, | ||
"weekStart": "" | ||
} |
9 changes: 9 additions & 0 deletions
9
flight-data-ingester/grafana_provisioning/datasources/greptime_pg_ds.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: 2 | ||
datasources: | ||
- name: greptimedb_pg | ||
type: postgres | ||
url: greptimedb:4003 | ||
uid: edwaq5vjcr668c | ||
jsonData: | ||
database: public | ||
sslmode: 'disable' # disable/require/verify-ca/verify-full |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.