2014-01-24 22 views
9

我使用statsd來測量統計數據,Graphite用於顯示這些數據。無論如何,我想在統計軟件中做一個更復雜的分析,找出各種變量之間的關係。Statsd&Graphite - 獲取數據爲CSV

爲了做到這一點,我需要「原始」數據,這些數據通常以彩色線的形式顯示在Graphite中。是否有可能以CSV格式獲取數據?數據採樣到每10秒1個條目將是完美的,這是statsd默認行爲,我想。

回答

14

是的。這很簡單。

Server: graphite.example.com 
Metric: Graphite.system.data.ip-10-0-0-1.load 

您可能已經知道,Graphite有一個URL API。

graphite.example.com/render/?target=Graphite.system.data.ip-10-0-0-1.load 

返回折線圖。要獲取數據csv甚至json,append- &format=json

graphite.example.com/render/?target=Graphite.system.data.ip-10-0-0-1.load&format=csv 
+0

酷,我會盡力。謝謝! –

+0

是的,它的效果很好。我也發現了圖形API本身。謝謝。 –