即使我向它发送数据,Graphite 对所有数据点都显示“无”

Jak*_*olý 8 monitoring graphite

我已经通过 Puppet ( https://forge.puppetlabs.com/dwerder/graphite ) 和 nginx 和 PostgresSQL安装了 Graphite 。当我手动发送数据时,它会创建指标,但它的所有数据点都是“无”(也称为空)。如果我运行 Graphite 附带的 example-client.py,也会发生这种情况。

echo "jakub.test 42 $(date +%s)" | nc 0.0.0.0 2003 # Carbon listens at 2003
# A minute or so later:
$ whisper-fetch.py --pretty /opt/graphite/storage/whisper/jakub/test.wsp | head -n1
Sun May  4 12:19:00 2014    None
$ whisper-fetch.py --pretty /opt/graphite/storage/whisper/jakub/test.wsp | tail -n1
Mon May  5 12:09:00 2014    None
$ whisper-fetch.py --pretty /opt/graphite/storage/whisper/jakub/test.wsp | grep -v None | wc -l
0
Run Code Online (Sandbox Code Playgroud)

和:

$ python /opt/graphite/examples/example-client.py 
# Wait until it sends two batches of data ...
$ whisper-fetch.py /opt/graphite/storage/whisper/system/loadavg_15min.wsp | grep -v None | wc -l
0
Run Code Online (Sandbox Code Playgroud)

根据 ngrep,这是到达端口的数据 [来自以后的尝试](第 3 行):

####
T 127.0.0.1:34696 -> 127.0.0.1:2003 [AP]
  jakub.test  45 1399362193. 
####^Cexit
23 received, 0 dropped
Run Code Online (Sandbox Code Playgroud)

这是的相关部分/opt/graphite/conf/storage-schemas.conf

[default]
pattern = .*
retentions = 1s:30m,1m:1d,5m:2y
Run Code Online (Sandbox Code Playgroud)

知道出了什么问题吗?Carbon 自己的指标和数据显示在 UI 中。谢谢!

环境:Ubuntu 13.10 Saucy,Graphite 0.9.12(通过 pip)。

PS:我在这里写了我的故障排除尝试 - Graphite 显示指标但没有数据 - 故障排除

更新

  1. 即使保留策略指定了更高的精度,例如“1s”或“10s”,密语文件中的数据点也仅每 1m 分钟记录一次。
  2. 忽略数据的解决方法:使用聚合模式xFilesFactor = 0.1(而不是 0.5)或将最低精度设置为 1m 而不是 <number between 1-49>s。- 请参阅已接受答案或石墨答案问题下方的评论。根据文档:“xFilesFactor应该是 0 到 1 之间的浮点数,并指定前一个保留级别的插槽中必须具有非空值的部分才能聚合为非空值。默认值为 0.5。 ”因此,似乎在不考虑指定精度 1s 的情况下,数据聚合到 1 分钟并最终为无,因为分钟期间少于 50% 的值是非无。

解决方案

所以@jlawrie 引导我找到解决方案。事实证明数据确实存在,但聚合为空,原因是双重的:

  1. UI 和whisper-fetch 都显示聚合到跨越整个查询周期(默认为24 小时)的最高精度的数据。即,任何保留 < 1d 的内容都不会显示在 UI 或获取中,除非您选择较短的时间段。由于我的 1 秒保留期是 30 分钟,因此我需要选择 <= 最后 30 分钟的时间段才能实际查看收集的最高精度的原始数据。
  2. 在聚合数据时(在我的情况下从 1 秒到 1 分钟),Graphite 默认要求该时间段内 50% (xFilesFactor = 0.5) 的数据点具有价值。如果没有,它将忽略现有值并将其聚合为 None。因此,在我的情况下,我需要在一分钟内至少发送 30 次数据(30 是 60 秒的 50% = 1 分钟),以便它们显示在聚合的 1 分钟值中。但是我的应用程序只每 10 秒发送一次数据,所以我只有 60 个可能的值中的 6 个。

=> 解决方案是将第一个精度从 1s 更改为 10s 并记住在我想查看原始数据时选择更短的时间段(或将其保留时间延长至 24h 以默认显示)。

小智 8

我使用同一个 puppet 模块遇到了同样的问题。我不确定为什么,但更改默认保留策略似乎可以解决它,例如

class { 'graphite':
  gr_storage_schemas => [
    {
      name       => 'carbon',
      pattern    => '^carbon\.',
      retentions => '1m:90d'
    },
    {
      name       => 'default',
      pattern    => '.*',
      retentions => '1m:14d'
    }
  ],
}
Run Code Online (Sandbox Code Playgroud)