- What Grafana version and what operating system are you using?
v9.1.5 (df015a9301)
- What are you trying to achieve?
I want to see same results in Grafana as I can see in psql console.
- How are you trying to achieve it?
Using same query in psql (1) and then Grafana (2).
- What happened?
Outputs from (1) and (2) are not identical.
- What did you expect to happen?
Same results.
- Can you copy/paste the configuration(s) that you are having problems with?
Query I am using:
SELECT
last_updated::date AS "time",
state::float
FROM states
WHERE
state not in ('unknown', 'unavailable', '') and entity_id = 'sensor.estimated_energy_production_sum_today';
In psql console I can see values like:
2022-11-03 14.52
2022-11-03 17.66
2022-11-04 8.68
2022-11-04 0.37
2022-11-04 0.38
2022-11-04 0.39
When I paste same query to Grafana and display it as table, I can see this:
2022-11-03 01:00:00 11.2
2022-11-03 01:00:00 14.5
2022-11-03 01:00:00 17.7
2022-11-03 01:00:00 8.68
2022-11-03 01:00:00 0.370
2022-11-04 01:00:00 0.380
2022-11-04 01:00:00 0.390
Problems:
- Grafana interpret date as datetime (I can live with this)
- Check value 0.370 ā in psql there is date
2022-11-04
, but in Grafana2022-11-03 01:00:00
. This is my problem (value 0.370 belong to2022-11-04
, not2022-11-03
)
Original data in my DB are stored with timezone:
2022-11-03 18:14:20.453231+01 11.21
2022-11-03 22:14:23.873654+01 14.52
2022-11-03 22:14:23.940703+01 17.66
2022-11-04 00:14:23.44796+01 8.68
2022-11-04 00:14:23.474613+01 0.37
2022-11-04 02:14:23.497958+01 0.38
2022-11-04 02:14:23.500527+01 0.39
2022-11-04 04:14:23.294223+01 0.38
- Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
No.
- Did you follow any online instructions? If so, what is the URL?
No.