Prometheus+Grafana监控EMQ

EMQX+Prometheus+Grafana:MQTT 数据可视化监控实践 本文介绍了如何将EMQX 5.0的监控数据集成到Prometheus中,使用Grafana来展示EMQX的监控数据,并最终搭建出一个简单的MQTT数据可视化监控系统。 阅读详情

Prometheus和Grafana部署可以参考:https://blog.youkuaiyun.com/skh2015java/article/details/102572363,本文不再累述Prometheus的安装部署。

简述

     emq3.0以上版本和emq3.0以下版本使用的监控方法不同。emq3.0以下版本broker,需要使用emq_exporter,而3.0以上版本的插件中已经支持Prometheus。接下来我们分别说明这两个版本如何使用Prometheus+Grafana进行监控。

 

emq3.0以下版本

     安装emq_exporter

      下载地址:  https://github.com/nuvo/emq_exporter/releases

wget https://github.com/nuvo/emq_exporter/releases/download/v0.4.1/emq_exporter-0.4.1-linux.tar.gz

tar -zxvf emq_exporter-0.4.1-linux.tar.gz

      添加配置文件auth.json

cat > emq_exporter/auth.json << EOF
{ 
  "username":$EMQ_USERNAME, 
  "password":$EMQ_PASSWORD
}

      后台启动

nohup yourEmqExporterPath/emq_exporter >  yourLogPath/emq_exporter.stdout 2>&1 &

    emq_exporter默认监控9540端口

    在Prometheus的配置文件prometheus.yml中追加

 - job_name: 'emq'
    static_configs:
    - targets: ['localhost:9540']

    重启Prometheus服务即可

   curl http://localhost:9540/metrics

   如果配置成功则可以查看到对应的指标。

 

Grafana Import dashboard地址: https://grafana.com/grafana/dashboards/9963

dashboard对应的ID为9963

 

emqx3.0以上版本

emqx3.0需要下载pushgateway

下载地址为:https://github.com/prometheus/pushgateway/releases

解压后启动,默认端口是9091

登录emq的后台管理默认地址是:http://ip:18083,默认账号密码admin/public

点检插件管理界面,找到emqx_statsd点击Start按钮启用,

(ps:如果你修改了默认的9091端口,需要现在Config中配置)

prometheus配置文件prometheus.yml 中追加以下内容

- job_name: 'pushgateway'
    static_configs:
    - targets: ['localhost:9091']
      labels:
        instance: pushgateway

重启Prometheus

curl http://localhost:9540/metrics可以查看到emqx的指标。

emqx目前还没有可用的Grafana  dashboard模板

这是我自定义模板的json文件,仅供参考

