Environment
Grafana v8.3.3 (30bb7a93c)
Amazon Linux
t3.small
Datasource:
AWS Timestream
Objective
I want to plot WiFi RSSI values on a map.
Adjusting the colour of the marker in a range based on the WiFi signal strength
The data is written to a table in AWS Timestream as multipoint data. Latitude and Longitude are formatted as double and contain 6 decimal points of precision.
eg:
Rover_latitude = -31.123456
Rover_longitude = 115.123456
Geomap Configuration
The query is very simple
SELECT Rover_Latitude as Latitude, Rover_Longitude as Longitude, Heading, time from $__database.$__table WHERE $__timeFilter
The Marker layer is configured as Coords
(sorry new user so I cant show additional images here)
Config JSON
{
"fieldConfig": {
"defaults": {
"color": {
"mode": "fixed"
},
"decimals": 8,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"id": 4,
"options": {
"basemap": {
"config": {},
"name": "Layer 0",
"type": "default"
},
"controls": {
"mouseWheelZoom": true,
"showAttribution": true,
"showDebug": true,
"showScale": false,
"showZoom": true
},
"layers": [
{
"config": {
"showLegend": true,
"style": {
"color": {
"fixed": "dark-green"
},
"opacity": 0.4,
"rotation": {
"field": "Heading",
"fixed": 0,
"max": 360,
"min": -360,
"mode": "clamped"
},
"size": {
"fixed": 5,
"max": 15,
"min": 2
},
"symbol": {
"fixed": "img/icons/marker/circle.svg",
"mode": "fixed"
},
"text": {
"field": "Heading",
"fixed": "",
"mode": "fixed"
},
"textConfig": {
"fontSize": 12,
"offsetX": 0,
"offsetY": 0,
"textAlign": "center",
"textBaseline": "middle"
}
}
},
"location": {
"latitude": "Latitude",
"longitude": "Longitude",
"mode": "coords"
},
"name": "Layer 1",
"type": "markers"
}
],
"view": {
"id": "coords",
"lat": -31.123456,
"lon": 115.123456,
"zoom": 8
}
},
"pluginVersion": "8.3.3",
"targets": [
{
"datasource": {
"type": "grafana-timestream-datasource",
"uid": "oZN0qnonz"
},
"queryType": "raw",
"rawQuery": "SELECT Rover_Latitude as Latitude, Rover_Longitude as Longitude, Heading, time from $__database.$__table WHERE $__timeFilter",
"refId": "A"
}
],
"title": "Panel Title",
"type": "geomap"
},
Query Data
The query inspector shows that data is returned from AWS Timestream with the appropriate precision
{
"request": {
"url": "api/ds/query",
"method": "POST",
"data": {
"queries": [
{
"datasource": {
"uid": "oZN0qnonz",
"type": "grafana-timestream-datasource"
},
"queryType": "raw",
"rawQuery": "SELECT Rover_Latitude as Latitude, Rover_Longitude as Longitude, Heading, time from $__database.$__table WHERE $__timeFilter",
"refId": "A",
"database": "",
"table": "",
"measure": "",
"datasourceId": 1,
"intervalMs": 1000,
"maxDataPoints": 1840
}
],
"range": {
"from": "2022-01-06T08:46:54.022Z",
"to": "2022-01-06T09:16:54.022Z",
"raw": {
"from": "now-30m",
"to": "now"
}
},
"from": "1641458814022",
"to": "1641460614022"
},
"hideFromInspector": false
},
"response": {
"results": {
"A": {
"frames": [
{
"schema": {
"refId": "A",
"meta": {
"custom": {
"executionFinishTime": 1641460616173,
"executionStartTime": 1641460614838,
"queryId": "AEDACANBOHWMFLIGCXNNMJORFFNYZ7PUCHQJ72QJ4USQ7DV23Y4TE4SUO7RQ3QQ",
"status": {
"CumulativeBytesMetered": 10000000,
"CumulativeBytesScanned": 11051,
"ProgressPercentage": 100
},
"fetchStartTime": 1641460614024,
"fetchEndTime": 1641460615597,
"fetchTime": 1573
},
"executedQueryString": "SELECT Rover_Latitude as Latitude, Rover_Longitude as Longitude, Heading, time from \"wifi_survey\".\"wifi_survey\" WHERE time BETWEEN from_milliseconds(1641458814022) AND from_milliseconds(1641460614022)",
"stats": [
{
"displayName": "Execution time (Grafana server ⇆ Timestream)",
"value": 1335,
"unit": "ms",
"decimals": 2
},
{
"displayName": "Fetch time (Browser ⇆ Grafana server w/o Timestream)",
"value": 238,
"unit": "ms",
"decimals": 2
},
{
"displayName": "Fetch overhead",
"value": 15.130324221233312,
"unit": "percent"
}
]
},
"fields": [
{
"name": "Latitude",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
}
},
{
"name": "Longitude",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
}
},
{
"name": "Heading",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
}
},
{
"name": "time",
"type": "time",
"typeInfo": {
"frame": "time.Time"
}
}
]
},
"data": {
"values": [
[
-31.123456,
-31.123456,
-31.123456,
-31.123456,
-31.123456,
-31.123456,
-31.123456,
-31.123456,
-31.123456,
-31.123456,
-31.123456,
-31.123456,
-31.123456,
-31.123456,
-31.123456,
-31.123456,
-31.123456,
-31.123456,
-31.123456,
-31.123456,
-31.123456,
-31.123456,
-31.123456,
-31.123456
],
[
115.123456,
115.123456,
115.123456,
115.123456,
115.123456,
115.123456,
115.123456,
115.123456,
115.123456,
115.123456,
115.123456,
115.123456,
115.123456,
115.123456,
115.123456,
115.123456,
115.123456,
115.123456,
115.123456,
115.123456,
115.123456,
115.123456,
115.123456,
115.123456
],
[
290.5,
290.5,
290.5,
290.5,
290.5,
290.5,
290.5,
290.5,
290.5,
290.5,
290.5,
290.5,
290.5,
290.5,
290.5,
290.5,
290.5,
290.5,
290.5,
247.5,
46.5,
46.5,
46.5,
46.5,
46.5
],
[
1641458854059,
1641458895059,
1641458938059,
1641458980059,
1641459021059,
1641459063059,
1641459105059,
1641459146059,
1641459188059,
1641459230059,
1641459272059,
1641459314059,
1641459355059,
1641459397059,
1641459438059,
1641459480059,
1641459522059,
1641459563059,
1641459603059,
1641459644059,
1641459684059,
1641459725059,
1641459766059
]
]
}
}
],
"refId": "A"
}
}
}
}
NB data has been slightly obfuscated
Data gets cast to int?
When it comes time to process or display the data it gets converted to an integer and all precision is lost, as if the data is being typecast to an integer
My first assumption was that the data needed to be in degrees minutes and seconds. However the map itself uses decimal position notation with no problems
I have struggled to find any examples or documentations about the Geomaps and the data format. I am quite a novice with Grafana but I cant find any setting or parameter that would trigger this type casting and I’ve spent the better part of a day trying to identify what is causing this loss of precision. Any help would be much appreciated!