Grafana dashboard: Ruby on Rails Slowlog by Request
Description: A list of the slowest requests

# A Ruby on Rails Performance Dashboard

The datasource would be a [influxdb](https://www.influxdata.com/products/influxdb-overview/) database that is filled by the official [influxdb-rails](https://github.com/influxdata/influxdb-rails) reporter.

**PLEASE NOTE**: This dashboard is one of a collection of Ruby on Rails dashboards. They make the most sense united.

- [Ruby On Rails Performance Overview](https://grafana.com/dashboards/10428/)
- Performance insights into individual requests, see [Ruby On Rails Performance per Request](https://grafana.com/dashboards/10429/)
- Performance of individual actions, see [Ruby On Rails Performance per Action](https://grafana.com/grafana/dashboards/11031)
- [Ruby On Rails Health Overview](https://grafana.com/grafana/dashboards/14115)
- [Ruby on Rails ActiveJob Overview](https://grafana.com/grafana/dashboards/14116)
- [Ruby on Rails Slowlog by Request](https://grafana.com/grafana/dashboards/14118)
- [Ruby on Rails Slowlog by Action](https://grafana.com/grafana/dashboards/14117)
- [Ruby on Rails Slowlog by SQL](https://grafana.com/grafana/dashboards/14119)

{
  "__inputs": [
    {
      "name": "DS_INFLUXDB-RAILS",
      "label": "InfluxDB",
      "description": "",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "7.1.1"
    },
    {
      "type": "datasource",
      "id": "influxdb",
      "name": "InfluxDB",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "table-old",
      "name": "Table (old)",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "A list of the slowest requests",
  "editable": true,
  "gnetId": 14118,
  "graphTooltip": 0,
  "id": null,
  "links": [
    {
      "$$hashKey": "object:419",
      "icon": "external link",
      "tags": [
        "influxdb-rails"
      ],
      "type": "dashboards"
    }
  ],
  "panels": [
    {
      "columns": [],
      "datasource": "${DS_INFLUXDB-RAILS}",
      "description": "List of slowest requests served",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fontSize": "100%",
      "gridPos": {
        "h": 23,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "links": [],
      "pageSize": null,
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 4,
        "desc": true
      },
      "styles": [
        {
          "$$hashKey": "object:5125",
          "alias": "Finished",
          "align": "auto",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "hidden"
        },
        {
          "$$hashKey": "object:5126",
          "alias": "Started",
          "align": "auto",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "pattern": "started",
          "thresholds": [],
          "type": "hidden",
          "unit": "short"
        },
        {
          "$$hashKey": "object:5127",
          "alias": "Execution Time",
          "align": "auto",
          "colorMode": "value",
          "colors": [
            "rgba(50, 172, 45, 0.97)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(245, 54, 54, 0.9)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "max",
          "thresholds": [
            "3000",
            "5000"
          ],
          "type": "number",
          "unit": "ms"
        },
        {
          "$$hashKey": "object:5128",
          "alias": "Request ID",
          "align": "auto",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "link": true,
          "linkTargetBlank": true,
          "linkTooltip": "View data per this Request",
          "linkUrl": "/d/influxdb-rails-request/ruby-on-rails-performance-per-request?var-request_id=${__cell}&from=${__cell_2}&to=${__cell_0}&var-method=${__cell_1}",
          "mappingType": 1,
          "pattern": "request_id",
          "thresholds": [],
          "type": "string",
          "unit": "short",
          "valueMaps": [
            {
              "$$hashKey": "object:367",
              "text": "",
              "value": ""
            }
          ]
        },
        {
          "$$hashKey": "object:5129",
          "alias": "Controller Action",
          "align": "auto",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "link": true,
          "linkTargetBlank": true,
          "linkTooltip": "View data per this Controller Action",
          "linkUrl": "/d/influxdb-rails-action/ruby-on-rails-performance-per-action?var-Action=${__cell}&from=$__from&to=$__to",
          "mappingType": 1,
          "pattern": "method",
          "thresholds": [],
          "type": "string",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "method"
              ],
              "type": "tag"
            }
          ],
          "limit": "20",
          "measurement": "rails",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "table",
          "select": [
            [
              {
                "params": [
                  "started"
                ],
                "type": "field"
              }
            ],
            [
              {
                "params": [
                  "request_id"
                ],
                "type": "field"
              }
            ],
            [
              {
                "params": [
                  "controller"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "max"
              }
            ]
          ],
          "tags": [
            {
              "key": "hook",
              "operator": "=",
              "value": "process_action"
            }
          ]
        }
      ],
      "title": "Slow Requests",
      "transform": "table",
      "type": "table-old"
    }
  ],
  "schemaVersion": 26,
  "style": "dark",
  "tags": [
    "Performance",
    "Ruby on Rails",
    "influxdb-rails"
  ],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-1h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "Ruby on Rails Slowlog by Request",
  "uid": "influxdb-rails-slowlog-request",
  "version": 12
}