telegraf不快速编写数据

发布于 2025-02-10 06:44:26 字数 565 浏览 1 评论 0原文

有没有办法让Telegraf更快地将输出写入CloudWatch?

这就是我的配置文件的样子。

[agent]
  interval = "10s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  precision = ""
  debug = false
  quiet = false
  logfile = ""
  hostname = ""
  omit_hostname = true

我的理解是,当收集新指标的metric_batch_size时,Telegraf会触发写作,或者在达到flush_interval之后。以第一个为准。

但是由于某种原因,没有写入CloudWatch,ND我必须不断增加我在CloudWatch中的搜索时间才能获取任何数据,这并不是很理想的。

我可能缺少一个设置吗?

Is there a way to get Telegraf to write output to Cloudwatch quicker?

This is what my configuration file looks like.

[agent]
  interval = "10s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  precision = ""
  debug = false
  quiet = false
  logfile = ""
  hostname = ""
  omit_hostname = true

My understanding is that Telegraf will trigger a write when metric_batch_size of new metrics is collected, or after the flush_interval is reached. Whichever comes first.

But for some reason, data isn't being written to Cloudwatch, nd I have to constantly increase my search time in Cloudwatch to get any data, which isn't quite ideal.

Is there a setting I might be missing?

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

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

发布评论

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

评论(1

抚你发端 2025-02-17 06:44:26

我的理解是,当收集新指标的metric_batch_size或达到flush_interval之后,Telegraf会触发写作。以第一位为准。

这是正确的。需要注意的几件事:

  1. 考虑在CloudWatch输出设置中启用high_resolution_metrics选项,以将精度更改为1秒而不是60秒。我确实在简短地使用CloudWatch插件中记得,发送指标有一些延迟,我相信这是原因,但我可能不记得这里的所有机制。

  2. 我会指出,您的收集间隔也是10秒。因此,当前您只打算每10秒收集一次数据。

  3. 这也取决于您配置中的输入,处理器和聚合器。您可能会有一个较慢的输入,该输入不会经常产生数据,或者有一个正在做一些聚合的配置也会减慢事物的速度。

  4. 我建议在带有的配置或CLI中进行调试的运行 - debug,然后查看何时,何时以及多少数据以及多久通过诸如:

2022-07-01T21:24:54Z D! [outputs.file] Wrote batch of 33 metrics in 161.641µs
2022-07-01T21:24:54Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics

My understanding is that Telegraf will trigger a write when metric_batch_size of new metrics is collected, or after the flush_interval is reached. Whichever comes first.

This is correct. A couple of things to note:

  1. Consider enabling the high_resolution_metrics option in the cloudwatch output setting to change the precision to 1 second instead of 60 seconds. I do recall in my brief usage of the cloudwatch plugin that there is some delay in sending metrics and I believe this is the reason, but I may not remember all the mechanics at place here.

  2. I would point out that your collection interval is also 10 seconds. So currently you are only ever going to collect data every 10 seconds.

  3. This is also dependent on your inputs, processors, and aggregators in your config. You could have a slower input that is not producing data often or have a config that is doing some aggregation slowing things down as well.

  4. I would suggest running with debug set to true in your config or CLI with --debug and see when and how much data and how often telegraf is writing to cloudwatch via messages like:

2022-07-01T21:24:54Z D! [outputs.file] Wrote batch of 33 metrics in 161.641µs
2022-07-01T21:24:54Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文