大约需要 15 分钟,Sensu 发送的指标才会出现在 Graphite 中。
问题
- 为什么需要 15 分钟?
- 是否有可能加快这一进程?
讨论
虽然已配置保留 1 分钟:
/opt/graphite/conf/storage-schemas.conf
[carbon]
pattern = ^carbon\.
retentions = 60:90d
[default_1min_for_1day]
pattern = .*
retentions = 60s:1d
以及 sensu 客户端:
/var/log/sensu/sensu-client.log
{"timestamp":"2016-08-16T23:17:54.131805+0000","level":"info","message":
"publishing check result","payload":{"client":"rhel","check":{"type":"metric",
"command":"/etc/sensu/plugins/metrics-memory-percent.rb","handlers":["relay"],
"name":"load_metrics3","issued":1471389473,"interval":10,"subscribers":["ALL"],
"executed":1471389473,"duration":0.226,
"output":"box01-ubuntu.memory_percent.free 3.6590918167658453
1471389474\nbox01-ubuntu.memory_percent.buffers 0.0 1471389474\nbox01-ubuntu.memory_percent.cached 22.651064339630178 1471389474\n
box01-ubuntu.memory_percent.dirty 0.01837134070849475 1471389474\n
box01-ubuntu.memory_percent.swapUsed 7.438716420871131 1471389474\
nbox01-ubuntu.memory_percent.usedWOBuffersCaches 73.68984384360398 1471389474\nbox01-ubuntu.memory_percent.freeWOBuffersCaches 26.310156156396022 1471389474\n","status":0}}}
作为石墨日志活动:
/opt/graphite/storage/log/carbon-cache/carbon-cache-a/creates.log
16/08/2016 23:14:29 :: new metric box01-ubuntu.memory_percent.freeWOBuffersCaches
matched schema default_1min_for_1day
图表在 15 分钟后出现。
该问题是由于 sensu-server 上的时间与 sensu-clients 不同步引起的。