Grafana dashboard: HTTP Response Monitoring
Description: A very simple and visual Dashboard to monitor HTTP Responses using the native http_response from Telegraf. It just works automatically once the sources are added to telegraf.


{
  "__inputs": [
    {
      "name": "DS_INFLUXDB",
      "label": "InfluxDB",
      "description": "",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    }
  ],
  "__elements": {},
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "9.2.0"
    },
    {
      "type": "datasource",
      "id": "influxdb",
      "name": "InfluxDB",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "stat",
      "name": "Stat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    },
    {
      "type": "panel",
      "id": "timeseries",
      "name": "Time series",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "datasource",
          "uid": "grafana"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "limit": 100,
        "name": "Annotations & Alerts",
        "showIn": 0,
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "description": "A very simple and visual Dashboard to monitor HTTP Responses using the native http_response from Telegraf. It just works automatically once the sources are added to telegraf.",
  "editable": true,
  "fiscalYearStartMonth": 0,
  "gnetId": 18491,
  "graphTooltip": 0,
  "id": null,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 21,
      "title": "Valid URLs",
      "type": "row"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_INFLUXDB}"
      },
      "description": "Monitoring of the HTTP Response. On the Title of the widget you can find the Website name, and on the value the current response of the HTTP or HTTPS.\n\nThresholds are:\n* Results with 20x , Green\n* Results with 30x , Orange\n* Results with 40x , Red\n* Results with 50x , Blue",
      "fieldConfig": {
        "defaults": {
          "decimals": 0,
          "displayName": "${__field.labels.server}",
          "mappings": [
            {
              "options": {
                "from": 200,
                "result": {
                  "index": 0,
                  "text": "OK"
                },
                "to": 299
              },
              "type": "range"
            },
            {
              "options": {
                "from": 300,
                "result": {
                  "index": 1,
                  "text": "Redirected"
                },
                "to": 399
              },
              "type": "range"
            },
            {
              "options": {
                "from": 400,
                "result": {
                  "index": 2,
                  "text": "Client Error"
                },
                "to": 499
              },
              "type": "range"
            },
            {
              "options": {
                "from": 500,
                "result": {
                  "index": 3,
                  "text": "Server Error"
                },
                "to": 599
              },
              "type": "range"
            }
          ],
          "max": 0,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "semi-dark-green",
                "value": null
              },
              {
                "color": "dark-green",
                "value": 200
              },
              {
                "color": "semi-dark-orange",
                "value": 300
              },
              {
                "color": "semi-dark-red",
                "value": 400
              },
              {
                "color": "semi-dark-blue",
                "value": 500
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 4,
        "x": 0,
        "y": 1
      },
      "id": 2,
      "interval": "15s",
      "links": [],
      "maxPerRow": 12,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "center",
        "orientation": "vertical",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "value"
      },
      "pluginVersion": "9.2.0",
      "repeat": "url_name",
      "repeatDirection": "h",
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB}"
          },
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "none"
              ],
              "type": "fill"
            }
          ],
          "measurement": "http_response",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"http_response\")\r\n  |> filter(fn: (r) => r[\"server\"]  =~ /${url_name:regex}/)\r\n  |> filter(fn: (r) => r[\"_field\"] == \"http_response_code\")\r\n  |> group()\r\n  |> last()",
          "rawQuery": false,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "http_response_code"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": [
            {
              "key": "server",
              "operator": "=~",
              "value": "/^$url_name$/"
            }
          ]
        }
      ],
      "title": "$url_name",
      "transformations": [
        {
          "id": "reduce",
          "options": {
            "labelsToFields": false,
            "reducers": [
              "lastNotNull"
            ]
          }
        }
      ],
      "type": "stat"
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 4
      },
      "id": 23,
      "panels": [],
      "title": "URLs with errors",
      "type": "row"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_INFLUXDB}"
      },
      "description": "Monitoring of the HTTP Response. On the Title of the widget you can find the Website name, and on the value the current response of the HTTP or HTTPS.\n\nThresholds are:\n* Results with 20x , Green\n* Results with 30x , Orange\n* Results with 40x , Red\n* Results with 50x , Blue",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "dark-red",
            "mode": "fixed"
          },
          "decimals": 0,
          "displayName": "${__field.labels.server}",
          "mappings": [],
          "max": 0,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "semi-dark-green",
                "value": null
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 24,
        "x": 0,
        "y": 5
      },
      "id": 19,
      "interval": "15s",
      "links": [],
      "maxPerRow": 12,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "/.*/",
          "values": false
        },
        "text": {
          "titleSize": 25,
          "valueSize": 25
        },
        "textMode": "value"
      },
      "pluginVersion": "9.2.0",
      "repeat": "error_url",
      "repeatDirection": "h",
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB}"
          },
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "none"
              ],
              "type": "fill"
            }
          ],
          "measurement": "http_response",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"http_response\")\r\n  |> filter(fn: (r) => r[\"server\"]  =~ /${error_url:regex}/)\r\n  |> filter(fn: (r) => r[\"_field\"] == \"result_type\")\r\n  |> filter(fn: (r) => r[\"_value\"] == \"connection_failed\")\r\n  |> last()",
          "rawQuery": false,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "http_response_code"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": [
            {
              "key": "server",
              "operator": "=~",
              "value": "/^$url_name$/"
            }
          ]
        }
      ],
      "title": "$error_url",
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "Time": true
            },
            "indexByName": {},
            "renameByName": {}
          }
        }
      ],
      "type": "stat"
    },
    {
      "collapsed": true,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 8
      },
      "id": 25,
      "panels": [],
      "title": "Table, and advanced HTTP statistics",
      "type": "row"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_INFLUXDB}"
      },
      "description": "SSL Certificate Monitoring Table. On the first column you can find the SSL x509 Certificate name, and on the second column the TTL/Expirty Date in days.\n\nThresholds are:\n* From 0 days to 14, Red\n* From 15 days to 30, Orange\n* From 31 days onward, Green",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "displayMode": "auto",
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "noValue": "Error",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "HTTP Response"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "HTTP Response"
              },
              {
                "id": "unit",
                "value": "none"
              },
              {
                "id": "custom.displayMode",
                "value": "color-background"
              },
              {
                "id": "custom.align",
                "value": "center"
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-red",
                      "value": null
                    },
                    {
                      "color": "dark-green",
                      "value": 200
                    },
                    {
                      "color": "#FF780A",
                      "value": 300
                    },
                    {
                      "color": "#E02F44",
                      "value": 400
                    },
                    {
                      "color": "dark-blue",
                      "value": 500
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "result"
            },
            "properties": [
              {
                "id": "custom.displayMode",
                "value": "color-background"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed"
                }
              },
              {
                "id": "mappings",
                "value": [
                  {
                    "options": {
                      "connection_failed": {
                        "color": "dark-red",
                        "index": 0
                      },
                      "success": {
                        "color": "dark-green",
                        "index": 1
                      }
                    },
                    "type": "value"
                  }
                ]
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 9
      },
      "id": 9,
      "options": {
        "footer": {
          "enablePagination": true,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true
      },
      "pluginVersion": "9.2.0",
      "targets": [
        {
          "alias": "$tag_server",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB}"
          },
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "orderByTime": "ASC",
          "policy": "default",
          "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"http_response\")\r\n  |> filter(fn: (r) => r[\"server\"]  =~ /${url_name:regex}/)\r\n  |> filter(fn: (r) => r[\"_field\"] == \"http_response_code\")\r\n  |> last()",
          "rawQuery": true,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": []
        },
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB}"
          },
          "hide": false,
          "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"http_response\")\r\n  |> filter(fn: (r) => r[\"_field\"] == \"result_type\")\r\n  |> filter(fn: (r) => r[\"_value\"] == \"connection_failed\")\r\n  |> last()",
          "refId": "B"
        }
      ],
      "transformations": [
        {
          "id": "reduce",
          "options": {
            "labelsToFields": true,
            "reducers": [
              "lastNotNull"
            ]
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "Field": true,
              "host": true,
              "method": true,
              "result": false,
              "status_code": true
            },
            "indexByName": {
              "Field": 0,
              "Last *": 5,
              "host": 1,
              "method": 2,
              "result": 6,
              "server": 4,
              "status_code": 3
            },
            "renameByName": {
              "Last *": "HTTP Response",
              "result": "Connection",
              "server": "URL",
              "status_code": ""
            }
          }
        }
      ],
      "transparent": true,
      "type": "table"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_INFLUXDB}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 50,
            "gradientMode": "opacity",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "displayName": "${__field.labels.server}",
          "links": [],
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "ms"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 24,
        "x": 0,
        "y": 16
      },
      "id": 13,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max",
            "min"
          ],
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "9.2.0",
      "targets": [
        {
          "alias": "$tag_server",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB}"
          },
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "server"
              ],
              "type": "tag"
            },
            {
              "params": [
                "none"
              ],
              "type": "fill"
            }
          ],
          "measurement": "http_response",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"http_response\")\r\n  |> filter(fn: (r) => r[\"server\"]  =~ /${url_name:regex}/)\r\n  |> filter(fn: (r) => r[\"_field\"] == \"response_time\")\r\n  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\r\n  |> yield(name: \"last\")",
          "rawQuery": false,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "response_time"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": [
            {
              "key": "server",
              "operator": "=~",
              "value": "/^$url_name$/"
            }
          ]
        }
      ],
      "title": "HTTP Response in ms",
      "type": "timeseries"
    }
  ],
  "refresh": false,
  "schemaVersion": 37,
  "style": "dark",
  "tags": [
    "http",
    "http_response"
  ],
  "templating": {
    "list": [
      {
        "current": {},
        "datasource": {
          "type": "influxdb",
          "uid": "${DS_INFLUXDB}"
        },
        "definition": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"http_response\")\r\n  |> filter(fn: (r) => r[\"_field\"] == \"result_type\")\r\n  |> filter(fn: (r) => r[\"_value\"] == \"success\")\r\n  |> keep(columns: [\"server\"])\r\n  |> distinct(column: \"server\")\r\n  |> group()",
        "hide": 0,
        "includeAll": true,
        "label": "URL",
        "multi": true,
        "name": "url_name",
        "options": [],
        "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"http_response\")\r\n  |> filter(fn: (r) => r[\"_field\"] == \"result_type\")\r\n  |> filter(fn: (r) => r[\"_value\"] == \"success\")\r\n  |> keep(columns: [\"server\"])\r\n  |> distinct(column: \"server\")\r\n  |> group()",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "current": {},
        "datasource": {
          "type": "influxdb",
          "uid": "${DS_INFLUXDB}"
        },
        "definition": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"http_response\")\r\n  |> filter(fn: (r) => r[\"_field\"] == \"result_type\")\r\n  |> filter(fn: (r) => r[\"_value\"] != \"success\")\r\n  |> keep(columns: [\"server\"])\r\n  |> distinct(column: \"server\")\r\n  |> group()",
        "hide": 0,
        "includeAll": true,
        "label": "URL with errors",
        "multi": true,
        "name": "error_url",
        "options": [],
        "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"http_response\")\r\n  |> filter(fn: (r) => r[\"_field\"] == \"result_type\")\r\n  |> filter(fn: (r) => r[\"_value\"] != \"success\")\r\n  |> keep(columns: [\"server\"])\r\n  |> distinct(column: \"server\")\r\n  |> group()",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-15m",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "HTTP Response Monitoring",
  "uid": "Os3hdxQZk",
  "version": 6,
  "weekStart": ""
}