{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "EMQ Status",
  "editable": true,
  "gnetId": 9963,
  "graphTooltip": 0,
  "id": 12,
  "links": [],
  "panels": [
    {
      "collapsed": false,
      "datasource": null,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 42,
      "panels": [],
      "title": "基础信息",
      "type": "row"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorPostfix": false,
      "colorPrefix": false,
      "colorValue": true,
      "colors": [
        "#bf1b00",
        "rgba(237, 129, 40, 0.89)",
        "#629e51"
      ],
      "datasource": null,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 4,
        "x": 0,
        "y": 1
      },
      "id": 4,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "erlang_vm_threads",
          "format": "time_series",
          "intervalFactor": 1,
          "refId": "A"
        }
      ],
      "thresholds": "0,1",
      "title": "EMQ 运行状态",
      "transparent": true,
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "运行中",
          "value": "1"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": null,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 4,
        "y": 1
      },
      "id": 12,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "emqx_connections_count",
          "format": "time_series",
          "intervalFactor": 1,
          "refId": "A"
        }
      ],
      "thresholds": "",
      "title": "EMQ 客户端连接数",
      "transparent": true,
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": null,
      "format": "decbytes",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 4,
        "x": 7,
        "y": 1
      },
      "id": 38,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "emqx_messages_received",
          "format": "time_series",
          "intervalFactor": 1,
          "refId": "A"
        }
      ],
      "thresholds": "",
      "title": "EMQ 接收流量",
      "transparent": true,
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "aliasColors": {},
      "bars": true,
      "dashLength": 10,
      "dashes": false,
      "datasource": null,
      "decimals": 2,
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 22,
        "w": 12,
        "x": 12,
        "y": 1
      },
      "id": 30,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": true,
        "max": false,
        "min": false,
        "rightSide": true,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": false,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null as zero",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "expr": "irate(emqx_messages_qos2_sent[2m])",
          "format": "time_series",
          "interval": "10s",
          "intervalFactor": 4,
          "legendFormat": "qos2_sent",
          "refId": "J"
        },
        {
          "expr": "irate(emqx_messages_qos2_received[2m])",
          "format": "time_series",
          "interval": "10s",
          "intervalFactor": 4,
          "legendFormat": "qos2_received",
          "refId": "K"
        },
        {
          "expr": "irate(emqx_messages_qos2_dropped[2m])",
          "format": "time_series",
          "interval": "10s",
          "intervalFactor": 4,
          "legendFormat": "qos2_dropped",
          "refId": "L"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "QOS 2",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorPostfix": false,
      "colorPrefix": false,
      "colorValue": true,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": null,
      "decimals": 0,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 4,
        "x": 0,
        "y": 3
      },
      "id": 10,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": "次",
      "postfixFontSize": "30%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "pushgateway_http_requests_total",
          "format": "time_series",
          "intervalFactor": 2,
          "refId": "A"
        }
      ],
      "thresholds": "",
      "title": "EMQ 采样次数",
      "transparent": true,
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": null,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 4,
        "y": 3
      },
      "id": 32,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "emqx_connections_max",
          "format": "time_series",
          "intervalFactor": 1,
          "refId": "A"
        }
      ],
      "thresholds": "",
      "title": "EMQ 最大连接数",
      "transparent": true,
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": null,
      "format": "decbytes",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 4,
        "x": 7,
        "y": 3
      },
      "id": 36,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "emqx_messages_sent",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "接收字节数",
          "refId": "A"
        }
      ],
      "thresholds": "",
      "title": "EMQ 发送流量",
      "transparent": true,
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "aliasColors": {},
      "bars": true,
      "dashLength": 10,
      "dashes": false,
      "datasource": "Prometheus",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 12,
        "w": 6,
        "x": 0,
        "y": 5
      },
      "id": 40,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": true,
        "hideZero": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": false,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null as zero",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "expr": "irate(emqx_packets_pingreq[2m])",
          "format": "time_series",
          "instant": false,
          "interval": "10s",
          "intervalFactor": 4,
          "legendFormat": "pingreq",
          "refId": "A"
        },
        {
          "expr": "irate(emqx_packets_pingresp[2m])",
          "format": "time_series",
          "interval": "10s",
          "intervalFactor": 4,
          "legendFormat": "pingresp",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "EMQ Ping消息",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "none",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": null,
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 12,
        "w": 6,
        "x": 6,
        "y": 5
      },
      "id": 8,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": true,
        "hideEmpty": false,
        "hideZero": false,
        "max": true,
        "min": false,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 2,
      "links": [],
      "nullPointMode": "null as zero",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 1,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "irate(emqx_bytes_sent[2m])",
          "format": "time_series",
          "instant": false,
          "interval": "",
          "intervalFactor": 2,
          "legendFormat": "上传",
          "refId": "A"
        },
        {
          "expr": "irate(emqx_bytes_received[2m])",
          "format": "time_series",
          "interval": "",
          "intervalFactor": 2,
          "legendFormat": "下载",
          "refId": "C"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "EMQ 瞬时流量",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "Bps",
          "label": "",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": true,
      "dashLength": 10,
      "dashes": false,
      "datasource": null,
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 6,
        "w": 12,
        "x": 0,
        "y": 17
      },
      "id": 18,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": true,
        "max": false,
        "min": false,
        "rightSide": true,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": false,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null as zero",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "expr": "irate(emqx_packets_connect[2m])",
          "format": "time_series",
          "hide": false,
          "interval": "10s",
          "intervalFactor": 4,
          "legendFormat": "connect",
          "refId": "B"
        },
        {
          "expr": "irate(emqx_packets_disconnect_received[2m])",
          "format": "time_series",
          "hide": false,
          "interval": "10s",
          "intervalFactor": 4,
          "legendFormat": "disconnect_received",
          "refId": "C"
        },
        {
          "expr": "irate(emqx_packets_disconnect_sent[2m])",
          "format": "time_series",
          "hide": false,
          "interval": "10s",
          "intervalFactor": 4,
          "legendFormat": "disconnect_sent",
          "refId": "F"
        },
        {
          "expr": "irate(emqx_packets_subscribe[2m])",
          "format": "time_series",
          "hide": false,
          "interval": "10s",
          "intervalFactor": 4,
          "legendFormat": "subscribe",
          "refId": "A"
        },
        {
          "expr": "irate(emqx_packets_unsubscribe[2m])",
          "format": "time_series",
          "hide": false,
          "interval": "10s",
          "intervalFactor": 4,
          "legendFormat": "unsubscribe",
          "refId": "G"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "EMQ 功能消息",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "collapsed": false,
      "datasource": null,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 23
      },
      "id": 44,
      "panels": [],
      "title": "消息监控",
      "type": "row"
    },
    {
      "aliasColors": {},
      "bars": true,
      "dashLength": 10,
      "dashes": false,
      "datasource": null,
      "decimals": 2,
      "fill": 2,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 0,
        "y": 24
      },
      "id": 16,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": true,
        "hideZero": false,
        "max": false,
        "min": false,
        "rightSide": true,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": false,
      "linewidth": 3,
      "links": [],
      "nullPointMode": "null as zero",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "expr": "irate(emqx_messages_qos0_received[2m])",
          "format": "time_series",
          "interval": "10s",
          "intervalFactor": 4,
          "legendFormat": "qos0_received",
          "refId": "A"
        },
        {
          "expr": "irate(emqx_messages_qos0_sent[2m])",
          "format": "time_series",
          "hide": false,
          "interval": "10s",
          "intervalFactor": 4,
          "legendFormat": "qos0_sent",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "QOS 0",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": true,
      "dashLength": 10,
      "dashes": false,
      "datasource": null,
      "decimals": 2,
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 11,
        "w": 12,
        "x": 12,
        "y": 24
      },
      "id": 28,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": true,
        "max": false,
        "min": false,
        "rightSide": true,
        "show": true,
        "sort": null,
        "sortDesc": null,
        "total": false,
        "values": true
      },
      "lines": false,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null as zero",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "expr": "irate(emqx_messages_qos1_sent[2m])",
          "format": "time_series",
          "interval": "10s",
          "intervalFactor": 4,
          "legendFormat": "qos1_sent",
          "refId": "A"
        },
        {
          "expr": "irate(emqx_messages_qos1_received[2m])",
          "format": "time_series",
          "interval": "10s",
          "intervalFactor": 4,
          "legendFormat": "qos1_received",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "QOS 1",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    }
  ],
  "refresh": false,
  "schemaVersion": 20,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": []
  },
  "time": {
    "from": "2019-10-15T05:26:01.533Z",
    "to": "2019-10-15T06:26:01.533Z"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "browser",
  "title": "EMQ 服务指标",
  "uid": "wI-3UvTWz",
  "version": 1
}

 

