如何在尝试使用一个呼叫中插入InfluxDB中的用户定义数据列表的所有元素中添加不同的标签

发布于 2025-01-21 05:54:51 字数 605 浏览 4 评论 0 原文

我正在尝试在InfluxDB服务器中插入用户定义的数据类别的整个列表,并为每个列表提供不同的标签,同时还使用单个写入调用。我正在使用aioinflux。

这可能吗? 到目前为止,我一直在看 aioinflux.influxdbclient 's 写入函数。

我看到它具有 tag_columns 参数,但是文档表明它只能与DataFrames一起使用。然后是 extair_tag 参数,但是由于我想使用 使用 单个写下呼叫,因此该方法在这种情况。

有什么想法吗?

I'm trying to insert an whole list of user-defined dataclasses in my influxdb server, and provide different tags to each, while also using a single write call. I'm using aioinflux.

Is this possible?
So far, I've been looking at the aioinflux.InfluxDBClient's write function.

I see that there it has a tag_columns argument, but the docs indicate that it can only be used in tandem with dataframes. Then there is the extra_tags argument, but since I want to write a list of dataclasses using a single write call, the method seems rather useless in this case.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

寂寞花火° 2025-01-28 05:54:51

extair_tags 参数对用户定义的数据级对象没有影响。

进行了一些随机搜索后,我发现此表这表明可以通过将标签组成数据级别的一部分来向每个数据点添加标签。这样,就可以插入dataclasses 的估计性,请确保它们具有标签。

I was waylaid by how the write function is structured. Basically, it seems that its extra_tags argument has no effect on user-defined dataclass objects.

After doing a little bit of random searching I found out this table which suggests that one can add tags to each datapoint by making the tags part of the dataclass. This way, one can insert an Iterable of dataclasses and make sure that they have tags.

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