Web monitor by black_exporter  
Just one Table Widget to display the Certificate and Connection Status from HTTP Connections that are Monitored with Prometheus.

使用Prometheus black_exporter 对web站点进行监控
Web monitor by black_exporter  
使用Prometheus black_exporter对站点进行监控  
> 本面板本是使用中文做标题，但在在上传时不允许出现中文，故将其改为英文，使用者自行调整。  
https://blog.csdn.net/sawyerlan/article/details/118097676
Just one Table Widget to display the Certificate and Connection Status from HTTP Connections that are Monitored with Prometheus.
{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "Prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "7.5.3"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "stat",
      "name": "Stat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "Just one Table Widget to display the Certificate and Connection Status from HTTP Connections that are Monitored with Prometheus.\n\n使用Prometheus black_exporter 对web站点进行监控",
  "editable": true,
  "gnetId": 14603,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1624289852569,
  "links": [],
  "panels": [
    {
      "datasource": null,
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 7,
        "w": 3,
        "x": 0,
        "y": 0
      },
      "id": 8,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "7.5.3",
      "targets": [
        {
          "exemplar": true,
          "expr": "count(probe_http_status_code{project=~\"$project\"})",
          "interval": "",
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "Web Number",
      "type": "stat"
    },
    {
      "datasource": null,
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": null,
            "filterable": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "instance"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 288
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value"
            },
            "properties": [
              {
                "id": "unit",
                "value": "s"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 7,
        "w": 21,
        "x": 3,
        "y": 0
      },
      "id": 11,
      "options": {
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "7.5.3",
      "targets": [
        {
          "exemplar": true,
          "expr": "probe_ssl_earliest_cert_expiry{project=~\"$project\"} - time() < 3600*24*30",
          "format": "table",
          "instant": true,
          "interval": "",
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "30d Exprie",
      "transformations": [
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "desc",
                "env",
                "instance",
                "project",
                "Value"
              ]
            }
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {},
            "indexByName": {
              "Value": 4,
              "desc": 1,
              "env": 2,
              "instance": 3,
              "project": 0
            },
            "renameByName": {}
          }
        }
      ],
      "type": "table"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "fieldConfig": {
        "defaults": {},
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 7
      },
      "hiddenSeries": false,
      "id": 6,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": true,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "7.5.3",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "exemplar": true,
          "expr": "sum(probe_duration_seconds{project=~\"$project\"}) by (instance)",
          "interval": "",
          "legendFormat": "",
          "queryType": "randomWalk",
          "refId": "A"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "ResponseTIme",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "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
      }
    },
    {
      "datasource": "${DS_PROMETHEUS}",
      "fieldConfig": {
        "defaults": {
          "custom": {
            "align": null,
            "filterable": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Value #B"
            },
            "properties": [
              {
                "id": "decimals",
                "value": 2
              },
              {
                "id": "unit",
                "value": "dtdurations"
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "green",
                      "value": null
                    },
                    {
                      "color": "red",
                      "value": 1
                    },
                    {
                      "color": "#EAB839",
                      "value": 2592000
                    },
                    {
                      "color": "green",
                      "value": 5184000
                    }
                  ]
                }
              },
              {
                "id": "custom.displayMode",
                "value": "color-background"
              },
              {
                "id": "custom.displayMode",
                "value": "color-background"
              },
              {
                "id": "noValue",
                "value": "非HTTPS"
              },
              {
                "id": "displayName",
                "value": "证书剩余过期时间"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "instance"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 436
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "project"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 71
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #A"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 72
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #D"
            },
            "properties": [
              {
                "id": "unit",
                "value": "dateTimeAsIso"
              },
              {
                "id": "custom.align",
                "value": null
              },
              {
                "id": "displayName",
                "value": "过期时间"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "剩余天数"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 213
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "desc"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 137
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "env"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 59
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #C"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 88
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "站点描述"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 131
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "网址"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 449
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "返回状态码"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "red",
                      "value": null
                    },
                    {
                      "color": "green",
                      "value": 200
                    },
                    {
                      "color": "red",
                      "value": 500
                    }
                  ]
                }
              },
              {
                "id": "custom.displayMode",
                "value": "color-background"
              },
              {
                "id": "custom.width",
                "value": 98
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "项目"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 108
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "环境"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 55
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "响应时间(s)"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 98
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "证书剩余过期时间"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 185
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "过期时间"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 175
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "网址"
            },
            "properties": [
              {
                "id": "links",
                "value": [
                  {
                    "targetBlank": false,
                    "title": "Detail",
                    "url": "http://grafana.pt.hydee.cn/d/45eP1vYMz/zhan-dian-ke-yong-xing?orgId=1&var-url=${__data.fields.网址:percentencode}"
                  }
                ]
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 19,
        "w": 24,
        "x": 0,
        "y": 14
      },
      "id": 9,
      "options": {
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "7.5.3",
      "targets": [
        {
          "exemplar": true,
          "expr": "probe_http_status_code{project=~\"$project\"}",
          "format": "table",
          "instant": true,
          "interval": "",
          "legendFormat": "",
          "queryType": "randomWalk",
          "refId": "A"
        },
        {
          "exemplar": true,
          "expr": "probe_ssl_earliest_cert_expiry{project=~\"$project\"}-time()",
          "format": "table",
          "instant": true,
          "interval": "",
          "legendFormat": "",
          "refId": "B"
        },
        {
          "exemplar": true,
          "expr": "probe_ssl_earliest_cert_expiry{project=~\"$project\"}*1000",
          "format": "table",
          "instant": true,
          "interval": "",
          "legendFormat": "",
          "refId": "D"
        },
        {
          "exemplar": true,
          "expr": "(sum(probe_http_duration_seconds{project=~\"$project\"}) by (instance))*1",
          "format": "table",
          "instant": true,
          "interval": "",
          "legendFormat": "",
          "refId": "E"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Web Mon",
      "transformations": [
        {
          "id": "seriesToColumns",
          "options": {
            "byField": "instance"
          }
        },
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "instance",
                "desc 1",
                "env 1",
                "project 1",
                "Value #A",
                "Value #B",
                "Value #C",
                "Value #D",
                "Value #E"
              ]
            }
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {},
            "indexByName": {
              "Value #A": 5,
              "Value #B": 6,
              "Value #C": 7,
              "Value #D": 8,
              "Value #E": 4,
              "desc 1": 2,
              "env 1": 3,
              "instance": 1,
              "project 1": 0
            },
            "renameByName": {
              "Value #A": "返回状态码",
              "Value #B": "",
              "Value #C": "响应时间",
              "Value #E": "响应时间(s)",
              "desc 1": "站点描述",
              "env 1": "环境",
              "instance": "网址",
              "project 1": "项目"
            }
          }
        }
      ],
      "type": "table"
    }
  ],
  "schemaVersion": 27,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": ".*",
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(probe_http_status_code, project)",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": true,
        "label": "项目",
        "multi": false,
        "name": "project",
        "options": [],
        "query": {
          "query": "label_values(probe_http_status_code, project)",
          "refId": "StandardVariableQuery"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "",
  "title": "Web monitor by black_exporter  ",
  "uid": "r8eWoHpGz",
  "version": 17
}