2014-12-25 116 views
0

我的應用程序生產者計數器。我想用grafana來查看它們。看來grafana取決於influxDBelasticsearch如何模仿grafana後端?

有沒有辦法讓grafana從我自己的應用程序讀取數據,所以我不需要將它們存儲在另一個後端?

+0

這是這一個幾乎字的字重複:http://stackoverflow.com/q/26913267/2413043 – amenthes

回答

0

您可以在應用程序和Grafana之間包含OpenTSDB數據源。

像這樣:

datasources: { 
    'OpenTSDB-TEST': { 
     default: true, 
     type: 'opentsdb', 
     url: "http://my_opentsdb_server:4242" 
    } 
} 

查看更多OpenTSDB配置細節here

0

您可以使用此插件:

要使用2.6版本配置它做到以下幾點: 把插件的文件到文件夾,讓我們說,「genericdatasource」。 然後將此文件夾複製到/ public/app/plugins/datasource /。 在directives.jsquery.editor.html到變化templateUrl

'public/app/plugins/datasource/genericdatasource/partials/query.editor.html' 

也改變query.options.htmltemplateUrl到:

'public/app/plugins/datasource/genericdatasource/partials/query.options.html' 

plugin.json變化module到:

'app/plugins/datasource/genericdatasource/datasource', 

和改變config到:

'public/app/plugins/datasource/genericdatasource/partials/config.html' 

然後重新啓動grafana-server。新數據源現在應該在添加數據源視圖中的數據源類型下拉列表中可用。

使用選項「代理」(不是「直接」)可以正確處理跨域請求。

你只需要在你的後端實現3個方法:/,搜索,查詢。

的例子看這裏:

https://gist.github.com/bergquist/bc4aa5baface3cffa109 
https://gist.github.com/tral/1fe649455fe2de9fb8fe