功能实现完后有部分数据一直在波动,就产生了想把这个数据波动集成到grafana形成可视化界面的监控,但grafana不支持mongo数据库又懒得去用其他工具转换,特意看了下grafana的database插件,因此看到了json数据源。
JSON Datasource - a generic backend datasource
JSON Datasource is an enhanced version of the Simple JSON Datasource.
The JSON datasource executes JSON requests against arbitrary backends. To work with this datasource the backend needs to implement 4 urls:
/
should return 200 ok. Used for "Test connection" on the datasource config page./search
used by the find metric options on the query tab in panels./query
should return metrics based on input./annotations
should return annotations.