如何通过AWS timestream在Grafana中设置时间序列图 - 获取(数据缺少一个数字字段)
I have the following set of data in a AWS Timestream
database:
Inside Grafana I can get the data and display as a table like following:
If I select display data as time series I get the following error: Data is missing a number field
Even in the suggestion panel there is no time series option
Does someone know what could be the issue and how to fix it?
The desired output is a line chat (time series) of w_flow
field.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这里有两个问题:
您正在使用varchar来存储措施,而不是双打。虽然您可以进行演员(Mene_value :: varchar为double)总是更好地将其存储为双重。
在时间流中,将数据转换为时间序列,您需要使用以下命令:
create_time_series(time,meal_value ::< data_type> gt;),如我们在此处指定的:
https://docs.aws.aws.aws.amazon.com/timestream/timestream/timestream/latest/latest/latest/developerguide/teveloperguide/timeseries-specific-specific-consconts .views.html 。
在您的特定情况下,查询看起来像这样:
选择w_flow,create_time_series(time,cast(meal_value :: var as as double))为w_flow_value w_flow_db.w_flow
w_flow组的组
以使用其他任何时间序列函数,您需要调用相同的函数以传递时间序列,如所需的参数,如下所示:
https://docs.aws.aws.aws.ahazon.com/timesteram/timesteram/timesteram/timesteram/latest/latest/latest/develoverguide/times-specific-specific-consific-conscorcific-conscorts-.- functions.interpolation.html
这可能最终看起来像这样:
选择w_flow,interpaly_linear(create_time_series(time,cast(meal_value :: varchar)为double)),)……
希望这会有所帮助
Two issues here:
You are using VARCHAR to store the measures, not doubles. While you could do a CAST(measure_value::varchar AS DOUBLE) is always better to store it as a double from the start.
In Timestream to transform your data into a time series you need to use the following command:
CREATE_TIME_SERIES(time, measure_value::<data_type>) as specified in our documentation here:
https://docs.aws.amazon.com/timestream/latest/developerguide/timeseries-specific-constructs.views.html.
In your specific case the query will look something like this:
Select w_flow, CREATE_TIME_SERIES(time, CAST(measure_value::varchar as DOUBLE)) as w_flow_value from w_flow_db.w_flow
Group by w_flow
To use any of the other time series specific function you will need to call the same function to pass the time series as the required parameter as seen here :
https://docs.aws.amazon.com/timestream/latest/developerguide/timeseries-specific-constructs.functions.interpolation.html
That would probably end up looking like this:
Select w_flow, INTERPOLATE_LINEAR(CREATE_TIME_SERIES(time, CAST(measure_value::varchar as DOUBLE)), )…
Hope this helps
我在一些数据中遇到了同样的问题,这是错误的类型。对我有用的是在编辑面板时的“变换”选项卡中,我能够将值设置为数字。
将字段类型转换为numeric -grafana
I was getting the same issue with some data that was the wrong type. What worked for me is in the 'Transform' tab when editing the panel, I was able to set the values as numeric.
Convert Field Type to Numeric - grafana