我猜即使您已将 storage-aggregation.conf 修改为使用“aggregationMethod = sum”,但您已经创建的指标并没有更改它们的 aggregationMethod。storage-aggregation.conf 中的规则仅影响新指标。
要将现有指标更改为求和而不是平均,您需要使用 Whisper-resize.py。或者,您可以删除现有指标,然后使用 sum 重新创建它们。
这是您可能需要运行的示例:
whisper-resize.py --xFilesFactor=0.0 --aggregationMethod=sum /opt/graphite/storage/whisper/stats_counts/path/to/your/metric.wsp 10s:28d 1m:84d 10m:1y 1h:3y
确保以拥有该文件的同一用户身份运行它,或者至少确保完成后文件具有相同的所有权,否则它们将无法写入新数据。
如果您使用 statsd,另一种可能性是您只是在 stats 下使用指标而不是 stats_counts。从statsd 自述文件:
在传统设置中,比率直接记录在 stats.counter_name 下,而绝对计数可以在 stats_count.counter_name 下找到。通过禁用旧命名空间,现在可以在 stats.counters.counter_name.rate 和 stats.counters.counter_name.count 下找到这些值(带有默认前缀)。
基本上,使用 statsd 时,指标在不同命名空间下的聚合方式不同,并且您需要 stats_count 或 stats.counters 下的内容来获取应该相加的内容。