Grafana dashboard: Any JSON To Metrics
Description: An example for https://github.com/xxlaefxx/any-json-to-metrics exporter.

This simple exporter parses any JSON health (and not only health) endpoints and produce a set of metrics for Prometheus.
You can find details and examples on GitHub.

{
  "__inputs": [],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "7.0.4"
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    },
    {
      "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"
      }
    ]
  },
  "editable": true,
  "gnetId": 12608,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1594215885200,
  "links": [],
  "panels": [
    {
      "datasource": "$DS",
      "fieldConfig": {
        "defaults": {
          "custom": {
            "align": null,
            "displayMode": "color-text"
          },
          "mappings": [
            {
              "from": "",
              "id": 0,
              "operator": "",
              "text": "OK",
              "to": "",
              "type": 1,
              "value": "1"
            },
            {
              "from": "",
              "id": 1,
              "operator": "",
              "text": "NOK",
              "to": "",
              "type": 1,
              "value": "0"
            }
          ],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "green",
                "value": 0.9
              },
              {
                "color": "green",
                "value": 200
              },
              {
                "color": "red",
                "value": 201
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Healthcheck URL"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 440
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Resp. Code"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 134
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Scraped"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 103
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 23,
        "w": 9,
        "x": 0,
        "y": 0
      },
      "id": 3,
      "options": {
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "7.0.4",
      "targets": [
        {
          "expr": "scrape_success",
          "format": "table",
          "instant": true,
          "interval": "",
          "legendFormat": "{{instance}}",
          "refId": "A"
        },
        {
          "expr": "response_code",
          "format": "table",
          "instant": true,
          "interval": "",
          "legendFormat": "{{instance}}",
          "refId": "B"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Overall Status",
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "Time": true,
              "__name__": true,
              "job": true,
              "url": true
            },
            "indexByName": {},
            "renameByName": {
              "Time": ""
            }
          }
        },
        {
          "id": "seriesToColumns",
          "options": {
            "byField": "instance"
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {},
            "indexByName": {},
            "renameByName": {
              "Value #A": "Scraped",
              "Value #B": "Resp. Code",
              "instance": "Healthcheck URL"
            }
          }
        },
        {
          "id": "labelsToFields",
          "options": {}
        }
      ],
      "type": "table"
    },
    {
      "datasource": "$DS",
      "fieldConfig": {
        "defaults": {
          "custom": {
            "align": null,
            "displayMode": "color-background"
          },
          "mappings": [],
          "noValue": "---",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "green",
                "value": 1
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "__name__"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 353
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "text"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 318
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 75
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "instance"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 380
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 23,
        "w": 15,
        "x": 9,
        "y": 0
      },
      "id": 5,
      "interval": "",
      "options": {
        "showHeader": true,
        "sortBy": [
          {
            "desc": false,
            "displayName": "Value"
          }
        ]
      },
      "pluginVersion": "7.0.4",
      "targets": [
        {
          "expr": "{instance=~\"[[URL]]\", __name__=~\"anyjson.*(health|status).*\"}",
          "format": "table",
          "instant": true,
          "interval": "",
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Health Checks",
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "Time": true,
              "__name__": false,
              "job": true,
              "url": true
            },
            "indexByName": {},
            "renameByName": {}
          }
        }
      ],
      "type": "table"
    }
  ],
  "refresh": false,
  "schemaVersion": 25,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {
          "selected": false,
          "text": "Prometheus",
          "value": "Prometheus"
        },
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "DS",
        "options": [],
        "query": "prometheus",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "type": "datasource"
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "$DS",
        "definition": "label_values(scrape_success,url)",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "URL",
        "options": [],
        "query": "label_values(scrape_success,url)",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-15m",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "Any JSON To Metrics",
  "uid": "qVZgWlGGz",
  "version": 2,
  "description": "An example for https://github.com/xxlaefxx/any-json-to-metrics exporter."
}