postgresql - Grafana - unable to use unix as a timestamp? PostgreSQL
问题描述
I'm trying to set up a grafana based on PSQL data source, but I can not make grafane use UNIX timestamps for some reason. Here is a sample table, which is connected to grafana:
ticks=# select * from btc_usd limit 10;
time_stamp | quote | volume
---------------+---------+------------
1632793114709 | 42373.9 | 0.0231421
1632793114929 | 42372.2 | 0.011807
1632793115546 | 42373.9 | 0.00386025
1632793116352 | 42373.9 | 0.0011276
1632793116480 | 42372.4 | 0.0161129
1632793116513 | 42372.2 | 0.0358965
1632793116513 | 42372.2 | 0.0134995
1632793116513 | 42371.9 | 0.00990016
1632793117768 | 42373.8 | 0.00058705
1632793117808 | 42373.8 | 0.00221274
(called locally from postgres db)
And here are some queries I've tried so far in grafana:
SELECT * FROM btc_usd;
SELECT time_stamp AS "time", quote FROM btc_usd;
SELECT STR_TO_DATE(time_stamp,'%Y-%m-%d %H:%i:%s') AS 'time', quote FROM btc_usd;
No matter what I try, Grafana is throwing:
Data does not have a time field
and wont chart anything :/
Im able to display data as a table:
解决方案
推荐阅读
- c# - System.StackOverflowException C#
- authentication - why auth is frequently implemented using 2 redirects
- java - React JS 添加计数 JSON 元素
- php - 使用带有键值的数组的 php CURL 请求
- html - Blogger Emporio 主题:在主页片段上永久显示 Drop-Shadow
- java - 如何解决此问题“标准输出不应直接用于记录任何内容”
- contiki - RPL存储方式访问路由表(Contiki / Cooja)
- database - MongoDB $lookup 基于两种模式
- java - 使用和不使用组的 java 中正则表达式的不同行为
- flutter - 如何从 TextField 聚焦到 DropdownButton