Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delayed readings have wrong time in grafana #43

Open
Claypuppet opened this issue May 2, 2019 · 7 comments
Open

Delayed readings have wrong time in grafana #43

Claypuppet opened this issue May 2, 2019 · 7 comments
Assignees
Labels
bug Something isn't working
Projects

Comments

@Claypuppet
Copy link
Member

Claypuppet commented May 2, 2019

-- updated
Grafana displays graph using time when the measurement reached the api, not the actual time of measurement.

@Claypuppet Claypuppet added the bug Something isn't working label May 2, 2019
@Claypuppet Claypuppet self-assigned this May 2, 2019
@Claypuppet Claypuppet added this to To do in bGeigieCast via automation May 2, 2019
@Claypuppet Claypuppet moved this from To do to In Progress in bGeigieCast May 7, 2019
@Claypuppet
Copy link
Member Author

Reading the logs again, it looks like it does send the correct time

// This is the current one, at time 02:39:27
{"captured_at":"2019-05-09T02:39:27Z","device_id":61346,"value":39,"unit":"cpm","longitude":139.6833,"latitude":35.6500}

// Oldest saved reading at time 02:39:12
{"captured_at":"2019-05-09T02:39:12Z","device_id":61346,"value":34,"unit":"cpm","longitude":139.6833,"latitude":35.6500}

// Second saved reading at time 02:39:17
{"captured_at":"2019-05-09T02:39:17Z","device_id":61346,"value":33,"unit":"cpm","longitude":139.6833,"latitude":35.6500}

// Third saved reading at time 02:39:22
{"captured_at":"2019-05-09T02:39:22Z","device_id":61346,"value":35,"unit":"cpm","longitude":139.6833,"latitude":35.6500}

@robouden
Copy link
Collaborator

robouden commented May 9, 2019

Good to hear that.

@Claypuppet
Copy link
Member Author

Claypuppet commented May 9, 2019

@robouden Looks like the issue is in grafana, Just did a little test
saved 3 readings (every 5 minutes) and then connect.

In grafana it show this

This is the json data as shown in grafana:

{"_id":"rWK8mmoBuDPbqS2pf8i9","_type":"measurement","_index":"ingest-measurements-2019-05-09","device_urn":"geigiecast:61346","device_sn":"bGeigiecast #61346","device":61346,"when_captured":"2019-05-09T03:51:39Z","loc_lat":35.65,"loc_lon":139.6833,"loc_olc":"8Q7XMM2M+283","lnd_7318u":24,"dev_test":true,"service_uploaded":["2019-05-09T03:56:45.000Z"],"service_transport":"geigiecast:126.208.181.33","service_md5":"b983b071983634151f1744c3af6dbc91","service_handler":"i-051cab8ec0fe30bcd","@timestamp":"2019-05-09T03:56:45Z","ingest":{"location":{"lat":35.65,"lon":139.6833}}}
--
{"_id":"rGK8mmoBuDPbqS2pfchV","_type":"measurement","_index":"ingest-measurements-2019-05-09","device_urn":"geigiecast:61346","device_sn":"bGeigiecast #61346","device":61346,"when_captured":"2019-05-09T03:46:37Z","loc_lat":35.65,"loc_lon":139.6833,"loc_olc":"8Q7XMM2M+283","lnd_7318u":34,"dev_test":true,"service_uploaded":["2019-05-09T03:56:44.000Z"],"service_transport":"geigiecast:126.208.181.33","service_md5":"db7853cca0fbb3e85ee84a46c81a5e66","service_handler":"i-051a2a353509414f0","@timestamp":"2019-05-09T03:56:45Z","ingest":{"location":{"lat":35.65,"lon":139.6833}}}
{"_id":"qmK8mmoBuDPbqS2pd8ia","_type":"measurement","_index":"ingest-measurements-2019-05-09","device_urn":"geigiecast:61346","device_sn":"bGeigiecast #61346","device":61346,"when_captured":"2019-05-09T03:56:41Z","loc_lat":35.65,"loc_lon":139.6833,"loc_olc":"8Q7XMM2M+283","lnd_7318u":37,"dev_test":true,"service_uploaded":["2019-05-09T03:56:43.000Z"],"service_transport":"geigiecast:126.208.181.33","service_md5":"ed7e560743dfd1deaae4d15fd1ddfdaf","service_handler":"i-051cab8ec0fe30bcd","@timestamp":"2019-05-09T03:56:43Z","ingest":{"location":{"lat":35.65,"lon":139.6833}}}
{"_id":"q2K8mmoBuDPbqS2peshV","_type":"measurement","_index":"ingest-measurements-2019-05-09","device_urn":"geigiecast:61346","device_sn":"bGeigiecast #61346","device":61346,"when_captured":"2019-05-09T03:41:36Z","loc_lat":35.65,"loc_lon":139.6833,"loc_olc":"8Q7XMM2M+283","lnd_7318u":37,"dev_test":true,"service_uploaded":["2019-05-09T03:56:44.000Z"],"service_transport":"geigiecast:126.208.181.33","service_md5":"58dae1dd3dc547c85b1fb252b046400b","service_handler":"i-0c65ac97805549e0d","@timestamp":"2019-05-09T03:56:44Z","ingest":{"location":{"lat":35.65,"lon":139.6833}}}

The when_captured is the moment it got captured and @ timestamp is the moment it got uploaded to the API. Grafana builds the graph based on the @ timestamp

@Claypuppet Claypuppet changed the title Saved readings have wrong time Delayed readings have wrong time in grafana May 9, 2019
@Claypuppet Claypuppet assigned robouden and unassigned Claypuppet May 9, 2019
@Claypuppet
Copy link
Member Author

@robouden I'll leave this to you for now

@Claypuppet Claypuppet moved this from In Progress to To do in bGeigieCast May 9, 2019
@robouden
Copy link
Collaborator

robouden commented May 9, 2019

ok

@robouden
Copy link
Collaborator

robouden commented May 9, 2019

We can build graphs based on "when_captured"..

@robouden
Copy link
Collaborator

robouden commented May 9, 2019

By changing:

" "query": "device_urn:"$device_urn"",
"rawQuery": false,
"rawSql": "SELECT\n $__time(time_column),\n value1\nFROM\n metric_table\nWHERE\n $__timeFilter(time_column)\n",
"refId": "A",
"select": [
[
{
"params": [
"value"
],
"type": "column"
}
]
],
"timeColumn": "time",
"timeField": "when_captured",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],"

@robouden robouden moved this from To do to In Progress in bGeigieCast May 9, 2019
@robouden robouden moved this from In Progress to Done in bGeigieCast May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
bGeigieCast
  
Done
Development

No branches or pull requests

2 participants