我的應用程序生產者計數器。我想用grafana來查看它們。看來grafana
取決於influxDB
或elasticsearch
。如何模仿grafana後端?
有沒有辦法讓grafana
從我自己的應用程序讀取數據,所以我不需要將它們存儲在另一個後端?
我的應用程序生產者計數器。我想用grafana來查看它們。看來grafana
取決於influxDB
或elasticsearch
。如何模仿grafana後端?
有沒有辦法讓grafana
從我自己的應用程序讀取數據,所以我不需要將它們存儲在另一個後端?
您可以使用此插件:
要使用2.6版本配置它做到以下幾點: 把插件的文件到文件夾,讓我們說,「genericdatasource」。 然後將此文件夾複製到/ public/app/plugins/datasource /。 在directives.js
的query.editor.html
到變化templateUrl
:
'public/app/plugins/datasource/genericdatasource/partials/query.editor.html'
也改變query.options.html
templateUrl
到:
'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
這是這一個幾乎字的字重複:http://stackoverflow.com/q/26913267/2413043 – amenthes