Grafana dashboard: Hystrix (Spectator)
Description: InfluxDB based dashboard to show Hystrix stats polled by Spinnaker-Spectator

This is an integration of the statistics provided by Netflix Spinnaker-Spectator (https://github.com/spinnaker/kork/tree/master/kork-hystrix/src/main/groovy/com/netflix/spinnaker/hystrix/spectator) with an InfluxDB database and is vaguely inspired by the following blog post:
http://www.nurkiewicz.com/2015/02/storing-months-of-historical-metrics.html

Developed by monaco-telecom.mc


{
  "__inputs": [
    {
      "name": "DS_INFLUXDB",
      "label": "InfluxDB",
      "description": "",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "4.2.0"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "influxdb",
      "name": "InfluxDB",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "singlestat",
      "name": "Singlestat",
      "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"
      }
    ]
  },
  "editable": true,
  "gnetId": 3905,
  "graphTooltip": 0,
  "hideControls": false,
  "id": 7,
  "links": [],
  "refresh": false,
  "rows": [
    {
      "collapse": false,
      "height": 287,
      "panels": [
        {
          "aliasColors": {
            "5": "#cffaff",
            "25": "#f9d9f9",
            "50": "#82b5d8",
            "75": "#e5a8e2",
            "90": "#ba43a9",
            "99": "#6d1f62",
            "995": "#3f2b5b"
          },
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_INFLUXDB}",
          "fill": 1,
          "id": 1,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 4,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "alias": "5%",
              "dsType": "influxdb",
              "groupBy": [],
              "measurement": "hystrix.latencyExecute__percentile_5",
              "orderByTime": "ASC",
              "policy": "default",
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "metricType",
                  "operator": "=~",
                  "value": "/^$service$/"
                }
              ]
            },
            {
              "alias": "25%",
              "dsType": "influxdb",
              "groupBy": [],
              "measurement": "hystrix.latencyExecute__percentile_25",
              "orderByTime": "ASC",
              "policy": "default",
              "refId": "B",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "metricType",
                  "operator": "=~",
                  "value": "/^$service$/"
                }
              ]
            },
            {
              "alias": "50%",
              "dsType": "influxdb",
              "groupBy": [],
              "measurement": "hystrix.latencyExecute__percentile_50",
              "orderByTime": "ASC",
              "policy": "default",
              "refId": "C",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "metricType",
                  "operator": "=~",
                  "value": "/^$service$/"
                }
              ]
            },
            {
              "alias": "75%",
              "dsType": "influxdb",
              "groupBy": [],
              "measurement": "hystrix.latencyExecute__percentile_75",
              "orderByTime": "ASC",
              "policy": "default",
              "refId": "D",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "metricType",
                  "operator": "=~",
                  "value": "/^$service$/"
                }
              ]
            },
            {
              "alias": "90%",
              "dsType": "influxdb",
              "groupBy": [],
              "measurement": "hystrix.latencyExecute__percentile_90",
              "orderByTime": "ASC",
              "policy": "default",
              "refId": "E",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "metricType",
                  "operator": "=~",
                  "value": "/^$service$/"
                }
              ]
            },
            {
              "alias": "99%",
              "dsType": "influxdb",
              "groupBy": [],
              "measurement": "hystrix.latencyExecute__percentile_99",
              "orderByTime": "ASC",
              "policy": "default",
              "refId": "F",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "metricType",
                  "operator": "=~",
                  "value": "/^$service$/"
                }
              ]
            },
            {
              "alias": "99.5%",
              "dsType": "influxdb",
              "groupBy": [],
              "measurement": "hystrix.latencyExecute__percentile_995",
              "orderByTime": "ASC",
              "policy": "default",
              "refId": "G",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "metricType",
                  "operator": "=~",
                  "value": "/^$service$/"
                }
              ]
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Execution latency percentiles",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "ms",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": "0",
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        },
        {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": true,
          "colors": [
            "#299c46",
            "#d44a3a",
            "#d44a3a"
          ],
          "datasource": "${DS_INFLUXDB}",
          "format": "none",
          "gauge": {
            "maxValue": 1,
            "minValue": 0,
            "show": true,
            "thresholdLabels": false,
            "thresholdMarkers": false
          },
          "id": 6,
          "interval": null,
          "links": [],
          "mappingType": 2,
          "mappingTypes": [
            {
              "name": "value to text",
              "value": 1
            },
            {
              "name": "range to text",
              "value": 2
            }
          ],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [
            {
              "from": "0",
              "text": "Closed",
              "to": "0"
            },
            {
              "from": "1",
              "text": "Open",
              "to": "1"
            },
            {
              "from": "0",
              "text": "Open",
              "to": "1"
            }
          ],
          "span": 2,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": false
          },
          "tableColumn": "mean",
          "targets": [
            {
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$__interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "null"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "hystrix.isCircuitBreakerOpen",
              "orderByTime": "ASC",
              "policy": "default",
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "metricType",
                  "operator": "=~",
                  "value": "/^$service$/"
                }
              ]
            }
          ],
          "thresholds": "0.0000001",
          "title": "Circuit breaker state",
          "type": "singlestat",
          "valueFontSize": "50%",
          "valueMaps": [
            {
              "op": "=",
              "text": "Closed",
              "value": "0"
            },
            {
              "op": "=",
              "text": "Open",
              "value": "1"
            },
            {
              "op": "=",
              "text": "",
              "value": ""
            }
          ],
          "valueName": "current"
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_INFLUXDB}",
          "fill": 1,
          "id": 4,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 6,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "alias": "25%",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$__interval"
                  ],
                  "type": "time"
                }
              ],
              "measurement": "hystrix.latencyTotal__percentile_25",
              "orderByTime": "ASC",
              "policy": "default",
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "median"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "metricType",
                  "operator": "=~",
                  "value": "/^$service$/"
                }
              ]
            },
            {
              "alias": "50%",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$__interval"
                  ],
                  "type": "time"
                }
              ],
              "measurement": "hystrix.latencyTotal__percentile_50",
              "orderByTime": "ASC",
              "policy": "default",
              "refId": "B",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "median"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "metricType",
                  "operator": "=~",
                  "value": "/^$service$/"
                }
              ]
            },
            {
              "alias": "75%",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$__interval"
                  ],
                  "type": "time"
                }
              ],
              "measurement": "hystrix.latencyTotal__percentile_75",
              "orderByTime": "ASC",
              "policy": "default",
              "refId": "C",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "median"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "metricType",
                  "operator": "=~",
                  "value": "/^$service$/"
                }
              ]
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Latency median percentile",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "ms",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": "0",
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "Dashboard Row",
      "titleSize": "h6"
    },
    {
      "collapse": false,
      "height": 250,
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_INFLUXDB}",
          "fill": 1,
          "id": 2,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "alias": "Active",
              "yaxis": 2
            }
          ],
          "spaceLength": 10,
          "span": 6,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "alias": "Executed per second",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "1s"
                  ],
                  "type": "time"
                }
              ],
              "measurement": "hystrix.rollingCountThreadsExecuted",
              "orderByTime": "ASC",
              "policy": "default",
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "sum"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "metricType",
                  "operator": "=~",
                  "value": "/^$service$/"
                }
              ]
            },
            {
              "alias": "Active",
              "dsType": "influxdb",
              "groupBy": [],
              "measurement": "hystrix.rollingMaxActiveThreads",
              "orderByTime": "ASC",
              "policy": "default",
              "refId": "B",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "metricType",
                  "operator": "=~",
                  "value": "/^$service$/"
                }
              ]
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Thread pool",
          "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": "0",
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": "0",
              "show": true
            }
          ]
        },
        {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": false,
          "colors": [
            "#299c46",
            "rgba(237, 129, 40, 0.89)",
            "#d44a3a"
          ],
          "datasource": "${DS_INFLUXDB}",
          "format": "none",
          "gauge": {
            "maxValue": 100,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": true
          },
          "id": 8,
          "interval": null,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [
            {
              "name": "value to text",
              "value": 1
            },
            {
              "name": "range to text",
              "value": 2
            }
          ],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [
            {
              "from": "null",
              "text": "N/A",
              "to": "null"
            }
          ],
          "span": 3,
          "sparkline": {
            "fillColor": "#5195ce",
            "full": true,
            "lineColor": "rgb(5, 43, 81)",
            "show": true
          },
          "tableColumn": "",
          "targets": [
            {
              "dsType": "influxdb",
              "groupBy": [],
              "measurement": "hystrix.countSuccess",
              "orderByTime": "ASC",
              "policy": "default",
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "metricType",
                  "operator": "=~",
                  "value": "/^$service$/"
                }
              ]
            }
          ],
          "thresholds": "",
          "title": "Executed commands",
          "type": "singlestat",
          "valueFontSize": "80%",
          "valueMaps": [
            {
              "op": "=",
              "text": "N/A",
              "value": "null"
            }
          ],
          "valueName": "max"
        },
        {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": false,
          "colors": [
            "#299c46",
            "rgba(237, 129, 40, 0.89)",
            "#d44a3a"
          ],
          "datasource": "${DS_INFLUXDB}",
          "format": "none",
          "gauge": {
            "maxValue": 100,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": true
          },
          "id": 7,
          "interval": null,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [
            {
              "name": "value to text",
              "value": 1
            },
            {
              "name": "range to text",
              "value": 2
            }
          ],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "%",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [
            {
              "from": "null",
              "text": "N/A",
              "to": "null"
            }
          ],
          "span": 3,
          "sparkline": {
            "fillColor": "rgba(191, 27, 0, 0.18)",
            "full": false,
            "lineColor": "#bf1b00",
            "show": true
          },
          "tableColumn": "",
          "targets": [
            {
              "dsType": "influxdb",
              "groupBy": [],
              "measurement": "hystrix.errorPercentage",
              "orderByTime": "ASC",
              "policy": "default",
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "metricType",
                  "operator": "=~",
                  "value": "/^$service$/"
                }
              ]
            }
          ],
          "thresholds": "",
          "title": "Error percentage",
          "type": "singlestat",
          "valueFontSize": "80%",
          "valueMaps": [
            {
              "op": "=",
              "text": "N/A",
              "value": "null"
            }
          ],
          "valueName": "avg"
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "Dashboard Row",
      "titleSize": "h6"
    },
    {
      "collapse": false,
      "height": 250,
      "panels": [
        {
          "aliasColors": {
            "Failure": "#f29191",
            "Fallback": "#eab839",
            "Success": "#6ed0e0"
          },
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_INFLUXDB}",
          "fill": 10,
          "hideTimeOverride": false,
          "id": 3,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 0,
          "links": [],
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 12,
          "stack": true,
          "steppedLine": true,
          "targets": [
            {
              "alias": "Success",
              "dsType": "influxdb",
              "groupBy": [],
              "hide": false,
              "measurement": "hystrix.rollingCountSuccess",
              "orderByTime": "ASC",
              "policy": "default",
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "metricType",
                  "operator": "=~",
                  "value": "/^$service$/"
                }
              ]
            },
            {
              "alias": "Failure",
              "dsType": "influxdb",
              "groupBy": [],
              "measurement": "hystrix.rollingCountFailure",
              "orderByTime": "ASC",
              "policy": "default",
              "refId": "B",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "metricType",
                  "operator": "=~",
                  "value": "/^$service$/"
                }
              ]
            },
            {
              "alias": "Fallback",
              "dsType": "influxdb",
              "groupBy": [],
              "measurement": "hystrix.rollingCountFallbackSuccess",
              "orderByTime": "ASC",
              "policy": "default",
              "refId": "D",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "metricType",
                  "operator": "=~",
                  "value": "/^$service$/"
                }
              ]
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Command count + errors",
          "tooltip": {
            "shared": true,
            "sort": 1,
            "value_type": "individual"
          },
          "transparent": false,
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": "0",
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "Dashboard Row",
      "titleSize": "h6"
    }
  ],
  "schemaVersion": 14,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_INFLUXDB}",
        "hide": 0,
        "includeAll": false,
        "label": "Service",
        "multi": true,
        "name": "service",
        "options": [],
        "query": " SHOW TAG VALUES WITH KEY = metricType",
        "refresh": 2,
        "regex": "/[^(RibbonCommand)]/",
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "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": "",
  "title": "Hystrix (Spectator)",
  "version": 2,
  "description": "InfluxDB based dashboard to show Hystrix stats polled by Spinnaker-Spectator"
}