感谢

https://blog.youkuaiyun.com/zhaoenweiex/article/details/100185766

基于 Prometheus、Grafana 的 EMQ X 物联网 MQTT 服务器可视化运维监控 Prometheus (https://prometheus.io/) 是由 SoundCloud 开源监控告警解决方案,支持多维数据模型 (https://prometheus.io/docs/concepts/data_model/)(时序由 metric 名字和 k/v 的 labels 构成),具备灵活的查询语句(PromQL)(https://prometheus.io/docs/querying/basics/) ,支持多种数据采集 exporters (https://prom... 阅读详情

相关推荐

阿里云轻量应用服务器上5分钟搞定EMQ X MQTT集群搭建(附性能调优技巧)

本文详细介绍了在阿里云轻量应用服务器上快速搭建高可用EMQ X MQTT集群的完整流程,包括环境准备、集群配置、负载均衡设置和性能调优技巧。通过5分钟快速部署指南和实战优化建议,帮助开发者构建稳定可靠的企业级物联网通信平台,提升MQTT服务的高并发处理能力。

weixin_29248611的博客 414

Prometheus+EMQ监控

Prometheus+EMQ监控不同版本监控

weixin_45132767的博客 552

开源方案实战:基于EMQ X与Java客户端构建物联网数据到Kafka的高效桥接

本文详细介绍了如何基于EMQ X与Java客户端构建物联网数据到Kafka的高效桥接方案。通过环境准备、核心代码实现、生产环境实战经验及性能优化技巧,帮助开发者掌握低成本、高可靠的物联网数据接入与处理技术,特别适合中小团队和技术深度掌控需求的场景。

weixin_30919571的博客 500

Prometheus -- 09 -- Prometheus+Grafana搭建EMQ监控

emq_exporter 插件用于监控 EMQ 相关的性能指标,这里我们使用 Prometheus+Grafana 来搭建 EMQ 监控 一、安装 emq_exporter 上 emq_exporter 官网下载最新的 emq_exporter cd /usr/local/prometheus wget https://github.com/nuvo/emq_exporter/rel...

半日橙 1039

EMQ MQTT云服务实战:阿里云轻量服务器快速部署指南

本文详细介绍了如何在阿里云轻量应用服务器上快速部署EMQ MQTT云服务,包括服务器选购、安全组配置、Docker和Shell脚本两种安装方案,以及基础配置、功能验证和生产环境优化建议。通过实战指南,帮助开发者高效搭建物联网消息中间件,提升项目开发效率。

weixin_29250573的博客 131

emqx安装包,老版本的,新的版本没有http监听器

emqx安装包,老版本的,新的版本没有http监听器

EMQ2.0 管理监控API (REST API)

用户可以通过 REST API 查询 MQTT 客户端连接(Clients)、会话(Sessions)、订阅(Subscriptions)和路由(Routes)信息,还可以检索和监控服务器的性能指标和统计数据。 URL 地址 REST API 访问 URL 地址: http(s)????/host:8080/api/v2/ Basic 认证 REST API 采用 HTTP Basic 认证(Authentication): curl -v --basic -u : -k http://localhost:

longwuxin001的博客 1148

emqx-node-metrics-exporter

emqx-node-metrics-exporter

grafana模板_基于 Prometheus、Grafana 的 EMQ X 物联网 MQTT 服务器可视化运维监控

Prometheus (https://prometheus.io/) 是由 SoundCloud 开源监控告警解决方案,支持多维数据模型 (https://prometheus.io/docs/concepts/data_model/)(时序由 metric 名字和 k/v 的 labels 构成),具备灵活的查询语句(PromQL)(https://prometheus.io/doc...

weixin_32929205的博客 503

Rstan下载安装攻略

准备把Rtools删掉,重新下载(胡乱猜测是安装顺序的问题),但是卸载时显示Rtools被占用,但我已经把该关的都关了。这一问题的出现,直接让我卸载掉了Rstudio,又重新安装了一个,不过这次安装在另一个磁盘,因为原来的内存不多了。或者参考知乎,使用清华镜像网址进行下载:(知乎链接)https://zhuanlan.zhihu.com/p/346947595(清华下载链接)https://mirrors.tuna.tsinghua.edu.cn/CRAN/bin/windows/Rtools/

m0_64643017的博客 3101

反无人机技术实战解析:从探测到拦截的全方位防御策略

本文深入解析了反无人机(C-UAS)技术的全链条防御策略。从雷达、无线电频谱、光电等多维度探测技术,到数据融合与威胁评估,再到无线电干扰、导航诱骗及物理拦截等核心拦截手段,系统阐述了如何构建从探测到拦截的实战化防御体系,为关键设施、大型活动等场景提供定制化空域安全解决方案。

weixin_29230649的博客 405

grafana官方使用文档_基于 Prometheus、Grafana 的 EMQ X 物联网 MQTT 服务器可视化运维监控

Prometheus 是由 SoundCloud 开源监控告警解决方案,支持多维 数据模型(时序由 metric 名字和 k/v 的 labels 构成),具备灵活的查询语句(PromQL),支持多种数据采集 exporters;支持告警管理,基于指标实现告警监控;支持多种统计数据模型,图形化展示友好,图形展示除了内置的浏览器,也支持 Grafana 集成。物联网 MQTT 服务器 EMQ X 提...

weixin_39660931的博客 405

matlab 质心重合法实现点云配准【2026最新版】

质心重合法是将源点云和目标点云的质心重合,以此缩小两点云集之间的平移误差,从而为下一步粗配准提供更好的初始位置姿态。

点云侠的博客 510

grafana的+按钮_基于 Prometheus、Grafana 的 EMQ X 物联网 MQTT 服务器可视化运维监控...

Prometheus 是由 SoundCloud 开源监控告警解决方案,支持多维 数据模型(时序由 metric 名字和 k/v 的 labels 构成),具备灵活的查询语句(PromQL),支持多种数据采集 exporters;支持告警管理,基于指标实现告警监控;支持多种统计数据模型,图形化展示友好,图形展示除了内置的浏览器,也支持 Grafana 集成。物联网 MQTT 服务器 EMQ X 提...

weixin_35709851的博客 348

ParaView: 从 2 或 3 个标量创建向量

ParaView: 从 2 或 3 个标量创建向量

希望我的博客,能帮上你解决学习中工作中所遇到的问题 587

QT里获取UUID当做唯一文件名称

QT里获取UUID当做唯一文件名称

547

Prometheus和Grafana安装部署_prometheus+grafana 监控kafka菜鸟教程(1)

后台运行下载版本号为2.13.0,也可以根据自己需要下载其他版本解压配置在prometheus.yml配置文件中追加node_exporter的job,监控本机服务器注:如果需要监控多台服务器指标,则只需要在其他服务器上安装node_exporter即可,不需要安装prometheus。启动注:yourPath是prometheus可执行程序所在路径,yourLogPath是日志路径,prometheus默认会加载prometheus.yml文件进行初始化,默认端口为9090。

2301_82242351的博客 708

3D医学影像开发入门<一>:VS2019+DCMTK3.6.8编译及环境配置

3D医学影像开发入门:VS2019+DCMTK3.6.8编译及环境配置

欧特GO 1309

Prometheus+Grafana监控应用程序(process-exporter)

Prometheus是一套开源的监控&报警&时间序列数据库的组合,Prometheus监控服务器的基础资源(如:内存、CPU、网络等资源),也可以监控Kafka、MySQL、EMQ等消息中间件、日志监控,当然也可以监控某个进程(应用程序)或某几个进程(进程组)。 本文主要通过process-exporter 对进程进行监控,并介绍Process-exporter的...

skh2015java的博客 1万+

地图之家总目录

地图之家总目录 cesium示例 leaflet示例

GIS之家家长 1万+

《AgentScope-Java 深入浅出教程》第8章 工具高级特性

掌握工具组、预设参数、执行上下文等高级特性。

步子哥的博客 267

Prometheus -- 05 -- Prometheus+Grafana搭建MySQL监控

安装好 Prometheus 后,我们还需要安装 Exporter (用于抓取数据) 和 Grafana (用于可视化数据),进而才能搭建起一套可视化的监控系统;在此之前,我们先来了解两个概念 Exporter 和 Grafana Exporter Exporter 是 Prometheus 的一类数据采集组件的总称,它负责从目标处搜集数据,并将其转换为 Prometheus 支持的格式;...

半日橙 666

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

Prometheus -- 06 -- Prometheus+Grafana搭建Node监控

node_exporter 插件用于监控服务器相关的性能指标,这里我们使用 Prometheus+Grafana 来搭建 Node 监控 一、安装 node_exporter 上 Prometheus 官网下载最新的 node_exporter cd /usr/local/prometheus wget https://github.com/prometheus/node_expor...

半日橙 544

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

上一篇: Prometheus+Grafana监控Kafka
下一篇: MySQL添加索引
思维的深度
博客等级 码龄11年 2万+粉丝 391原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值