Graphite

為什麼 Graphite 中不直接顯示 sensu 指標?

  • April 20, 2017

大約需要 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 不同步引起的。

引用自:https://serverfault.com/questions/797250