我的应用程序生产者计数器。我想用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