【问题标题】:graphite - last few datapoints are null when aggregating石墨 - 聚合时最后几个数据点为空
【发布时间】:2017-09-21 06:56:45
【问题描述】:

如果我获取前 1 小时的渲染(禁用缓存),我会得到当前时间的所有数据点。此处未聚合,显示每秒 1 次更新。例如,

http://graphite/render?target=local.metric.path&from=-1h&format=json&cacheTimeout=0

... [-2960.12, 1505975193], [-2960.12, 1505975194], [-2960.12, 1505975195], [-2960.12, 1505975196], [-2960.12, 1505975197], [-2960.12, 1505975198], [-2960.12, 1505975199], [-2960.12, 1505975200], [-2960.12, 1505975201], [null, 1505975202]]}]

太棒了。但是如果我现在将渲染提升到之前的 2 小时,现在可以看到它在 5 秒时聚合数据,并且最后几个点都是“空”。

... [-2775.75, 1505975390], [-2667.612, 1505975395], [-2595.52, 1505975400], [-2595.52, 1505975405], [-2595.52, 1505975410], [-2595.52, 1505975415], [-2595.52, 1505975420], [-2595.52, 1505975425], [-2595.52, 1505975430], [-2595.52, 1505975435], [null, 1505975440], [null, 1505975445], [null, 1505975450], [null, 1505975455], [null, 1505975460], [null, 1505975465], [null, 1505975470], [null, 1505975475], [null, 1505975480], [null, 1505975485], [null, 1505975490], [null, 1505975495], [null, 1505975500], [null, 1505975505], [null, 1505975510], [null, 1505975515], [null, 1505975520], [null, 1505975525], [null, 1505975530], [null, 1505975535], [null, 1505975540], [null, 1505975545], [null, 1505975550], [null, 1505975555], [null, 1505975560], [null, 1505975565], [null, 1505975570], [null, 1505975575]]}]

进一步挖掘,空点都是在最后一次将指标写入磁盘上的耳语文件之后的所有点。

已尝试查看常见原因..

  • 指标更新为每秒 1 次,因此与耳语文件的最大保留率一样高。
  • xFilesFactor 为 0.5,但尝试通过耳语调整大小将其修改为 0,但没有任何变化。
  • 我们在 CentOS 7.2 上运行来自 epel 的 graphite-web 0.9.15

耳语信息看起来像..

[root@graphite]# whisper-info mymetric.wsp
maxRetention: 157680000
xFilesFactor: 0.0
aggregationMethod: average
fileSize: 1176592

Archive 0
retention: 3600
secondsPerPoint: 1
points: 3600
size: 43200
offset: 112

Archive 1
retention: 43200
secondsPerPoint: 5
points: 8640
size: 103680
offset: 43312
...

任何想法表示赞赏。 谢谢,

更新:添加 carbon.conf 聚合/缓存设置..

[cache]
MAX_CACHE_SIZE = inf
CACHE_QUERY_INTERFACE = 0.0.0.0
CACHE_QUERY_PORT = 7002
LOG_CACHE_HITS = False
LOG_CACHE_QUEUE_SORTS = True
CACHE_WRITE_STRATEGY = sorted

[aggregator]
MAX_AGGREGATION_INTERVALS = 5

【问题讨论】:

  • 提供carbon.confaggregatorcache 部分是最相关的。
  • 添加到描述中。让我知道你是否需要更多。谢谢

标签: graphite grafana


【解决方案1】:

访问多个 Whisper“保留存档”的查询将/可能返回 NULL 值。

例如,假设/opt/graphite/conf/storage-schemas.conf 说:

[default]
pattern = .*
retentions = 60s:1d,10m:1y

并且您在查询过去 1 天时获得值。查询过去 2 天将/可能导致过去 1 天的 NULL 值!

另外请注意,在更改保留配置时,应相应调整现有存档的大小:

(假设新配置为1m:400d 10m:3y,以减少意外访问多个“保留档案”的机会)

cd /opt/graphite/storage/whisper
# see the old size of the data store
du -skh
find ./ -type f -name '*.wsp' -exec whisper-resize.py --nobackup {} 1m:400d 10m:3y \;
# see the new size of the data store (Whisper preallocates what space it needs)
du -skh

编辑: 我还没有测试过,但 NULL 问题是否真的会发生,可能与实际数据点的稀疏程度有关,而 storage-aggregation.conf (doc) 中的 xFilesFactor 更改可能还需要运行 whisper-resize.py--xFilesFactor=new_value 如果 new_value 为 0.0,则从单个查询访问多个“保留档案”应该可以正常工作。

xFilesFactor 应该是一个介于 0 和 1 之间的浮点数,并指定前一个保留级别的插槽中的哪一部分必须具有非空值才能聚合为非空值。默认值为 0.5。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-17
    • 2014-12-18
    • 1970-01-01
    • 2017-09-01
    • 1970-01-01
    相关资源
    最近更新 更多