zoukankan      html  css  js  c++  java
  • grafana使用json数据源监控数据

    功能实现完后有部分数据一直在波动,就产生了想把这个数据波动集成到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.

    官方说明中写的也比较清楚,一共实现4个接口,简单说明一下就是:

    /:啥都不用做,response返回200即可,用于绑定数据源的时候校验联通性
    /search:返回指标,实际就是metric,用户配置
    /query:返回指标值,实际就是(值,时间点)的列表,用于查询值
    /annotations:返回注解,用于配置

    具体参数可以参考下官方github

  • 相关阅读:
    BufferedOutputStream
    BufferedInputStream
    IO异常 的处理
    FileOutStream
    FileInputStream
    File常用的方法
    IO流
    枚举
    jdk1.5新特性之-----自动装箱与自动拆箱
    jdk1.5新特性之------->可变参数
  • 原文地址:https://www.cnblogs.com/zqyx/p/10114974.html
Copyright © 2011-2022 走看看