如何通过AWS timestream在Grafana中设置时间序列图 - 获取(数据缺少一个数字字段)

发布于 2025-02-11 06:36:57 字数 854 浏览 1 评论 0原文

我在aws timeStream数据库中有以下数据集:

在Grafana内部,我可以获取数据并显示为表:如下:

如果我选择显示数据作为时间序列,则会收到以下错误:数据缺少一个数字字段

即使在建议面板中也没有时间序列选项

有人知道可能是什么问题以及如何解决问题? 所需的输出是w_flow字段的线路聊天(时间序列)。

I have the following set of data in a AWS Timestream database:
enter image description here

Inside Grafana I can get the data and display as a table like following:
enter image description here

If I select display data as time series I get the following error: Data is missing a number field
enter image description here

Even in the suggestion panel there is no time series option
enter image description here

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

笑着哭最痛 2025-02-18 06:36:57

这里有两个问题:

  1. 您正在使用varchar来存储措施,而不是双打。虽然您可以进行演员(Mene_value :: varchar为double)总是更好地将其存储为双重。

  2. 在时间流中,将数据转换为时间序列,您需要使用以下命令:

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:

  1. 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.

  2. 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

荒芜了季节 2025-02-18 06:36:57

我在一些数据中遇到了同样的问题,这是错误的类型。对我有用的是在编辑面板时的“变换”选项卡中,我能够将值设置为数字。

将字段类型转换为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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文