diff --git a/sample-dashboard/README.md b/sample-dashboard/README.md index d1ce63e..494a40c 100644 --- a/sample-dashboard/README.md +++ b/sample-dashboard/README.md @@ -4,36 +4,42 @@ A dashboard providing Ruby on Rails performance insights based on [Free Software](https://www.fsf.org/about/what-is-free-software), ready to run inside your data-center. -![Screenshot of the dashboard](https://grafana.com/api/dashboards/10428/images/6557/image) +![Screenshot of the dashboard](https://grafana.com/api/dashboards/10428/images/10103/image) -By default it measures (in various forms): +By default it measures (in various forms) performance of: -- Controller Action Runtime -- View/Partial Render Runtime -- Database Query Runtime +- Controller Actions +- View/Partial Rendering +- Database Queries +- ActiveJobs +- ActionMailers -It provides an overview and you can also drill down into numbers on a per request basis. Of course you can use all the awesome features that Influx (Downsampling/Data Retention), Grafana (Alerts, Annotations) and influxdb-rails (custom tags) provide and extend this to your needs. Use your freedom and run, copy, distribute, study, change and improve this software! +The dashboards provide an overview and various ways to drill down into numbers on a per request or per action basis. Of course you can use all the awesome features that Influx (Downsampling/Data Retention), Grafana (Alerts, Annotations) and influxdb-rails (custom tags) provide and extend this to your needs. Use your freedom and run, copy, distribute, study, change and improve this software! ## Requirements -To be able to measure performance you need the following things available: +To be able to measure performance of your Ruby on Rails application you need to have the following things available: -- [InfluxDB 1.x](https://docs.influxdata.com/influxdb/v1.8/introduction/install/) -- [Grafana](https://grafana.com/docs/) +- [InfluxDB 1.x](https://www.influxdata.com/products/influxdb/) +- [Grafana](https://grafana.com/) - A [Ruby On Rails](https://rubyonrails.org/) application with [influxdb-rails](https://github.com/influxdata/influxdb-rails) enabled ## Installation -Once you have influx/grafana instances running in your infrastructure just [import both -dashboards from grafana](https://grafana.com/docs/reference/export_import/#importing-a-dashboard). +Once you have influx/grafana instances running in your infrastructure just [import the +dashboards from grafana.com](https://grafana.com/docs/reference/export_import/#importing-a-dashboard). -- [Overview Dashboard](https://grafana.com/dashboards/10428) -- [Request Dashboard](https://grafana.com/dashboards/10429) +- [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) You can also paste the `.json` files from this repository. -In the unlikely case that you need to change the dashboard *UID*s during import you can configure the *UID* the `Overview` dashboard uses to link to the `Request` dashboard in the [variables](https://grafana.com/docs/reference/templating/#adding-a-variable). Just paste whatever *UID* you've set up for the `Request` dashboard. - ## Demo This repository includes a [docker-compose](https://docs.docker.com/compose/) demo setup that brings a simple rails app, influxdb and grafana. @@ -54,19 +60,6 @@ Go to http://0.0.0.0:4000 and do some things. Every request to the rails app wil You can also use the dashboard with any other rails app you already have. Follow our [install instructions](https://github.com/influxdata/influxdb-rails/#installation), the default configuration works with the demo InfluxDB running on localhost:8086. -To be able to view individual requests you have to enable request ID tags in your application. Something like: - -```ruby -class ApplicationController < ActionController::Base - - before_action :set_influx_data - - def set_influx_data - InfluxDB::Rails.current.values = { request: request.request_id } - end -end -``` - ### ...then see the dashboards in action Just go to http://0.0.0.0:3000 and log in with admin/admin. diff --git a/sample-dashboard/Rakefile b/sample-dashboard/Rakefile index 0478207..74f5a4b 100644 --- a/sample-dashboard/Rakefile +++ b/sample-dashboard/Rakefile @@ -2,8 +2,13 @@ task default: %w[prepare] # rubocop:disable Layout/LineLength task :prepare do - sh "cat 'Ruby On Rails Performance.json' | sed 's/${DS_INFLUXDB}/InfluxDB/g' > provisioning/performance.json" - sh "cat 'Ruby On Rails Performance (per Request).json' | sed 's/${DS_INFLUXDB}/InfluxDB/g' > provisioning/performance-request.json" - sh "cat 'Ruby On Rails Performance (per Action).json' | sed 's/${DS_INFLUXDB}/InfluxDB/g' > provisioning/performance-action.json" + sh "cat 'Ruby On Rails Performance.json' | sed 's/${DS_INFLUXDB-RAILS}/InfluxDB/g' > provisioning/performance.json" + sh "cat 'Ruby On Rails Performance per Request.json' | sed 's/${DS_INFLUXDB-RAILS}/InfluxDB/g' > provisioning/performance-request.json" + sh "cat 'Ruby On Rails Performance per Action.json' | sed 's/${DS_INFLUXDB-RAILS}/InfluxDB/g' > provisioning/performance-action.json" + sh "cat 'Ruby On Rails ActiveJob.json' | sed 's/${DS_INFLUXDB-RAILS}/InfluxDB/g' > provisioning/activejob.json" + sh "cat 'Ruby On Rails Requests.json' | sed 's/${DS_INFLUXDB-RAILS}/InfluxDB/g' > provisioning/requests.json" + sh "cat 'Ruby On Rails Slowlog by Action.json' | sed 's/${DS_INFLUXDB-RAILS}/InfluxDB/g' > provisioning/slowlog-action.json" + sh "cat 'Ruby On Rails Slowlog by Request.json' | sed 's/${DS_INFLUXDB-RAILS}/InfluxDB/g' > provisioning/slowlog-requests.json" + sh "cat 'Ruby On Rails Slowlog by SQL.json' | sed 's/${DS_INFLUXDB-RAILS}/InfluxDB/g' > provisioning/slowlog-sql.json" end # rubocop:enable Layout/LineLength diff --git a/sample-dashboard/Ruby On Rails ActiveJob.json b/sample-dashboard/Ruby On Rails ActiveJob.json new file mode 100644 index 0000000..5999e5b --- /dev/null +++ b/sample-dashboard/Ruby On Rails ActiveJob.json @@ -0,0 +1,600 @@ +{ + "__inputs": [ + { + "name": "DS_INFLUXDB-RAILS", + "label": "InfluxDB-Rails", + "description": "", + "type": "datasource", + "pluginId": "influxdb", + "pluginName": "InfluxDB" + } + ], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "7.1.1" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph", + "version": "" + }, + { + "type": "datasource", + "id": "influxdb", + "name": "InfluxDB", + "version": "1.0.0" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": null, + "iteration": 1616428804223, + "links": [ + { + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "influxdb-rails" + ], + "type": "dashboards" + } + ], + "panels": [ + { + "aliasColors": {}, + "bars": false, + "cacheTimeout": null, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_INFLUXDB-RAILS}", + "decimals": 1, + "description": "Number of jobs per queue", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 3, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "hideTimeOverride": false, + "id": 2, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "hideEmpty": false, + "hideZero": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sideWidth": 250, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 0.5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_queue", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "queue" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "enqueue" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "by Queues", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "jobs", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_INFLUXDB-RAILS}", + "description": "Number of jobs per class", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 7 + }, + "hiddenSeries": false, + "id": 4, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sideWidth": 250, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_job", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "job" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "perform_start" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "by Classes", + "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": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_INFLUXDB-RAILS}", + "description": "Performance of jobs by class", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [], + "unit": "ms" + }, + "overrides": [] + }, + "fill": 0, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 15 + }, + "hiddenSeries": false, + "id": 5, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sideWidth": 250, + "total": false, + "values": false + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 2, + "points": true, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_job", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "job" + ], + "type": "tag" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [ + "99" + ], + "type": "percentile" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "perform" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Performance", + "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": 2, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": "5m", + "schemaVersion": 26, + "style": "dark", + "tags": [ + "influxdb-rails", + "Health", + "Performance", + "Ruby on Rails" + ], + "templating": { + "list": [ + { + "auto": true, + "auto_count": "50", + "auto_min": "", + "current": { + "selected": false, + "text": "auto", + "value": "$__auto_interval_per" + }, + "hide": 0, + "label": null, + "name": "per", + "options": [ + { + "selected": true, + "text": "auto", + "value": "$__auto_interval_per" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "10m", + "value": "10m" + }, + { + "selected": false, + "text": "30m", + "value": "30m" + }, + { + "selected": false, + "text": "1h", + "value": "1h" + }, + { + "selected": false, + "text": "6h", + "value": "6h" + }, + { + "selected": false, + "text": "12h", + "value": "12h" + }, + { + "selected": false, + "text": "1d", + "value": "1d" + }, + { + "selected": false, + "text": "7d", + "value": "7d" + }, + { + "selected": false, + "text": "14d", + "value": "14d" + }, + { + "selected": false, + "text": "30d", + "value": "30d" + } + ], + "query": "1m,10m,30m,1h,6h,12h,1d,7d,14d,30d", + "queryValue": "", + "refresh": 2, + "skipUrlSync": false, + "type": "interval" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "ActiveJob", + "uid": "influxdb-rails-activejob", + "version": 12 +} \ No newline at end of file diff --git a/sample-dashboard/Ruby On Rails Performance (per Action).json b/sample-dashboard/Ruby On Rails Performance per Action.json similarity index 66% rename from sample-dashboard/Ruby On Rails Performance (per Action).json rename to sample-dashboard/Ruby On Rails Performance per Action.json index ab14323..fc89c6a 100644 --- a/sample-dashboard/Ruby On Rails Performance (per Action).json +++ b/sample-dashboard/Ruby On Rails Performance per Action.json @@ -1,8 +1,8 @@ { "__inputs": [ { - "name": "DS_INFLUXDB", - "label": "InfluxDB", + "name": "DS_INFLUXDB-RAILS", + "label": "InfluxDB-Rails", "description": "", "type": "datasource", "pluginId": "influxdb", @@ -14,7 +14,7 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "6.2.4" + "version": "7.1.1" }, { "type": "panel", @@ -30,14 +30,14 @@ }, { "type": "panel", - "id": "singlestat", - "name": "Singlestat", + "id": "stat", + "name": "Stat", "version": "" }, { "type": "panel", - "id": "table", - "name": "Table", + "id": "table-old", + "name": "Table (old)", "version": "" } ], @@ -54,90 +54,81 @@ } ] }, - "description": "Ruby on Rails Request Performance Insights based on influxdb-rails", + "description": "Controller Action Performance Insights based on influxdb-rails", "editable": true, - "gnetId": null, + "gnetId": 11031, "graphTooltip": 0, "id": null, - "iteration": 1571756217977, - "links": [], + "iteration": 1616428619978, + "links": [ + { + "$$hashKey": "object:226", + "icon": "external link", + "keepTime": false, + "tags": [ + "influxdb-rails" + ], + "type": "dashboards" + } + ], "panels": [ { "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "${DS_INFLUXDB}", - "format": "ms", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "datasource": "${DS_INFLUXDB-RAILS}", + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "N/A", + "type": 1, + "value": "null" + } + ], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [] }, "gridPos": { - "h": 4, + "h": 3, "w": 5, "x": 0, "y": 0 }, - "id": 16, + "id": 22, "interval": null, "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "sum" + ], + "fields": "/^rails\\.count$/", + "values": false + }, + "textMode": "auto" }, - "tableColumn": "", + "pluginVersion": "7.1.1", "targets": [ { - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], + "groupBy": [], "measurement": "rails", "orderByTime": "ASC", "policy": "default", @@ -153,7 +144,7 @@ }, { "params": [], - "type": "mean" + "type": "count" } ] ], @@ -172,79 +163,66 @@ ] } ], - "thresholds": "", - "title": "Request", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" + "title": "Requests Served", + "type": "stat" }, { "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "${DS_INFLUXDB}", - "format": "ms", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "datasource": "${DS_INFLUXDB-RAILS}", + "description": "", + "fieldConfig": { + "defaults": { + "custom": {}, + "decimals": 2, + "displayName": "Response Time", + "mappings": [], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#299c46", + "value": null + }, + { + "color": "yellow", + "value": 150 + }, + { + "color": "red", + "value": 300 + } + ] + }, + "unit": "ms" + }, + "overrides": [] }, "gridPos": { - "h": 4, - "w": 5, + "h": 3, + "w": 6, "x": 5, "y": 0 }, - "id": 14, + "id": 30, "interval": null, "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto" }, - "tableColumn": "", + "pluginVersion": "7.1.1", "targets": [ { "groupBy": [ @@ -261,6 +239,7 @@ "type": "fill" } ], + "hide": false, "measurement": "rails", "orderByTime": "ASC", "policy": "default", @@ -270,7 +249,7 @@ [ { "params": [ - "view" + "controller" ], "type": "field" }, @@ -282,92 +261,79 @@ ], "tags": [ { - "key": "method", - "operator": "=~", - "value": "/^$Action$/" - }, - { - "condition": "AND", "key": "hook", "operator": "=", "value": "process_action" + }, + { + "condition": "AND", + "key": "method", + "operator": "=~", + "value": "/^$Action$/" } ] } ], - "thresholds": "", - "title": "View per request", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" + "title": "Average Response", + "type": "stat" }, { "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "${DS_INFLUXDB}", - "format": "ms", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "datasource": "${DS_INFLUXDB-RAILS}", + "description": "", + "fieldConfig": { + "defaults": { + "custom": {}, + "decimals": 2, + "displayName": "Response Time", + "mappings": [], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#299c46", + "value": null + }, + { + "color": "yellow", + "value": 150 + }, + { + "color": "red", + "value": 300 + } + ] + }, + "unit": "ms" + }, + "overrides": [] }, "gridPos": { - "h": 4, - "w": 5, - "x": 10, + "h": 3, + "w": 6, + "x": 11, "y": 0 }, - "id": 10, + "id": 31, "interval": null, "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto" }, - "tableColumn": "", + "pluginVersion": "7.1.1", "targets": [ { "groupBy": [ @@ -384,6 +350,7 @@ "type": "fill" } ], + "hide": false, "measurement": "rails", "orderByTime": "ASC", "policy": "default", @@ -393,7 +360,7 @@ [ { "params": [ - "db" + "view" ], "type": "field" }, @@ -405,206 +372,93 @@ ], "tags": [ { - "key": "method", - "operator": "=~", - "value": "/^$Action$/" - }, - { - "condition": "AND", "key": "hook", "operator": "=", "value": "process_action" + }, + { + "condition": "AND", + "key": "method", + "operator": "=~", + "value": "/^$Action$/" } ] } ], - "thresholds": "", - "title": "SQL per request", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" + "title": "Average View Rendering", + "type": "stat" }, { "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "${DS_INFLUXDB}", - "format": "short", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 5, - "x": 15, - "y": 0 - }, - "id": 22, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "value", - "targets": [ - { - "groupBy": [], - "measurement": "rails", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ + "datasource": "${DS_INFLUXDB-RAILS}", + "fieldConfig": { + "defaults": { + "custom": {}, + "displayName": "Response Time", + "mappings": [], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ { - "params": [ - "controller" - ], - "type": "field" + "color": "#299c46", + "value": null }, { - "params": [], - "type": "count" + "color": "rgba(237, 129, 40, 0.89)", + "value": 50 + }, + { + "color": "#d44a3a", + "value": 100 } ] - ], - "tags": [ - { - "key": "method", - "operator": "=~", - "value": "/^$Action$/" - }, - { - "condition": "AND", - "key": "hook", - "operator": "=", - "value": "process_action" - } - ] - } - ], - "thresholds": "", - "title": "Total requests", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#e24d42", - "#e5ac0e", - "#629e51" - ], - "datasource": "${DS_INFLUXDB}", - "decimals": null, - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + }, + "unit": "ms" + }, + "overrides": [] }, "gridPos": { - "h": 4, - "w": 4, - "x": 20, + "h": 3, + "w": 7, + "x": 17, "y": 0 }, - "id": 24, + "id": 28, "interval": null, "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto" }, - "tableColumn": "", + "pluginVersion": "7.1.1", "targets": [ { - "groupBy": [], + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], "measurement": "rails", "orderByTime": "ASC", "policy": "default", @@ -614,80 +468,74 @@ [ { "params": [ - "cache_hits" + "db" ], "type": "field" }, { - "params": [ - " / \"count\" * 100" - ], - "type": "math" + "params": [], + "type": "mean" } ] ], "tags": [ { - "key": "location", - "operator": "=~", - "value": "/^$Action$/" + "key": "hook", + "operator": "=", + "value": "process_action" }, { "condition": "AND", - "key": "hook", - "operator": "=", - "value": "render_collection" + "key": "method", + "operator": "=~", + "value": "/^$Action$/" } ] } ], - "thresholds": "10,80", - "title": "Cache hits", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" + "title": "Average Database Response", + "type": "stat" }, { "aliasColors": {}, - "bars": false, + "bars": true, "dashLength": 10, "dashes": false, - "datasource": "${DS_INFLUXDB}", + "datasource": "${DS_INFLUXDB-RAILS}", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 13, "x": 0, - "y": 4 + "y": 3 }, + "hiddenSeries": false, "id": 20, "legend": { "avg": false, "current": false, "max": false, "min": false, - "show": false, + "show": true, "total": false, "values": false }, - "lines": true, - "linewidth": 1, + "lines": false, + "linewidth": 7, "links": [], "nullPointMode": "null", - "options": { - "dataLinks": [] - }, "percentage": false, - "pointradius": 5, - "points": false, + "pluginVersion": "7.1.1", + "pointradius": 3, + "points": true, "renderer": "flot", "seriesOverrides": [ { @@ -705,6 +553,7 @@ "steppedLine": false, "targets": [ { + "alias": "", "groupBy": [ { "params": [ @@ -714,7 +563,7 @@ }, { "params": [ - "0" + "null" ], "type": "fill" } @@ -734,103 +583,7 @@ }, { "params": [], - "type": "mean" - } - ] - ], - "tags": [ - { - "key": "method", - "operator": "=~", - "value": "/^$Action$/" - }, - { - "condition": "AND", - "key": "hook", - "operator": "=", - "value": "process_action" - } - ] - }, - { - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "0" - ], - "type": "fill" - } - ], - "measurement": "rails", - "orderByTime": "ASC", - "policy": "default", - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "controller" - ], - "type": "field" - }, - { - "params": [], - "type": "max" - } - ] - ], - "tags": [ - { - "key": "method", - "operator": "=~", - "value": "/^$Action$/" - }, - { - "condition": "AND", - "key": "hook", - "operator": "=", - "value": "process_action" - } - ] - }, - { - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "0" - ], - "type": "fill" - } - ], - "measurement": "rails", - "orderByTime": "ASC", - "policy": "default", - "refId": "C", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "controller" - ], - "type": "field" - }, - { - "params": [], - "type": "min" + "type": "sum" } ] ], @@ -872,7 +625,7 @@ "decimals": null, "format": "dtdurationms", "label": "", - "logBase": 2, + "logBase": 1, "max": null, "min": null, "show": true @@ -883,7 +636,7 @@ "logBase": 1, "max": null, "min": null, - "show": true + "show": false } ], "yaxis": { @@ -893,33 +646,40 @@ }, { "columns": [], - "datasource": "${DS_INFLUXDB}", + "datasource": "${DS_INFLUXDB-RAILS}", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fontSize": "100%", "gridPos": { "h": 8, "w": 11, "x": 13, - "y": 4 + "y": 3 }, "id": 26, "links": [], - "options": {}, "pageSize": null, "scroll": true, "showHeader": true, "sort": { - "col": 0, + "col": 3, "desc": true }, "styles": [ { "alias": "Time", + "align": "auto", "dateFormat": "YYYY-MM-DD HH:mm:ss", "pattern": "Time", "type": "date" }, { "alias": "Reqest", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -931,7 +691,7 @@ "link": true, "linkTargetBlank": true, "linkTooltip": "Show details of this request", - "linkUrl": "/d/$REQUEST_DASHBOARD_UID/ruby-on-rails-performance-per-request?orgId=1&var-request_id=${__cell}&from=${__cell_2}&to=${__cell_0}&var-method=${__cell_1}", + "linkUrl": "/d/influxdb-rails-request/ruby-on-rails-performance-per-request?orgId=1&var-request_id=${__cell}&from=${__cell_2}&to=${__cell_0}&var-method=${__cell_1}", "mappingType": 1, "pattern": "request_id", "thresholds": [], @@ -940,6 +700,7 @@ }, { "alias": "Response time", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -956,6 +717,7 @@ }, { "alias": "Time", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -972,6 +734,7 @@ }, { "alias": "", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -988,6 +751,7 @@ }, { "alias": "", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1060,21 +824,26 @@ ], "title": "Last requests", "transform": "table", - "type": "table" + "type": "table-old" }, { "columns": [], - "datasource": "${DS_INFLUXDB}", + "datasource": "${DS_INFLUXDB-RAILS}", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fontSize": "100%", "gridPos": { "h": 15, "w": 13, "x": 0, - "y": 12 + "y": 11 }, "id": 2, "links": [], - "options": {}, "pageSize": null, "scroll": true, "showHeader": true, @@ -1085,12 +854,14 @@ "styles": [ { "alias": "Time", + "align": "auto", "dateFormat": "YYYY-MM-DD HH:mm:ss", "pattern": "Time", "type": "hidden" }, { "alias": "Partial", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1108,6 +879,7 @@ }, { "alias": "Count", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1124,6 +896,7 @@ }, { "alias": "Mean", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1140,6 +913,7 @@ }, { "alias": "Median", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1156,6 +930,7 @@ }, { "alias": "Max", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1172,6 +947,7 @@ }, { "alias": "", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1260,60 +1036,53 @@ "condition": "AND", "key": "hook", "operator": "=", - "value": "render_partial" + "value": "render_template" } ] } ], "title": "Partials", "transform": "table", - "type": "table" + "type": "table-old" }, { "columns": [], - "datasource": "${DS_INFLUXDB}", + "datasource": "${DS_INFLUXDB-RAILS}", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fontSize": "100%", "gridPos": { "h": 15, "w": 11, "x": 13, - "y": 12 + "y": 11 }, "id": 4, "links": [], - "options": {}, "pageSize": null, "scroll": true, "showHeader": true, "sort": { - "col": 6, + "col": 5, "desc": true }, "styles": [ { + "$$hashKey": "object:171", "alias": "Time", + "align": "auto", "dateFormat": "YYYY-MM-DD HH:mm:ss", "pattern": "Time", "type": "hidden" }, { - "alias": "", - "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, - "mappingType": 1, - "pattern": "SQL", - "thresholds": [], - "type": "string", - "unit": "short" - }, - { + "$$hashKey": "object:173", "alias": "Count", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1329,7 +1098,9 @@ "unit": "short" }, { + "$$hashKey": "object:174", "alias": "Mean", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1345,7 +1116,9 @@ "unit": "ms" }, { + "$$hashKey": "object:175", "alias": "Median", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1361,7 +1134,9 @@ "unit": "ms" }, { + "$$hashKey": "object:176", "alias": "Name", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1373,11 +1148,20 @@ "mappingType": 1, "pattern": "name", "thresholds": [], - "type": "number", - "unit": "short" + "type": "string", + "unit": "short", + "valueMaps": [ + { + "$$hashKey": "object:299", + "text": "Raw", + "value": "" + } + ] }, { + "$$hashKey": "object:177", "alias": "Max", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1391,20 +1175,6 @@ "thresholds": [], "type": "number", "unit": "ms" - }, - { - "alias": "", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 2, - "pattern": "/.*/", - "thresholds": [], - "type": "number", - "unit": "short" } ], "targets": [ @@ -1489,19 +1259,22 @@ ], "title": "SQL", "transform": "table", - "type": "table" + "type": "table-old" } ], "refresh": false, - "schemaVersion": 18, + "schemaVersion": 26, "style": "dark", - "tags": [], + "tags": [ + "Performance", + "Ruby on Rails" + ], "templating": { "list": [ { "allValue": null, "current": {}, - "datasource": "${DS_INFLUXDB}", + "datasource": "${DS_INFLUXDB-RAILS}", "definition": "", "hide": 0, "includeAll": false, @@ -1519,34 +1292,15 @@ "tagsQuery": "", "type": "query", "useTags": false - }, - { - "current": { - "value": "H8S9fSVWz", - "text": "H8S9fSVWz" - }, - "hide": 2, - "label": null, - "name": "REQUEST_DASHBOARD_UID", - "options": [ - { - "value": "H8S9fSVWz", - "text": "H8S9fSVWz" - } - ], - "query": "H8S9fSVWz", - "skipUrlSync": false, - "type": "constant" } ] }, "time": { - "from": "now-2d", + "from": "now-1h", "to": "now" }, "timepicker": { "refresh_intervals": [ - "5s", "10s", "30s", "1m", @@ -1570,7 +1324,7 @@ ] }, "timezone": "", - "title": "Ruby On Rails Performance (per Action)", - "uid": "Gpp3B1Pik", - "version": 1 -} + "title": "Performance (per Action)", + "uid": "influxdb-rails-action", + "version": 10 +} \ No newline at end of file diff --git a/sample-dashboard/Ruby On Rails Performance (per Request).json b/sample-dashboard/Ruby On Rails Performance per Request.json similarity index 69% rename from sample-dashboard/Ruby On Rails Performance (per Request).json rename to sample-dashboard/Ruby On Rails Performance per Request.json index 93f39bd..7fb4a18 100644 --- a/sample-dashboard/Ruby On Rails Performance (per Request).json +++ b/sample-dashboard/Ruby On Rails Performance per Request.json @@ -1,8 +1,8 @@ { "__inputs": [ { - "name": "DS_INFLUXDB", - "label": "InfluxDB", + "name": "DS_INFLUXDB-RAILS", + "label": "InfluxDB-Rails", "description": "", "type": "datasource", "pluginId": "influxdb", @@ -10,11 +10,17 @@ } ], "__requires": [ + { + "type": "panel", + "id": "bargauge", + "name": "Bar gauge", + "version": "" + }, { "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "6.2.4" + "version": "7.1.1" }, { "type": "datasource", @@ -24,21 +30,21 @@ }, { "type": "panel", - "id": "singlestat", - "name": "Singlestat", + "id": "stat", + "name": "Stat", "version": "" }, { "type": "panel", - "id": "table", - "name": "Table", + "id": "table-old", + "name": "Table (old)", "version": "" }, { "type": "panel", "id": "text", "name": "Text", - "version": "" + "version": "7.1.0" } ], "annotations": { @@ -54,16 +60,32 @@ } ] }, - "description": "Ruby on Rails Request Performance Insights based on influxdb-rails", + "description": "", "editable": true, "gnetId": 10429, "graphTooltip": 0, "id": null, - "iteration": 1571753874432, - "links": [], + "iteration": 1616428738654, + "links": [ + { + "$$hashKey": "object:392", + "icon": "external link", + "tags": [ + "influxdb-rails" + ], + "type": "dashboards" + } + ], "panels": [ { "content": "## Details for $method ($request_id)", + "datasource": "${DS_INFLUXDB-RAILS}", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "gridPos": { "h": 2, "w": 24, @@ -73,29 +95,51 @@ "id": 4, "links": [], "mode": "markdown", - "options": {}, + "options": { + "content": "## Details for $method ($request_id)", + "mode": "markdown" + }, + "pluginVersion": "7.1.0", "title": "", "type": "text" }, { "cacheTimeout": null, - "colorBackground": false, - "colorPrefix": false, - "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "${DS_INFLUXDB}", + "datasource": "${DS_INFLUXDB-RAILS}", "description": "", - "format": "ms", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "N/A", + "type": 1, + "value": "null" + } + ], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#299c46", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 200 + }, + { + "color": "#d44a3a", + "value": 300 + } + ] + }, + "unit": "ms" + }, + "overrides": [] }, "gridPos": { "h": 3, @@ -106,39 +150,22 @@ "id": 2, "interval": null, "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "sum" + ], + "fields": "", + "values": false + }, + "textMode": "auto" }, - "tableColumn": "", + "pluginVersion": "7.1.1", "targets": [ { "groupBy": [], @@ -172,36 +199,45 @@ ] } ], - "thresholds": "200,300", "title": "Total Controller Action Runtime", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "total" + "type": "stat" }, { "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "${DS_INFLUXDB}", - "format": "ms", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "datasource": "${DS_INFLUXDB-RAILS}", + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "N/A", + "type": 1, + "value": "null" + } + ], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#299c46", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 200 + }, + { + "color": "#d44a3a", + "value": 300 + } + ] + }, + "unit": "ms" + }, + "overrides": [] }, "gridPos": { "h": 3, @@ -212,39 +248,22 @@ "id": 6, "interval": null, "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto" }, - "tableColumn": "", + "pluginVersion": "7.1.1", "targets": [ { "groupBy": [], @@ -278,36 +297,45 @@ ] } ], - "thresholds": "200,300", "title": "Total Database Query Runtime", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" + "type": "stat" }, { "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "${DS_INFLUXDB}", - "format": "ms", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "datasource": "${DS_INFLUXDB-RAILS}", + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "0", + "type": 1, + "value": "null" + } + ], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#299c46", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 200 + }, + { + "color": "#d44a3a", + "value": 300 + } + ] + }, + "unit": "ms" + }, + "overrides": [] }, "gridPos": { "h": 3, @@ -318,39 +346,22 @@ "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, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto" }, - "tableColumn": "", + "pluginVersion": "7.1.1", "targets": [ { "groupBy": [], @@ -384,49 +395,48 @@ ] } ], - "thresholds": "200,300", "title": "Total View Rendering Runtime", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" + "type": "stat" }, { "columns": [], - "datasource": "${DS_INFLUXDB}", + "datasource": "${DS_INFLUXDB-RAILS}", "description": "Database queries in this request.\n\n- Count: Number of occurrences\n- Mean: Average time spent in this query\n- Maximum: Slowest occurrence\n- Total: Total amount of time spent in this query", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fontSize": "100%", "gridPos": { - "h": 8, - "w": 24, + "h": 7, + "w": 12, "x": 0, "y": 5 }, "id": 12, "links": [], - "options": {}, "pageSize": null, "scroll": true, "showHeader": true, "sort": { - "col": 4, + "col": 5, "desc": true }, "styles": [ { + "$$hashKey": "object:554", "alias": "Time", + "align": "auto", "dateFormat": "YYYY-MM-DD HH:mm:ss", "pattern": "Time", "type": "hidden" }, { + "$$hashKey": "object:555", "alias": "Count", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -442,7 +452,9 @@ "unit": "short" }, { + "$$hashKey": "object:556", "alias": "Query", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -453,12 +465,23 @@ "decimals": 2, "mappingType": 1, "pattern": "name", + "preserveFormat": false, + "sanitize": false, "thresholds": [], - "type": "number", - "unit": "short" + "type": "string", + "unit": "short", + "valueMaps": [ + { + "$$hashKey": "object:823", + "text": "Unkown", + "value": "" + } + ] }, { + "$$hashKey": "object:557", "alias": "Mean", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -474,7 +497,9 @@ "unit": "ms" }, { + "$$hashKey": "object:558", "alias": "Maximum", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -490,7 +515,9 @@ "unit": "ms" }, { + "$$hashKey": "object:559", "alias": "Total", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -506,7 +533,9 @@ "unit": "ms" }, { + "$$hashKey": "object:560", "alias": "", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -602,22 +631,127 @@ ], "title": "Database Queries", "transform": "table", - "type": "table" + "type": "table-old" + }, + { + "cacheTimeout": null, + "datasource": "${DS_INFLUXDB-RAILS}", + "description": "", + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 100 + }, + { + "color": "red", + "value": 200 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 5 + }, + "id": 17, + "interval": null, + "links": [], + "maxDataPoints": 3, + "options": { + "displayMode": "lcd", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": true + }, + "showUnfilled": true + }, + "pluginVersion": "7.1.1", + "targets": [ + { + "alias": "$tag_class_name", + "groupBy": [ + { + "params": [ + "class_name" + ], + "type": "tag" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "record_count" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [ + { + "key": "request_id", + "operator": "=~", + "value": "/^$request_id$/" + }, + { + "condition": "AND", + "key": "hook", + "operator": "=", + "value": "instantiation" + } + ] + } + ], + "title": "Record Instantiation", + "type": "bargauge" }, { "columns": [], - "datasource": "${DS_INFLUXDB}", + "datasource": "${DS_INFLUXDB-RAILS}", "description": "Views rendered in this request.\n\n- Count: Number of occurrences\n- Mean: Average time spent in this query\n- Maximum: Slowest occurrence", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fontSize": "100%", "gridPos": { "h": 9, "w": 12, "x": 0, - "y": 13 + "y": 12 }, "id": 10, "links": [], - "options": {}, "pageSize": null, "scroll": true, "showHeader": true, @@ -628,12 +762,14 @@ "styles": [ { "alias": "Time", + "align": "auto", "dateFormat": "YYYY-MM-DD HH:mm:ss", "pattern": "Time", "type": "hidden" }, { "alias": "Count", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -650,6 +786,7 @@ }, { "alias": "Mean", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -666,6 +803,7 @@ }, { "alias": "Maximum", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -682,6 +820,7 @@ }, { "alias": "File", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -765,38 +904,45 @@ ], "title": "Views Rendered", "transform": "table", - "type": "table" + "type": "table-old" }, { "columns": [], - "datasource": "${DS_INFLUXDB}", + "datasource": "${DS_INFLUXDB-RAILS}", "description": "Partials rendered in this request.\n\n- Count: Number of occurrences\n- Mean: Average time spent in this partial\n- Maximum: Slowest occurrence\n- Total: Total time spent in this partial", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fontSize": "100%", "gridPos": { "h": 9, "w": 12, "x": 12, - "y": 13 + "y": 12 }, "id": 16, "links": [], - "options": {}, "pageSize": null, "scroll": true, "showHeader": true, "sort": { - "col": 4, + "col": 5, "desc": true }, "styles": [ { "alias": "Time", + "align": "auto", "dateFormat": "YYYY-MM-DD HH:mm:ss", "pattern": "Time", "type": "hidden" }, { "alias": "Count", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -813,6 +959,7 @@ }, { "alias": "File", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -829,6 +976,7 @@ }, { "alias": "Mean", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -845,6 +993,7 @@ }, { "alias": "Maximum", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -861,6 +1010,7 @@ }, { "alias": "Total", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -877,6 +1027,7 @@ }, { "alias": "", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -972,16 +1123,15 @@ ], "title": "Partials Rendered", "transform": "table", - "type": "table" + "type": "table-old" } ], "refresh": false, - "schemaVersion": 18, + "schemaVersion": 26, "style": "dark", "tags": [ - "performance", - "ruby on rails", - "influxdb" + "Performance", + "Ruby on Rails" ], "templating": { "list": [ @@ -1000,7 +1150,7 @@ "value": "" } ], - "query": "", + "query": "ba3c5e76-d15a-40fb-bb0c-a6dc0220fa8c", "skipUrlSync": false, "type": "textbox" }, @@ -1019,7 +1169,7 @@ "value": "" } ], - "query": "", + "query": "Webui::PackageController#meta", "skipUrlSync": false, "type": "textbox" } @@ -1047,7 +1197,7 @@ ] }, "timezone": "", - "title": "Ruby On Rails Performance (per Request)", - "uid": "H8S9fSVWz", - "version": 1 -} + "title": "Performance (per Request)", + "uid": "influxdb-rails-request", + "version": 9 +} \ No newline at end of file diff --git a/sample-dashboard/Ruby On Rails Performance.json b/sample-dashboard/Ruby On Rails Performance.json index ee29c8d..29808a3 100644 --- a/sample-dashboard/Ruby On Rails Performance.json +++ b/sample-dashboard/Ruby On Rails Performance.json @@ -1,8 +1,8 @@ { "__inputs": [ { - "name": "DS_INFLUXDB", - "label": "InfluxDB", + "name": "DS_INFLUXDB-RAILS", + "label": "InfluxDB-Rails", "description": "", "type": "datasource", "pluginId": "influxdb", @@ -14,7 +14,7 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "6.2.4" + "version": "7.1.1" }, { "type": "panel", @@ -30,14 +30,8 @@ }, { "type": "panel", - "id": "singlestat", - "name": "Singlestat", - "version": "" - }, - { - "type": "panel", - "id": "table", - "name": "Table", + "id": "stat", + "name": "Stat", "version": "" } ], @@ -54,83 +48,81 @@ } ] }, - "description": "Ruby on Rails Performance Insights based on influxdb and influxdb-rails", + "description": "Insights based on influxdb-rails", "editable": true, "gnetId": 10428, "graphTooltip": 0, "id": null, - "iteration": 1571758610473, - "links": [], + "iteration": 1616428241231, + "links": [ + { + "$$hashKey": "object:269", + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "influxdb-rails" + ], + "targetBlank": false, + "type": "dashboards" + } + ], "panels": [ { "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "${DS_INFLUXDB}", - "description": "", - "format": "ms", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "datasource": "${DS_INFLUXDB-RAILS}", + "fieldConfig": { + "defaults": { + "custom": {}, + "displayName": "Requests", + "mappings": [], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [] }, - "id": 10, + "gridPos": { + "h": 3, + "w": 4, + "x": 0, + "y": 0 + }, + "id": 16, "interval": null, "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "sum" + ], + "fields": "", + "values": false + }, + "textMode": "auto" }, - "tableColumn": "", + "pluginVersion": "7.1.1", "targets": [ { "groupBy": [ { "params": [ - "$__interval" + "$per" ], "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" } ], "hide": false, @@ -143,13 +135,13 @@ [ { "params": [ - "controller" + "request_id" ], "type": "field" }, { "params": [], - "type": "mean" + "type": "count" } ] ], @@ -162,93 +154,57 @@ ] } ], - "thresholds": "200,300", - "title": "Average Controller Action Time", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" + "title": "Requests served", + "type": "stat" }, { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "${DS_INFLUXDB}", - "format": "ms", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "datasource": "${DS_INFLUXDB-RAILS}", + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] }, "gridPos": { "h": 3, - "w": 6, - "x": 6, + "w": 4, + "x": 4, "y": 0 }, - "id": 12, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 + "id": 26, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "sum" + ], + "fields": "", + "values": false }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true + "textMode": "auto" }, - "tableColumn": "", + "pluginVersion": "7.1.1", "targets": [ { "groupBy": [ { "params": [ - "$__interval" + "$per" ], "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" } ], "measurement": "rails", @@ -260,13 +216,13 @@ [ { "params": [ - "db" + "value" ], "type": "field" }, { "params": [], - "type": "mean" + "type": "count" } ] ], @@ -274,90 +230,62 @@ { "key": "hook", "operator": "=", - "value": "process_action" + "value": "perform" } ] } ], - "thresholds": "50,100", - "title": "Average Database Query Time", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" + "timeFrom": null, + "timeShift": null, + "title": "Jobs Executed", + "type": "stat" }, { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "${DS_INFLUXDB}", - "format": "ms", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "datasource": "${DS_INFLUXDB-RAILS}", + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] }, "gridPos": { "h": 3, - "w": 6, - "x": 12, + "w": 4, + "x": 8, "y": 0 }, - "id": 14, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 + "id": 27, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "sum" + ], + "fields": "", + "values": false }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true + "textMode": "auto" }, - "tableColumn": "", + "pluginVersion": "7.1.1", "targets": [ { "groupBy": [ { "params": [ - "$interval" + "$per" ], "type": "time" } @@ -371,13 +299,13 @@ [ { "params": [ - "view" + "value" ], "type": "field" }, { "params": [], - "type": "mean" + "type": "count" } ] ], @@ -385,88 +313,88 @@ { "key": "hook", "operator": "=", - "value": "process_action" + "value": "deliver" } ] } ], - "thresholds": "50,100", - "title": "Average View Rendering Time", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" + "timeFrom": null, + "timeShift": null, + "title": "Mails Sent", + "type": "stat" }, { "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "${DS_INFLUXDB}", - "decimals": null, - "format": "short", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "datasource": "${DS_INFLUXDB-RAILS}", + "description": "", + "fieldConfig": { + "defaults": { + "custom": {}, + "displayName": "Response Time", + "mappings": [], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#299c46", + "value": null + }, + { + "color": "yellow", + "value": 150 + }, + { + "color": "red", + "value": 300 + } + ] + }, + "unit": "ms" + }, + "overrides": [] }, "gridPos": { "h": 3, - "w": 6, - "x": 18, + "w": 4, + "x": 12, "y": 0 }, - "id": 16, + "id": 10, "interval": null, "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto" }, - "tableColumn": "", + "pluginVersion": "7.1.1", "targets": [ { - "groupBy": [], + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], "hide": false, "measurement": "rails", "orderByTime": "ASC", @@ -477,13 +405,13 @@ [ { "params": [ - "request_id" + "controller" ], "type": "field" }, { "params": [], - "type": "count" + "type": "mean" } ] ], @@ -496,84 +424,76 @@ ] } ], - "thresholds": "", - "title": "Total Number of Requests", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" + "title": "Average Response", + "type": "stat" }, { - "aliasColors": { - "rails.controller.mean": "#1f78c1" + "cacheTimeout": null, + "datasource": "${DS_INFLUXDB-RAILS}", + "fieldConfig": { + "defaults": { + "custom": {}, + "displayName": "Response Time", + "mappings": [], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#299c46", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 50 + }, + { + "color": "#d44a3a", + "value": 100 + } + ] + }, + "unit": "ms" + }, + "overrides": [] }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_INFLUXDB}", - "description": "Time spent in controller actions", - "fill": 1, "gridPos": { - "h": 9, - "w": 8, - "x": 0, - "y": 3 - }, - "id": 6, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": false, - "total": false, - "values": false + "h": 3, + "w": 4, + "x": 16, + "y": 0 }, - "lines": true, - "linewidth": 1, + "id": 12, + "interval": null, "links": [], - "nullPointMode": "null", - "options": {}, - "paceLength": 10, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Maximum", - "fillBelowTo": "Minimum", - "lines": false + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false }, - { - "alias": "Minimum", - "lines": false - } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "textMode": "auto" + }, + "pluginVersion": "7.1.1", "targets": [ { - "alias": "Maximum", "groupBy": [ { "params": [ - "$__interval" + "$per" ], "type": "time" }, { "params": [ - "0" + "null" ], "type": "fill" } @@ -581,19 +501,19 @@ "measurement": "rails", "orderByTime": "ASC", "policy": "default", - "refId": "C", + "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ - "controller" + "db" ], "type": "field" }, { "params": [], - "type": "max" + "type": "mean" } ] ], @@ -604,19 +524,78 @@ "value": "process_action" } ] + } + ], + "title": "Average Database Response", + "type": "stat" + }, + { + "cacheTimeout": null, + "datasource": "${DS_INFLUXDB-RAILS}", + "fieldConfig": { + "defaults": { + "custom": {}, + "displayName": "Response Time", + "mappings": [], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#299c46", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 1500 + }, + { + "color": "#d44a3a", + "value": 3000 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 20, + "y": 0 + }, + "id": 28, + "interval": null, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false }, + "textMode": "auto" + }, + "pluginVersion": "7.1.1", + "targets": [ { - "alias": "Mean", "groupBy": [ { "params": [ - "$__interval" + "$per" ], "type": "time" }, { "params": [ - "0" + "null" ], "type": "fill" } @@ -630,7 +609,7 @@ [ { "params": [ - "controller" + "value" ], "type": "field" }, @@ -644,156 +623,75 @@ { "key": "hook", "operator": "=", - "value": "process_action" - } - ] - }, - { - "alias": "Minimum", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "0" - ], - "type": "fill" - } - ], - "measurement": "rails", - "orderByTime": "ASC", - "policy": "default", - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "controller" - ], - "type": "field" - }, - { - "params": [], - "type": "min" - } - ] - ], - "tags": [ - { - "key": "hook", - "operator": "=", - "value": "process_action" + "value": "perform" } ] } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Controller Action Runtime", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "dtdurationms", - "label": null, - "logBase": 2, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "title": "Average Job Execution", + "type": "stat" }, { - "aliasColors": {}, - "bars": false, + "aliasColors": { + "Error": "dark-red", + "Success": "semi-dark-green" + }, + "bars": true, "dashLength": 10, "dashes": false, - "datasource": "${DS_INFLUXDB}", - "description": "Time spent in executing database queries", + "datasource": "${DS_INFLUXDB-RAILS}", + "description": "Requests Served", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 1, + "fillGradient": 0, "gridPos": { - "h": 9, - "w": 8, - "x": 8, + "h": 7, + "w": 12, + "x": 0, "y": 3 }, - "id": 2, + "hiddenSeries": false, + "id": 18, "legend": { "avg": false, "current": false, "max": false, "min": false, - "show": false, + "show": true, "total": false, "values": false }, - "lines": true, + "lines": false, "linewidth": 1, "links": [], "nullPointMode": "null", - "options": {}, - "paceLength": 10, "percentage": false, - "pointradius": 5, + "pluginVersion": "7.1.1", + "pointradius": 2, "points": false, "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Maximum", - "fillBelowTo": "Minimum", - "lines": false - }, - { - "alias": "Minimum", - "lines": false - } - ], + "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { - "alias": "Maximum", + "alias": "Success", "groupBy": [ { "params": [ - "$__interval" + "$per" ], "type": "time" }, { "params": [ - "0" + "previous" ], "type": "fill" } @@ -801,19 +699,19 @@ "measurement": "rails", "orderByTime": "ASC", "policy": "default", - "refId": "B", + "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ - "db" + "controller" ], "type": "field" }, { "params": [], - "type": "max" + "type": "count" } ] ], @@ -822,64 +720,27 @@ "key": "hook", "operator": "=", "value": "process_action" - } - ] - }, - { - "alias": "Mean", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" }, { - "params": [ - "0" - ], - "type": "fill" - } - ], - "measurement": "rails", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "db" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [ - { - "key": "hook", + "condition": "AND", + "key": "status", "operator": "=", - "value": "process_action" + "value": "200" } ] }, { - "alias": "Minimum", + "alias": "Error", "groupBy": [ { "params": [ - "$__interval" + "$per" ], "type": "time" }, { "params": [ - "0" + "previous" ], "type": "fill" } @@ -887,19 +748,19 @@ "measurement": "rails", "orderByTime": "ASC", "policy": "default", - "refId": "C", + "refId": "B", "resultFormat": "time_series", "select": [ [ { "params": [ - "db" + "controller" ], "type": "field" }, { "params": [], - "type": "min" + "type": "count" } ] ], @@ -908,6 +769,12 @@ "key": "hook", "operator": "=", "value": "process_action" + }, + { + "condition": "AND", + "key": "status", + "operator": "!=", + "value": "200" } ] } @@ -916,7 +783,7 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "Database Query Runtime", + "title": "Requests per $per", "tooltip": { "shared": true, "sort": 0, @@ -932,14 +799,16 @@ }, "yaxes": [ { - "format": "dtdurationms", + "$$hashKey": "object:477", + "format": "short", "label": null, - "logBase": 2, + "logBase": 1, "max": null, "min": null, "show": true }, { + "$$hashKey": "object:478", "format": "short", "label": null, "logBase": 1, @@ -955,27 +824,37 @@ }, { "aliasColors": { - "rails.view.mean": "#eab839" + "rails.controller.mean": "#1f78c1" }, "bars": false, "dashLength": 10, "dashes": false, - "datasource": "${DS_INFLUXDB}", - "description": "Time spent in rendering views", - "fill": 0, + "datasource": "${DS_INFLUXDB-RAILS}", + "description": "Time spent in controller actions", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, "gridPos": { - "h": 9, - "w": 8, - "x": 16, + "h": 7, + "w": 12, + "x": 12, "y": 3 }, - "id": 4, + "hiddenSeries": false, + "id": 6, "legend": { + "alignAsTable": false, "avg": false, "current": false, "max": false, "min": false, - "show": false, + "rightSide": false, + "show": true, "total": false, "values": false }, @@ -983,9 +862,9 @@ "linewidth": 1, "links": [], "nullPointMode": "null", - "options": {}, "paceLength": 10, "percentage": false, + "pluginVersion": "7.1.1", "pointradius": 5, "points": false, "renderer": "flot", @@ -1005,17 +884,17 @@ "steppedLine": false, "targets": [ { - "alias": "Maximum", + "alias": "P99", "groupBy": [ { "params": [ - "$__interval" + "$per" ], "type": "time" }, { "params": [ - "0" + "null" ], "type": "fill" } @@ -1023,19 +902,21 @@ "measurement": "rails", "orderByTime": "ASC", "policy": "default", - "refId": "C", + "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ - "view" + "controller" ], "type": "field" }, { - "params": [], - "type": "max" + "params": [ + "99" + ], + "type": "percentile" } ] ], @@ -1048,17 +929,17 @@ ] }, { - "alias": "Mean", + "alias": "P95", "groupBy": [ { "params": [ - "$__interval" + "$per" ], "type": "time" }, { "params": [ - "0" + "null" ], "type": "fill" } @@ -1066,19 +947,64 @@ "measurement": "rails", "orderByTime": "ASC", "policy": "default", - "refId": "A", + "refId": "B", "resultFormat": "time_series", "select": [ [ { "params": [ - "view" + "controller" + ], + "type": "field" + }, + { + "params": [ + "95" + ], + "type": "percentile" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "process_action" + } + ] + }, + { + "alias": "P50", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "C", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "controller" ], "type": "field" }, { "params": [], - "type": "mean" + "type": "median" } ] ], @@ -1091,17 +1017,17 @@ ] }, { - "alias": "Minimum", + "alias": "Mean", "groupBy": [ { "params": [ - "$__interval" + "$per" ], "type": "time" }, { "params": [ - "0" + "null" ], "type": "fill" } @@ -1109,19 +1035,19 @@ "measurement": "rails", "orderByTime": "ASC", "policy": "default", - "refId": "B", + "refId": "D", "resultFormat": "time_series", "select": [ [ { "params": [ - "view" + "controller" ], "type": "field" }, { "params": [], - "type": "min" + "type": "mean" } ] ], @@ -1138,7 +1064,7 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "View Rendering Runtime", + "title": "Controller Action Performance", "tooltip": { "shared": true, "sort": 0, @@ -1154,7 +1080,8 @@ }, "yaxes": [ { - "format": "dtdurationms", + "$$hashKey": "object:2305", + "format": "ms", "label": null, "logBase": 2, "max": null, @@ -1162,12 +1089,13 @@ "show": true }, { + "$$hashKey": "object:2306", "format": "short", "label": null, "logBase": 1, "max": null, "min": null, - "show": true + "show": false } ], "yaxis": { @@ -1176,195 +1104,87 @@ } }, { - "columns": [], - "datasource": "${DS_INFLUXDB}", - "description": "Data for the selected range by controller action.\n\n- Count: Number of occurrences\n- Mean: Average time spent\n- Median: Median time spent\n- Maximum: Slowest occurrence\n\n[Average vs. Median?](https://www.differencebetween.com/difference-between-mean-and-median/)", - "fontSize": "100%", + "aliasColors": { + "Error": "dark-red", + "Success": "semi-dark-green" + }, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_INFLUXDB-RAILS}", + "description": "Records Instantiated", + "fieldConfig": { + "defaults": { + "custom": {}, + "displayName": "Records Instantiated" + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, "gridPos": { - "h": 13, + "h": 6, "w": 12, "x": 0, - "y": 12 - }, - "id": 18, - "links": [], - "options": {}, - "pageSize": null, - "scroll": true, - "showHeader": true, - "sort": { - "col": 5, - "desc": true + "y": 10 }, - "styles": [ - { - "alias": "Time", - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "pattern": "Time", - "type": "hidden" - }, - { - "alias": "Mean", - "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, - "mappingType": 1, - "pattern": "mean", - "thresholds": [], - "type": "number", - "unit": "ms" - }, - { - "alias": "Count", - "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": 0, - "mappingType": 1, - "pattern": "count", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Median", - "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, - "mappingType": 1, - "pattern": "median", - "thresholds": [], - "type": "number", - "unit": "ms" - }, - { - "alias": "Controller Action", - "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/$ACTION_DASHBOARD_UID/ruby-on-rails-performance-per-action?var-Action=${__cell}&from=$__from&to=$__to", - "mappingType": 1, - "pattern": "method", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Maximum", - "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, - "mappingType": 1, - "pattern": "max", - "thresholds": [], - "type": "number", - "unit": "ms" - }, - { - "alias": "", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 2, - "pattern": "/.*/", - "thresholds": [], - "type": "number", - "unit": "short" - } - ], + "hiddenSeries": false, + "id": 24, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, "targets": [ { + "alias": "", "groupBy": [ { "params": [ - "method" + "$per" ], - "type": "tag" + "type": "time" + }, + { + "params": [ + "previous" + ], + "type": "fill" } ], - "limit": "", "measurement": "rails", "orderByTime": "ASC", "policy": "default", "refId": "A", - "resultFormat": "table", + "resultFormat": "time_series", "select": [ [ { "params": [ - "controller" - ], - "type": "field" - }, - { - "params": [], - "type": "count" - } - ], - [ - { - "params": [ - "controller" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ], - [ - { - "params": [ - "controller" - ], - "type": "field" - }, - { - "params": [], - "type": "median" - } - ], - [ - { - "params": [ - "controller" + "record_count" ], "type": "field" }, { "params": [], - "type": "max" + "type": "sum" } ] ], @@ -1372,226 +1192,190 @@ { "key": "hook", "operator": "=", - "value": "process_action" + "value": "instantiation" } ] } ], - "title": "By Controller Action", - "transform": "table", - "type": "table" + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Instantiation per $per", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:477", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:478", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } }, { - "columns": [], - "datasource": "${DS_INFLUXDB}", - "description": "Data for the selected range by database query.\n\n- Count: Number of occurrences\n- Mean: Average time spent\n- Median: Median time spent\n- Maximum: Slowest occurrence\n\n[Average vs. Median?](https://www.differencebetween.com/difference-between-mean-and-median/)", - "fontSize": "100%", + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_INFLUXDB-RAILS}", + "description": "Time spent in executing database queries", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, "gridPos": { - "h": 13, + "h": 6, "w": 12, "x": 12, - "y": 12 + "y": 10 }, - "id": 29, - "links": [], - "options": {}, - "pageSize": null, - "scroll": true, - "showHeader": true, - "sort": { - "col": 6, - "desc": true + "hiddenSeries": false, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false }, - "styles": [ - { - "alias": "Time", - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "pattern": "Time", - "type": "hidden" - }, - { - "alias": "Count", - "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": null, - "mappingType": 1, - "pattern": "count", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Mean", - "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, - "mappingType": 1, - "pattern": "mean", - "thresholds": [], - "type": "number", - "unit": "ms" - }, - { - "alias": "Median", - "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, - "mappingType": 1, - "pattern": "median", - "thresholds": [], - "type": "number", - "unit": "ms" - }, - { - "alias": "Controller Action", - "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/$ACTION_DASHBOARD_UID/ruby-on-rails-performance-per-action?var-Action=${__cell}&from=$__from&to=$__to", - "mappingType": 1, - "pattern": "location", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Name of the operation", - "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, - "mappingType": 1, - "pattern": "name", - "thresholds": [], - "type": "number", - "unit": "short" - }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ { "alias": "Maximum", - "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, - "mappingType": 1, - "pattern": "max", - "thresholds": [], - "type": "number", - "unit": "ms" + "fillBelowTo": "Minimum", + "lines": false }, { - "alias": "", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 2, - "pattern": "/.*/", - "thresholds": [], - "type": "number", - "unit": "short" + "alias": "Minimum", + "lines": false } ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, "targets": [ { + "alias": "P99", "groupBy": [ { "params": [ - "name" + "$per" ], - "type": "tag" + "type": "time" }, { "params": [ - "location" + "null" ], - "type": "tag" + "type": "fill" } ], "measurement": "rails", "orderByTime": "ASC", "policy": "default", "refId": "A", - "resultFormat": "table", + "resultFormat": "time_series", "select": [ [ { "params": [ - "value" + "db" ], "type": "field" }, - { - "params": [], - "type": "count" - } - ], - [ { "params": [ - "value" + "99" ], - "type": "field" - }, - { - "params": [], - "type": "mean" + "type": "percentile" } - ], + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "process_action" + } + ] + }, + { + "alias": "P95", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ [ { "params": [ - "value" + "db" ], "type": "field" }, - { - "params": [], - "type": "median" - } - ], - [ { "params": [ - "value" + "95" ], - "type": "field" - }, - { - "params": [], - "type": "max" + "type": "percentile" } ] ], @@ -1599,137 +1383,415 @@ { "key": "hook", "operator": "=", - "value": "sql" + "value": "process_action" } ] - } - ], - "title": "By Database Query", - "transform": "table", - "type": "table" - }, - { - "columns": [], - "datasource": "${DS_INFLUXDB}", - "description": "Data for the selected range by view rendering.\n\n- Count: Number of occurrences\n- Mean: Average time spent\n- Median: Median time spent\n- Maximum: Slowest occurrence\n\n[Average vs. Median?](https://www.differencebetween.com/difference-between-mean-and-median/)", - "fontSize": "100%", + }, + { + "alias": "P50", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "C", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "db" + ], + "type": "field" + }, + { + "params": [], + "type": "median" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "process_action" + } + ] + }, + { + "alias": "Mean", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "D", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "db" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "process_action" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Database Query Performance", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:2533", + "format": "dtdurationms", + "label": null, + "logBase": 2, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:2534", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": { + "Failed": "red", + "Jobs": "green" + }, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_INFLUXDB-RAILS}", + "description": "Jobs Performed", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, "gridPos": { - "h": 13, + "h": 6, "w": 12, "x": 0, - "y": 25 + "y": 16 }, - "id": 27, - "links": [], - "options": {}, - "pageSize": null, - "scroll": true, - "showHeader": true, - "sort": { - "col": 5, - "desc": true + "hiddenSeries": false, + "id": 20, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false }, - "styles": [ - { - "alias": "Time", - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "pattern": "Time", - "type": "hidden" - }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ { - "alias": "Count", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" + "alias": "Success", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "count", - "thresholds": [], - "type": "number", - "unit": "short" + "hide": false, + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "perform" + }, + { + "condition": "AND", + "key": "state", + "operator": "=", + "value": "succeeded" + } + ] }, { - "alias": "Mean", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" + "alias": "Failed", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "mappingType": 1, - "pattern": "mean", - "thresholds": [], - "type": "number", - "unit": "ms" + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "perform" + }, + { + "condition": "AND", + "key": "state", + "operator": "=", + "value": "failed" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Jobs per $per", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:737", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true }, { - "alias": "Median", - "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, - "mappingType": 1, - "pattern": "median", - "thresholds": [], - "type": "number", - "unit": "ms" + "$$hashKey": "object:738", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": { + "rails.view.mean": "#eab839" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_INFLUXDB-RAILS}", + "description": "Time spent in executing jobs", + "fieldConfig": { + "defaults": { + "custom": {} }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 16 + }, + "hiddenSeries": false, + "id": 23, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ { "alias": "Maximum", - "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, - "mappingType": 1, - "pattern": "max", - "thresholds": [], - "type": "number", - "unit": "ms" + "fillBelowTo": "Minimum", + "lines": false }, { - "alias": "View", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 2, - "pattern": "/.*/", - "thresholds": [], - "type": "number", - "unit": "short" + "alias": "Minimum", + "lines": false } ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, "targets": [ { + "alias": "P99", "groupBy": [ { "params": [ - "filename" + "$per" + ], + "type": "time" + }, + { + "params": [ + "null" ], - "type": "tag" + "type": "fill" } ], "measurement": "rails", "orderByTime": "ASC", "policy": "default", "refId": "A", - "resultFormat": "table", + "resultFormat": "time_series", "select": [ [ { @@ -1739,10 +1801,43 @@ "type": "field" }, { - "params": [], - "type": "count" + "params": [ + "99" + ], + "type": "percentile" } - ], + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "perform" + } + ] + }, + { + "alias": "P95", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ [ { "params": [ @@ -1751,10 +1846,45 @@ "type": "field" }, { - "params": [], - "type": "mean" + "params": [ + "95" + ], + "type": "percentile" } - ], + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "perform" + } + ] + }, + { + "alias": "P50", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT percentile(\"view\", 50) FROM \"rails\" WHERE (\"hook\" = 'process_action') AND $timeFilter GROUP BY time(1m) fill(null)", + "rawQuery": false, + "refId": "C", + "resultFormat": "time_series", + "select": [ [ { "params": [ @@ -1766,7 +1896,38 @@ "params": [], "type": "median" } - ], + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "perform" + } + ] + }, + { + "alias": "Mean", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "D", + "resultFormat": "time_series", + "select": [ [ { "params": [ @@ -1776,7 +1937,7 @@ }, { "params": [], - "type": "max" + "type": "mean" } ] ], @@ -1784,158 +1945,126 @@ { "key": "hook", "operator": "=", - "value": "render_template" + "value": "perform" } ] } ], - "title": "By View Rendering", - "transform": "table", - "type": "table" - }, - { - "columns": [], - "datasource": "${DS_INFLUXDB}", - "description": "Data for the selected range by request ID.\n\n- Maximum: Slowest occurrence", - "fontSize": "100%", - "gridPos": { - "h": 13, - "w": 12, - "x": 12, - "y": 25 + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "ActiveJob Performance", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" }, - "id": 33, - "links": [], - "options": {}, - "pageSize": null, - "scroll": true, - "showHeader": true, - "sort": { - "col": 4, - "desc": true + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] }, - "styles": [ - { - "alias": "Finished", - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "pattern": "Time", - "type": "hidden" - }, - { - "alias": "Started", - "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" - }, - { - "alias": "Maximum", - "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, - "mappingType": 1, - "pattern": "max", - "thresholds": [], - "type": "number", - "unit": "ms" - }, + "yaxes": [ { - "alias": "Request ID", - "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": false, - "linkTooltip": "View data per this Request", - "linkUrl": "/d/$REQUEST_DASHBOARD_UID/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" + "$$hashKey": "object:3057", + "format": "ms", + "label": null, + "logBase": 2, + "max": null, + "min": null, + "show": true }, { - "alias": "Controller Action", - "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/$ACTION_DASHBOARD_UID/ruby-on-rails-performance-per-action?var-Action=${__cell}&from=$__from&to=$__to", - "mappingType": 1, - "pattern": "method", - "thresholds": [], - "type": "number", - "unit": "short" + "$$hashKey": "object:3058", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false } ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_INFLUXDB-RAILS}", + "description": "Emails Sent", + "fieldConfig": { + "defaults": { + "custom": {}, + "displayName": "Emails" + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 22 + }, + "hiddenSeries": false, + "id": 22, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": false, + "linewidth": 2, + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, "targets": [ { + "alias": "", "groupBy": [ { "params": [ - "method" + "$per" ], - "type": "tag" + "type": "time" } ], - "limit": "20", "measurement": "rails", "orderByTime": "ASC", "policy": "default", "refId": "A", - "resultFormat": "table", + "resultFormat": "time_series", "select": [ [ { "params": [ - "started" - ], - "type": "field" - } - ], - [ - { - "params": [ - "request_id" - ], - "type": "field" - } - ], - [ - { - "params": [ - "controller" + "value" ], "type": "field" }, { "params": [], - "type": "max" + "type": "count" } ] ], @@ -1943,65 +2072,145 @@ { "key": "hook", "operator": "=", - "value": "process_action" + "value": "deliver" } ] } ], - "title": "By Request ID", - "transform": "table", - "type": "table" + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Mails per $per", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:282", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:283", + "decimals": 0, + "format": "Misc", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } } ], "refresh": "5m", - "schemaVersion": 18, + "schemaVersion": 26, "style": "dark", "tags": [ - "performance", - "ruby on rails", - "influxdb" + "Performance", + "Ruby on Rails", + "influxdb-rails" ], "templating": { "list": [ { - "allValue": null, + "auto": true, + "auto_count": "50", + "auto_min": "", "current": { - "text": "H8S9fSVWz", - "value": "H8S9fSVWz" + "selected": false, + "text": "auto", + "value": "$__auto_interval_per" }, - "hide": 2, - "includeAll": false, + "hide": 0, "label": null, - "multi": false, - "name": "REQUEST_DASHBOARD_UID", + "name": "per", "options": [ { "selected": true, - "text": "H8S9fSVWz", - "value": "H8S9fSVWz" - } - ], - "query": "H8S9fSVWz", - "skipUrlSync": false, - "type": "custom" - }, - { - "current": { - "value": "Gpp3B1Pik", - "text": "Gpp3B1Pik" - }, - "hide": 2, - "label": null, - "name": "ACTION_DASHBOARD_UID", - "options": [ + "text": "auto", + "value": "$__auto_interval_per" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "5m", + "value": "5m" + }, + { + "selected": false, + "text": "10m", + "value": "10m" + }, + { + "selected": false, + "text": "30m", + "value": "30m" + }, + { + "selected": false, + "text": "1h", + "value": "1h" + }, + { + "selected": false, + "text": "6h", + "value": "6h" + }, + { + "selected": false, + "text": "12h", + "value": "12h" + }, + { + "selected": false, + "text": "1d", + "value": "1d" + }, + { + "selected": false, + "text": "7d", + "value": "7d" + }, + { + "selected": false, + "text": "14d", + "value": "14d" + }, { - "value": "Gpp3B1Pik", - "text": "Gpp3B1Pik" + "selected": false, + "text": "30d", + "value": "30d" } ], - "query": "Gpp3B1Pik", + "query": "1m,5m,10m,30m,1h,6h,12h,1d,7d,14d,30d", + "queryValue": "", + "refresh": 2, "skipUrlSync": false, - "type": "constant" + "type": "interval" } ] }, @@ -2011,7 +2220,6 @@ }, "timepicker": { "refresh_intervals": [ - "5s", "10s", "30s", "1m", @@ -2035,7 +2243,7 @@ ] }, "timezone": "", - "title": "Ruby On Rails Performance Overview", - "uid": "K2CJtIVZz", - "version": 1 -} + "title": "Performance", + "uid": "influxdb-rails-overview", + "version": 24 +} \ No newline at end of file diff --git a/sample-dashboard/Ruby On Rails Requests.json b/sample-dashboard/Ruby On Rails Requests.json new file mode 100644 index 0000000..a89dc27 --- /dev/null +++ b/sample-dashboard/Ruby On Rails Requests.json @@ -0,0 +1,834 @@ +{ + "__inputs": [ + { + "name": "DS_INFLUXDB-RAILS", + "label": "InfluxDB-Rails", + "description": "", + "type": "datasource", + "pluginId": "influxdb", + "pluginName": "InfluxDB" + } + ], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "7.1.1" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph", + "version": "" + }, + { + "type": "datasource", + "id": "influxdb", + "name": "InfluxDB", + "version": "1.0.0" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": null, + "iteration": 1616428850617, + "links": [ + { + "$$hashKey": "object:55", + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "influxdb-rails" + ], + "type": "dashboards" + } + ], + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_INFLUXDB-RAILS}", + "description": "", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "id": 12, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_exception", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "exception" + ], + "type": "tag" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "controller" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "process_action" + }, + { + "condition": "AND", + "key": "exception", + "operator": "=~", + "value": "/\\w/" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Exceptions", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_INFLUXDB-RAILS}", + "description": "", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 0 + }, + "hiddenSeries": false, + "id": 10, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_http_method", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "http_method" + ], + "type": "tag" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "controller" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "process_action" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Methods", + "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": 2, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_INFLUXDB-RAILS}", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 9 + }, + "hiddenSeries": false, + "id": 13, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "Value", + "hideTooltip": true, + "legend": false + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_status", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "status" + ], + "type": "tag" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "controller" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "process_action" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "HTTP Status", + "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": 2, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_INFLUXDB-RAILS}", + "description": "", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 9 + }, + "hiddenSeries": false, + "id": 8, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_format", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "format" + ], + "type": "tag" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "controller" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "process_action" + }, + { + "condition": "AND", + "key": "format", + "operator": "=~", + "value": "/\\w/" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Format", + "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": 2, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_INFLUXDB-RAILS}", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 22, + "w": 24, + "x": 0, + "y": 18 + }, + "hiddenSeries": false, + "id": 15, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "hideEmpty": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "total", + "sortDesc": true, + "total": true, + "values": true + }, + "lines": false, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_location", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "location" + ], + "type": "tag" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "controller" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "process_action" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Actions", + "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": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": "5m", + "schemaVersion": 26, + "style": "dark", + "tags": [ + "Health", + "Ruby on Rails", + "influxdb-rails" + ], + "templating": { + "list": [ + { + "auto": true, + "auto_count": "50", + "auto_min": "", + "current": { + "selected": true, + "text": "auto", + "value": "$__auto_interval_per" + }, + "hide": 0, + "label": null, + "name": "per", + "options": [ + { + "selected": true, + "text": "auto", + "value": "$__auto_interval_per" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "5m", + "value": "5m" + }, + { + "selected": false, + "text": "15m", + "value": "15m" + }, + { + "selected": false, + "text": "30m", + "value": "30m" + }, + { + "selected": false, + "text": "1h", + "value": "1h" + }, + { + "selected": false, + "text": "12h", + "value": "12h" + }, + { + "selected": false, + "text": "1d", + "value": "1d" + }, + { + "selected": false, + "text": "1w", + "value": "1w" + } + ], + "query": "1m,5m,15m,30m,1h,12h,1d,1w", + "queryValue": "", + "refresh": 2, + "skipUrlSync": false, + "type": "interval" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "Requests", + "uid": "influxdb-rails-requests", + "version": 17 +} \ No newline at end of file diff --git a/sample-dashboard/Ruby On Rails Slowlog by Action.json b/sample-dashboard/Ruby On Rails Slowlog by Action.json new file mode 100644 index 0000000..fc62533 --- /dev/null +++ b/sample-dashboard/Ruby On Rails Slowlog by Action.json @@ -0,0 +1,278 @@ +{ + "__inputs": [ + { + "name": "DS_INFLUXDB-RAILS", + "label": "InfluxDB-Rails", + "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 controller actions", + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": null, + "links": [ + { + "$$hashKey": "object:349", + "icon": "external link", + "keepTime": true, + "tags": [ + "influxdb-rails" + ], + "type": "dashboards" + } + ], + "panels": [ + { + "columns": [], + "datasource": "${DS_INFLUXDB-RAILS}", + "description": "The list of slowest controller actions", + "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": 3, + "desc": true + }, + "styles": [ + { + "$$hashKey": "object:5125", + "alias": "Finished", + "align": "auto", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "hidden" + }, + { + "$$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", + "50000" + ], + "type": "number", + "unit": "ms" + }, + { + "$$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_1}&from=${__cell_2}&to=${__cell_0}", + "mappingType": 1, + "pattern": "method", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "$$hashKey": "object:505", + "alias": "Started", + "align": "", + "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, + "mappingType": 1, + "pattern": "started", + "thresholds": [], + "type": "hidden", + "unit": "short" + }, + { + "$$hashKey": "object:826", + "alias": "Ended", + "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, + "mappingType": 1, + "pattern": "ended", + "thresholds": [], + "type": "hidden", + "unit": "short" + } + ], + "targets": [ + { + "groupBy": [ + { + "params": [ + "method" + ], + "type": "tag" + } + ], + "limit": "", + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "table", + "select": [ + [ + { + "params": [ + "started" + ], + "type": "field" + } + ], + [ + { + "params": [ + "controller" + ], + "type": "field" + }, + { + "params": [], + "type": "max" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "process_action" + } + ] + } + ], + "title": "Slowest Actions", + "transform": "table", + "transformations": [ + { + "id": "calculateField", + "options": { + "alias": "ended", + "binary": { + "left": "started", + "operator": "+", + "reducer": "sum", + "right": "max" + }, + "mode": "binary", + "reduce": { + "reducer": "sum" + } + } + } + ], + "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": "Slowlog by Controller Action", + "uid": "influxdb-rails-slowlog-action", + "version": 12 +} \ No newline at end of file diff --git a/sample-dashboard/Ruby On Rails Slowlog by Request.json b/sample-dashboard/Ruby On Rails Slowlog by Request.json new file mode 100644 index 0000000..4f9c184 --- /dev/null +++ b/sample-dashboard/Ruby On Rails Slowlog by Request.json @@ -0,0 +1,277 @@ +{ + "__inputs": [ + { + "name": "DS_INFLUXDB-RAILS", + "label": "InfluxDB-Rails", + "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": "", + "editable": true, + "gnetId": null, + "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": "Slowlog by Request", + "uid": "influxdb-rails-slowlog-request", + "version": 12 +} \ No newline at end of file diff --git a/sample-dashboard/Ruby On Rails Slowlog by SQL.json b/sample-dashboard/Ruby On Rails Slowlog by SQL.json new file mode 100644 index 0000000..5979938 --- /dev/null +++ b/sample-dashboard/Ruby On Rails Slowlog by SQL.json @@ -0,0 +1,328 @@ +{ + "__inputs": [ + { + "name": "DS_INFLUXDB-RAILS", + "label": "InfluxDB-Rails", + "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": "The sloweds queries in your app in the last hour", + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": null, + "links": [ + { + "$$hashKey": "object:40", + "icon": "external link", + "tags": [ + "influxdb-rails" + ], + "type": "dashboards" + } + ], + "panels": [ + { + "columns": [], + "datasource": "${DS_INFLUXDB-RAILS}", + "description": "Data for the selected range by database query.\n\n- Count: Number of occurrences\n- Mean: Average time spent\n- Median: Median time spent\n- Maximum: Slowest occurrence\n\n[Average vs. Median?](https://www.differencebetween.com/difference-between-mean-and-median/)", + "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": 6, + "desc": true + }, + "styles": [ + { + "alias": "Time", + "align": "auto", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "hidden" + }, + { + "alias": "Count", + "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": null, + "mappingType": 1, + "pattern": "count", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Mean", + "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, + "mappingType": 1, + "pattern": "mean", + "thresholds": [], + "type": "number", + "unit": "ms" + }, + { + "alias": "Median", + "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, + "mappingType": 1, + "pattern": "median", + "thresholds": [], + "type": "number", + "unit": "ms" + }, + { + "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": "location", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Name of the operation", + "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, + "mappingType": 1, + "pattern": "name", + "thresholds": [], + "type": "string", + "unit": "short", + "valueMaps": [ + { + "text": "Raw", + "value": "" + } + ] + }, + { + "alias": "Maximum", + "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" + } + ], + "targets": [ + { + "groupBy": [ + { + "params": [ + "name" + ], + "type": "tag" + }, + { + "params": [ + "location" + ], + "type": "tag" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "table", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ], + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ], + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "median" + } + ], + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "max" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "sql" + } + ] + } + ], + "title": "Slowest Database Query", + "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": { + "hidden": false, + "refresh_intervals": [ + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "Slowlog by SQL Query", + "uid": "influxdb-rails-slowlog-sql", + "version": 14 +} \ No newline at end of file diff --git a/sample-dashboard/docker-compose.yml b/sample-dashboard/docker-compose.yml index 5d8d070..182ed07 100644 --- a/sample-dashboard/docker-compose.yml +++ b/sample-dashboard/docker-compose.yml @@ -13,7 +13,7 @@ services: ports: - 8086:8086 grafana: - image: grafana/grafana:6.2.4 + image: grafana/grafana:7.4.5 ports: - 3000:3000 depends_on: @@ -24,6 +24,11 @@ services: - ./provisioning/performance.json:/var/lib/grafana/dashboards/performance.json:ro - ./provisioning/performance-action.json:/var/lib/grafana/dashboards/performance-action.json:ro - ./provisioning/performance-request.json:/var/lib/grafana/dashboards/performance-request.json:ro + - ./provisioning/activejob.json:/var/lib/grafana/dashboards/activejob.json.json:ro + - ./provisioning/requests.json:/var/lib/grafana/dashboards/requests.json:ro + - ./provisioning/slowlog-action.json:/var/lib/grafana/dashboards/slowlog-action.json.json:ro + - ./provisioning/slowlog-requests.json:/var/lib/grafana/dashboards/slowlog-requests.json:ro + - ./provisioning/slowlog-sql.json:/var/lib/grafana/dashboards/slowlog-sql.json:ro - grafanadata:/var/lib/grafana rails: image: hennevogel/influxdb-rails-sample diff --git a/sample-dashboard/provisioning/activejob.json b/sample-dashboard/provisioning/activejob.json new file mode 100644 index 0000000..b23864d --- /dev/null +++ b/sample-dashboard/provisioning/activejob.json @@ -0,0 +1,600 @@ +{ + "__inputs": [ + { + "name": "DS_INFLUXDB-RAILS", + "label": "InfluxDB-Rails", + "description": "", + "type": "datasource", + "pluginId": "influxdb", + "pluginName": "InfluxDB" + } + ], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "7.1.1" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph", + "version": "" + }, + { + "type": "datasource", + "id": "influxdb", + "name": "InfluxDB", + "version": "1.0.0" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": null, + "iteration": 1616428804223, + "links": [ + { + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "influxdb-rails" + ], + "type": "dashboards" + } + ], + "panels": [ + { + "aliasColors": {}, + "bars": false, + "cacheTimeout": null, + "dashLength": 10, + "dashes": false, + "datasource": "InfluxDB", + "decimals": 1, + "description": "Number of jobs per queue", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 3, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "hideTimeOverride": false, + "id": 2, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "hideEmpty": false, + "hideZero": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sideWidth": 250, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 0.5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_queue", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "queue" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "enqueue" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "by Queues", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "jobs", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "InfluxDB", + "description": "Number of jobs per class", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 7 + }, + "hiddenSeries": false, + "id": 4, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sideWidth": 250, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_job", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "job" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "perform_start" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "by Classes", + "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": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "InfluxDB", + "description": "Performance of jobs by class", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [], + "unit": "ms" + }, + "overrides": [] + }, + "fill": 0, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 15 + }, + "hiddenSeries": false, + "id": 5, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sideWidth": 250, + "total": false, + "values": false + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 2, + "points": true, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_job", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "job" + ], + "type": "tag" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [ + "99" + ], + "type": "percentile" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "perform" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Performance", + "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": 2, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": "5m", + "schemaVersion": 26, + "style": "dark", + "tags": [ + "influxdb-rails", + "Health", + "Performance", + "Ruby on Rails" + ], + "templating": { + "list": [ + { + "auto": true, + "auto_count": "50", + "auto_min": "", + "current": { + "selected": false, + "text": "auto", + "value": "$__auto_interval_per" + }, + "hide": 0, + "label": null, + "name": "per", + "options": [ + { + "selected": true, + "text": "auto", + "value": "$__auto_interval_per" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "10m", + "value": "10m" + }, + { + "selected": false, + "text": "30m", + "value": "30m" + }, + { + "selected": false, + "text": "1h", + "value": "1h" + }, + { + "selected": false, + "text": "6h", + "value": "6h" + }, + { + "selected": false, + "text": "12h", + "value": "12h" + }, + { + "selected": false, + "text": "1d", + "value": "1d" + }, + { + "selected": false, + "text": "7d", + "value": "7d" + }, + { + "selected": false, + "text": "14d", + "value": "14d" + }, + { + "selected": false, + "text": "30d", + "value": "30d" + } + ], + "query": "1m,10m,30m,1h,6h,12h,1d,7d,14d,30d", + "queryValue": "", + "refresh": 2, + "skipUrlSync": false, + "type": "interval" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "ActiveJob", + "uid": "influxdb-rails-activejob", + "version": 12 +} \ No newline at end of file diff --git a/sample-dashboard/provisioning/performance-action.json b/sample-dashboard/provisioning/performance-action.json index 6cd0646..8661a62 100644 --- a/sample-dashboard/provisioning/performance-action.json +++ b/sample-dashboard/provisioning/performance-action.json @@ -1,8 +1,8 @@ { "__inputs": [ { - "name": "DS_INFLUXDB", - "label": "InfluxDB", + "name": "DS_INFLUXDB-RAILS", + "label": "InfluxDB-Rails", "description": "", "type": "datasource", "pluginId": "influxdb", @@ -14,7 +14,7 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "6.2.4" + "version": "7.1.1" }, { "type": "panel", @@ -30,14 +30,14 @@ }, { "type": "panel", - "id": "singlestat", - "name": "Singlestat", + "id": "stat", + "name": "Stat", "version": "" }, { "type": "panel", - "id": "table", - "name": "Table", + "id": "table-old", + "name": "Table (old)", "version": "" } ], @@ -54,90 +54,81 @@ } ] }, - "description": "Ruby on Rails Request Performance Insights based on influxdb-rails", + "description": "Controller Action Performance Insights based on influxdb-rails", "editable": true, - "gnetId": null, + "gnetId": 11031, "graphTooltip": 0, "id": null, - "iteration": 1571756217977, - "links": [], + "iteration": 1616428619978, + "links": [ + { + "$$hashKey": "object:226", + "icon": "external link", + "keepTime": false, + "tags": [ + "influxdb-rails" + ], + "type": "dashboards" + } + ], "panels": [ { "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], "datasource": "InfluxDB", - "format": "ms", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "N/A", + "type": 1, + "value": "null" + } + ], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [] }, "gridPos": { - "h": 4, + "h": 3, "w": 5, "x": 0, "y": 0 }, - "id": 16, + "id": 22, "interval": null, "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "sum" + ], + "fields": "/^rails\\.count$/", + "values": false + }, + "textMode": "auto" }, - "tableColumn": "", + "pluginVersion": "7.1.1", "targets": [ { - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], + "groupBy": [], "measurement": "rails", "orderByTime": "ASC", "policy": "default", @@ -153,7 +144,7 @@ }, { "params": [], - "type": "mean" + "type": "count" } ] ], @@ -172,79 +163,66 @@ ] } ], - "thresholds": "", - "title": "Request", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" + "title": "Requests Served", + "type": "stat" }, { "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], "datasource": "InfluxDB", - "format": "ms", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "description": "", + "fieldConfig": { + "defaults": { + "custom": {}, + "decimals": 2, + "displayName": "Response Time", + "mappings": [], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#299c46", + "value": null + }, + { + "color": "yellow", + "value": 150 + }, + { + "color": "red", + "value": 300 + } + ] + }, + "unit": "ms" + }, + "overrides": [] }, "gridPos": { - "h": 4, - "w": 5, + "h": 3, + "w": 6, "x": 5, "y": 0 }, - "id": 14, + "id": 30, "interval": null, "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto" }, - "tableColumn": "", + "pluginVersion": "7.1.1", "targets": [ { "groupBy": [ @@ -261,6 +239,7 @@ "type": "fill" } ], + "hide": false, "measurement": "rails", "orderByTime": "ASC", "policy": "default", @@ -270,7 +249,7 @@ [ { "params": [ - "view" + "controller" ], "type": "field" }, @@ -282,92 +261,79 @@ ], "tags": [ { - "key": "method", - "operator": "=~", - "value": "/^$Action$/" - }, - { - "condition": "AND", "key": "hook", "operator": "=", "value": "process_action" + }, + { + "condition": "AND", + "key": "method", + "operator": "=~", + "value": "/^$Action$/" } ] } ], - "thresholds": "", - "title": "View per request", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" + "title": "Average Response", + "type": "stat" }, { "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], "datasource": "InfluxDB", - "format": "ms", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "description": "", + "fieldConfig": { + "defaults": { + "custom": {}, + "decimals": 2, + "displayName": "Response Time", + "mappings": [], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#299c46", + "value": null + }, + { + "color": "yellow", + "value": 150 + }, + { + "color": "red", + "value": 300 + } + ] + }, + "unit": "ms" + }, + "overrides": [] }, "gridPos": { - "h": 4, - "w": 5, - "x": 10, + "h": 3, + "w": 6, + "x": 11, "y": 0 }, - "id": 10, + "id": 31, "interval": null, "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto" }, - "tableColumn": "", + "pluginVersion": "7.1.1", "targets": [ { "groupBy": [ @@ -384,6 +350,7 @@ "type": "fill" } ], + "hide": false, "measurement": "rails", "orderByTime": "ASC", "policy": "default", @@ -393,7 +360,7 @@ [ { "params": [ - "db" + "view" ], "type": "field" }, @@ -405,206 +372,93 @@ ], "tags": [ { - "key": "method", - "operator": "=~", - "value": "/^$Action$/" - }, - { - "condition": "AND", "key": "hook", "operator": "=", "value": "process_action" + }, + { + "condition": "AND", + "key": "method", + "operator": "=~", + "value": "/^$Action$/" } ] } ], - "thresholds": "", - "title": "SQL per request", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" + "title": "Average View Rendering", + "type": "stat" }, { "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], "datasource": "InfluxDB", - "format": "short", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 5, - "x": 15, - "y": 0 - }, - "id": 22, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "value", - "targets": [ - { - "groupBy": [], - "measurement": "rails", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ + "fieldConfig": { + "defaults": { + "custom": {}, + "displayName": "Response Time", + "mappings": [], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ { - "params": [ - "controller" - ], - "type": "field" + "color": "#299c46", + "value": null }, { - "params": [], - "type": "count" + "color": "rgba(237, 129, 40, 0.89)", + "value": 50 + }, + { + "color": "#d44a3a", + "value": 100 } ] - ], - "tags": [ - { - "key": "method", - "operator": "=~", - "value": "/^$Action$/" - }, - { - "condition": "AND", - "key": "hook", - "operator": "=", - "value": "process_action" - } - ] - } - ], - "thresholds": "", - "title": "Total requests", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#e24d42", - "#e5ac0e", - "#629e51" - ], - "datasource": "InfluxDB", - "decimals": null, - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + }, + "unit": "ms" + }, + "overrides": [] }, "gridPos": { - "h": 4, - "w": 4, - "x": 20, + "h": 3, + "w": 7, + "x": 17, "y": 0 }, - "id": 24, + "id": 28, "interval": null, "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto" }, - "tableColumn": "", + "pluginVersion": "7.1.1", "targets": [ { - "groupBy": [], + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], "measurement": "rails", "orderByTime": "ASC", "policy": "default", @@ -614,80 +468,74 @@ [ { "params": [ - "cache_hits" + "db" ], "type": "field" }, { - "params": [ - " / \"count\" * 100" - ], - "type": "math" + "params": [], + "type": "mean" } ] ], "tags": [ { - "key": "location", - "operator": "=~", - "value": "/^$Action$/" + "key": "hook", + "operator": "=", + "value": "process_action" }, { "condition": "AND", - "key": "hook", - "operator": "=", - "value": "render_collection" + "key": "method", + "operator": "=~", + "value": "/^$Action$/" } ] } ], - "thresholds": "10,80", - "title": "Cache hits", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" + "title": "Average Database Response", + "type": "stat" }, { "aliasColors": {}, - "bars": false, + "bars": true, "dashLength": 10, "dashes": false, "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 13, "x": 0, - "y": 4 + "y": 3 }, + "hiddenSeries": false, "id": 20, "legend": { "avg": false, "current": false, "max": false, "min": false, - "show": false, + "show": true, "total": false, "values": false }, - "lines": true, - "linewidth": 1, + "lines": false, + "linewidth": 7, "links": [], "nullPointMode": "null", - "options": { - "dataLinks": [] - }, "percentage": false, - "pointradius": 5, - "points": false, + "pluginVersion": "7.1.1", + "pointradius": 3, + "points": true, "renderer": "flot", "seriesOverrides": [ { @@ -705,6 +553,7 @@ "steppedLine": false, "targets": [ { + "alias": "", "groupBy": [ { "params": [ @@ -714,7 +563,7 @@ }, { "params": [ - "0" + "null" ], "type": "fill" } @@ -734,103 +583,7 @@ }, { "params": [], - "type": "mean" - } - ] - ], - "tags": [ - { - "key": "method", - "operator": "=~", - "value": "/^$Action$/" - }, - { - "condition": "AND", - "key": "hook", - "operator": "=", - "value": "process_action" - } - ] - }, - { - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "0" - ], - "type": "fill" - } - ], - "measurement": "rails", - "orderByTime": "ASC", - "policy": "default", - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "controller" - ], - "type": "field" - }, - { - "params": [], - "type": "max" - } - ] - ], - "tags": [ - { - "key": "method", - "operator": "=~", - "value": "/^$Action$/" - }, - { - "condition": "AND", - "key": "hook", - "operator": "=", - "value": "process_action" - } - ] - }, - { - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "0" - ], - "type": "fill" - } - ], - "measurement": "rails", - "orderByTime": "ASC", - "policy": "default", - "refId": "C", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "controller" - ], - "type": "field" - }, - { - "params": [], - "type": "min" + "type": "sum" } ] ], @@ -872,7 +625,7 @@ "decimals": null, "format": "dtdurationms", "label": "", - "logBase": 2, + "logBase": 1, "max": null, "min": null, "show": true @@ -883,7 +636,7 @@ "logBase": 1, "max": null, "min": null, - "show": true + "show": false } ], "yaxis": { @@ -894,32 +647,39 @@ { "columns": [], "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fontSize": "100%", "gridPos": { "h": 8, "w": 11, "x": 13, - "y": 4 + "y": 3 }, "id": 26, "links": [], - "options": {}, "pageSize": null, "scroll": true, "showHeader": true, "sort": { - "col": 0, + "col": 3, "desc": true }, "styles": [ { "alias": "Time", + "align": "auto", "dateFormat": "YYYY-MM-DD HH:mm:ss", "pattern": "Time", "type": "date" }, { "alias": "Reqest", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -931,7 +691,7 @@ "link": true, "linkTargetBlank": true, "linkTooltip": "Show details of this request", - "linkUrl": "/d/$REQUEST_DASHBOARD_UID/ruby-on-rails-performance-per-request?orgId=1&var-request_id=${__cell}&from=${__cell_2}&to=${__cell_0}&var-method=${__cell_1}", + "linkUrl": "/d/influxdb-rails-request/ruby-on-rails-performance-per-request?orgId=1&var-request_id=${__cell}&from=${__cell_2}&to=${__cell_0}&var-method=${__cell_1}", "mappingType": 1, "pattern": "request_id", "thresholds": [], @@ -940,6 +700,7 @@ }, { "alias": "Response time", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -956,6 +717,7 @@ }, { "alias": "Time", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -972,6 +734,7 @@ }, { "alias": "", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -988,6 +751,7 @@ }, { "alias": "", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1060,21 +824,26 @@ ], "title": "Last requests", "transform": "table", - "type": "table" + "type": "table-old" }, { "columns": [], "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fontSize": "100%", "gridPos": { "h": 15, "w": 13, "x": 0, - "y": 12 + "y": 11 }, "id": 2, "links": [], - "options": {}, "pageSize": null, "scroll": true, "showHeader": true, @@ -1085,12 +854,14 @@ "styles": [ { "alias": "Time", + "align": "auto", "dateFormat": "YYYY-MM-DD HH:mm:ss", "pattern": "Time", "type": "hidden" }, { "alias": "Partial", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1108,6 +879,7 @@ }, { "alias": "Count", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1124,6 +896,7 @@ }, { "alias": "Mean", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1140,6 +913,7 @@ }, { "alias": "Median", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1156,6 +930,7 @@ }, { "alias": "Max", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1172,6 +947,7 @@ }, { "alias": "", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1260,60 +1036,53 @@ "condition": "AND", "key": "hook", "operator": "=", - "value": "render_partial" + "value": "render_template" } ] } ], "title": "Partials", "transform": "table", - "type": "table" + "type": "table-old" }, { "columns": [], "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fontSize": "100%", "gridPos": { "h": 15, "w": 11, "x": 13, - "y": 12 + "y": 11 }, "id": 4, "links": [], - "options": {}, "pageSize": null, "scroll": true, "showHeader": true, "sort": { - "col": 6, + "col": 5, "desc": true }, "styles": [ { + "$$hashKey": "object:171", "alias": "Time", + "align": "auto", "dateFormat": "YYYY-MM-DD HH:mm:ss", "pattern": "Time", "type": "hidden" }, { - "alias": "", - "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, - "mappingType": 1, - "pattern": "SQL", - "thresholds": [], - "type": "string", - "unit": "short" - }, - { + "$$hashKey": "object:173", "alias": "Count", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1329,7 +1098,9 @@ "unit": "short" }, { + "$$hashKey": "object:174", "alias": "Mean", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1345,7 +1116,9 @@ "unit": "ms" }, { + "$$hashKey": "object:175", "alias": "Median", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1361,7 +1134,9 @@ "unit": "ms" }, { + "$$hashKey": "object:176", "alias": "Name", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1373,11 +1148,20 @@ "mappingType": 1, "pattern": "name", "thresholds": [], - "type": "number", - "unit": "short" + "type": "string", + "unit": "short", + "valueMaps": [ + { + "$$hashKey": "object:299", + "text": "Raw", + "value": "" + } + ] }, { + "$$hashKey": "object:177", "alias": "Max", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -1391,20 +1175,6 @@ "thresholds": [], "type": "number", "unit": "ms" - }, - { - "alias": "", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 2, - "pattern": "/.*/", - "thresholds": [], - "type": "number", - "unit": "short" } ], "targets": [ @@ -1489,13 +1259,16 @@ ], "title": "SQL", "transform": "table", - "type": "table" + "type": "table-old" } ], "refresh": false, - "schemaVersion": 18, + "schemaVersion": 26, "style": "dark", - "tags": [], + "tags": [ + "Performance", + "Ruby on Rails" + ], "templating": { "list": [ { @@ -1519,34 +1292,15 @@ "tagsQuery": "", "type": "query", "useTags": false - }, - { - "current": { - "value": "H8S9fSVWz", - "text": "H8S9fSVWz" - }, - "hide": 2, - "label": null, - "name": "REQUEST_DASHBOARD_UID", - "options": [ - { - "value": "H8S9fSVWz", - "text": "H8S9fSVWz" - } - ], - "query": "H8S9fSVWz", - "skipUrlSync": false, - "type": "constant" } ] }, "time": { - "from": "now-2d", + "from": "now-1h", "to": "now" }, "timepicker": { "refresh_intervals": [ - "5s", "10s", "30s", "1m", @@ -1570,7 +1324,7 @@ ] }, "timezone": "", - "title": "Ruby On Rails Performance (per Action)", - "uid": "Gpp3B1Pik", - "version": 1 -} + "title": "Performance (per Action)", + "uid": "influxdb-rails-action", + "version": 10 +} \ No newline at end of file diff --git a/sample-dashboard/provisioning/performance-request.json b/sample-dashboard/provisioning/performance-request.json index a0c5286..813eec1 100644 --- a/sample-dashboard/provisioning/performance-request.json +++ b/sample-dashboard/provisioning/performance-request.json @@ -1,8 +1,8 @@ { "__inputs": [ { - "name": "DS_INFLUXDB", - "label": "InfluxDB", + "name": "DS_INFLUXDB-RAILS", + "label": "InfluxDB-Rails", "description": "", "type": "datasource", "pluginId": "influxdb", @@ -10,11 +10,17 @@ } ], "__requires": [ + { + "type": "panel", + "id": "bargauge", + "name": "Bar gauge", + "version": "" + }, { "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "6.2.4" + "version": "7.1.1" }, { "type": "datasource", @@ -24,21 +30,21 @@ }, { "type": "panel", - "id": "singlestat", - "name": "Singlestat", + "id": "stat", + "name": "Stat", "version": "" }, { "type": "panel", - "id": "table", - "name": "Table", + "id": "table-old", + "name": "Table (old)", "version": "" }, { "type": "panel", "id": "text", "name": "Text", - "version": "" + "version": "7.1.0" } ], "annotations": { @@ -54,16 +60,32 @@ } ] }, - "description": "Ruby on Rails Request Performance Insights based on influxdb-rails", + "description": "", "editable": true, "gnetId": 10429, "graphTooltip": 0, "id": null, - "iteration": 1571753874432, - "links": [], + "iteration": 1616428738654, + "links": [ + { + "$$hashKey": "object:392", + "icon": "external link", + "tags": [ + "influxdb-rails" + ], + "type": "dashboards" + } + ], "panels": [ { "content": "## Details for $method ($request_id)", + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "gridPos": { "h": 2, "w": 24, @@ -73,29 +95,51 @@ "id": 4, "links": [], "mode": "markdown", - "options": {}, + "options": { + "content": "## Details for $method ($request_id)", + "mode": "markdown" + }, + "pluginVersion": "7.1.0", "title": "", "type": "text" }, { "cacheTimeout": null, - "colorBackground": false, - "colorPrefix": false, - "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], "datasource": "InfluxDB", "description": "", - "format": "ms", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "N/A", + "type": 1, + "value": "null" + } + ], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#299c46", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 200 + }, + { + "color": "#d44a3a", + "value": 300 + } + ] + }, + "unit": "ms" + }, + "overrides": [] }, "gridPos": { "h": 3, @@ -106,39 +150,22 @@ "id": 2, "interval": null, "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "sum" + ], + "fields": "", + "values": false + }, + "textMode": "auto" }, - "tableColumn": "", + "pluginVersion": "7.1.1", "targets": [ { "groupBy": [], @@ -172,36 +199,45 @@ ] } ], - "thresholds": "200,300", "title": "Total Controller Action Runtime", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "total" + "type": "stat" }, { "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], "datasource": "InfluxDB", - "format": "ms", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "N/A", + "type": 1, + "value": "null" + } + ], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#299c46", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 200 + }, + { + "color": "#d44a3a", + "value": 300 + } + ] + }, + "unit": "ms" + }, + "overrides": [] }, "gridPos": { "h": 3, @@ -212,39 +248,22 @@ "id": 6, "interval": null, "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto" }, - "tableColumn": "", + "pluginVersion": "7.1.1", "targets": [ { "groupBy": [], @@ -278,36 +297,45 @@ ] } ], - "thresholds": "200,300", "title": "Total Database Query Runtime", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" + "type": "stat" }, { "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], "datasource": "InfluxDB", - "format": "ms", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "0", + "type": 1, + "value": "null" + } + ], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#299c46", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 200 + }, + { + "color": "#d44a3a", + "value": 300 + } + ] + }, + "unit": "ms" + }, + "overrides": [] }, "gridPos": { "h": 3, @@ -318,39 +346,22 @@ "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, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto" }, - "tableColumn": "", + "pluginVersion": "7.1.1", "targets": [ { "groupBy": [], @@ -384,49 +395,48 @@ ] } ], - "thresholds": "200,300", "title": "Total View Rendering Runtime", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" + "type": "stat" }, { "columns": [], "datasource": "InfluxDB", "description": "Database queries in this request.\n\n- Count: Number of occurrences\n- Mean: Average time spent in this query\n- Maximum: Slowest occurrence\n- Total: Total amount of time spent in this query", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fontSize": "100%", "gridPos": { - "h": 8, - "w": 24, + "h": 7, + "w": 12, "x": 0, "y": 5 }, "id": 12, "links": [], - "options": {}, "pageSize": null, "scroll": true, "showHeader": true, "sort": { - "col": 4, + "col": 5, "desc": true }, "styles": [ { + "$$hashKey": "object:554", "alias": "Time", + "align": "auto", "dateFormat": "YYYY-MM-DD HH:mm:ss", "pattern": "Time", "type": "hidden" }, { + "$$hashKey": "object:555", "alias": "Count", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -442,7 +452,9 @@ "unit": "short" }, { + "$$hashKey": "object:556", "alias": "Query", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -453,12 +465,23 @@ "decimals": 2, "mappingType": 1, "pattern": "name", + "preserveFormat": false, + "sanitize": false, "thresholds": [], - "type": "number", - "unit": "short" + "type": "string", + "unit": "short", + "valueMaps": [ + { + "$$hashKey": "object:823", + "text": "Unkown", + "value": "" + } + ] }, { + "$$hashKey": "object:557", "alias": "Mean", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -474,7 +497,9 @@ "unit": "ms" }, { + "$$hashKey": "object:558", "alias": "Maximum", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -490,7 +515,9 @@ "unit": "ms" }, { + "$$hashKey": "object:559", "alias": "Total", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -506,7 +533,9 @@ "unit": "ms" }, { + "$$hashKey": "object:560", "alias": "", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -602,22 +631,127 @@ ], "title": "Database Queries", "transform": "table", - "type": "table" + "type": "table-old" + }, + { + "cacheTimeout": null, + "datasource": "InfluxDB", + "description": "", + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 100 + }, + { + "color": "red", + "value": 200 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 5 + }, + "id": 17, + "interval": null, + "links": [], + "maxDataPoints": 3, + "options": { + "displayMode": "lcd", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": true + }, + "showUnfilled": true + }, + "pluginVersion": "7.1.1", + "targets": [ + { + "alias": "$tag_class_name", + "groupBy": [ + { + "params": [ + "class_name" + ], + "type": "tag" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "record_count" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [ + { + "key": "request_id", + "operator": "=~", + "value": "/^$request_id$/" + }, + { + "condition": "AND", + "key": "hook", + "operator": "=", + "value": "instantiation" + } + ] + } + ], + "title": "Record Instantiation", + "type": "bargauge" }, { "columns": [], "datasource": "InfluxDB", "description": "Views rendered in this request.\n\n- Count: Number of occurrences\n- Mean: Average time spent in this query\n- Maximum: Slowest occurrence", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fontSize": "100%", "gridPos": { "h": 9, "w": 12, "x": 0, - "y": 13 + "y": 12 }, "id": 10, "links": [], - "options": {}, "pageSize": null, "scroll": true, "showHeader": true, @@ -628,12 +762,14 @@ "styles": [ { "alias": "Time", + "align": "auto", "dateFormat": "YYYY-MM-DD HH:mm:ss", "pattern": "Time", "type": "hidden" }, { "alias": "Count", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -650,6 +786,7 @@ }, { "alias": "Mean", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -666,6 +803,7 @@ }, { "alias": "Maximum", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -682,6 +820,7 @@ }, { "alias": "File", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -765,38 +904,45 @@ ], "title": "Views Rendered", "transform": "table", - "type": "table" + "type": "table-old" }, { "columns": [], "datasource": "InfluxDB", "description": "Partials rendered in this request.\n\n- Count: Number of occurrences\n- Mean: Average time spent in this partial\n- Maximum: Slowest occurrence\n- Total: Total time spent in this partial", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fontSize": "100%", "gridPos": { "h": 9, "w": 12, "x": 12, - "y": 13 + "y": 12 }, "id": 16, "links": [], - "options": {}, "pageSize": null, "scroll": true, "showHeader": true, "sort": { - "col": 4, + "col": 5, "desc": true }, "styles": [ { "alias": "Time", + "align": "auto", "dateFormat": "YYYY-MM-DD HH:mm:ss", "pattern": "Time", "type": "hidden" }, { "alias": "Count", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -813,6 +959,7 @@ }, { "alias": "File", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -829,6 +976,7 @@ }, { "alias": "Mean", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -845,6 +993,7 @@ }, { "alias": "Maximum", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -861,6 +1010,7 @@ }, { "alias": "Total", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -877,6 +1027,7 @@ }, { "alias": "", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -972,16 +1123,15 @@ ], "title": "Partials Rendered", "transform": "table", - "type": "table" + "type": "table-old" } ], "refresh": false, - "schemaVersion": 18, + "schemaVersion": 26, "style": "dark", "tags": [ - "performance", - "ruby on rails", - "influxdb" + "Performance", + "Ruby on Rails" ], "templating": { "list": [ @@ -1000,7 +1150,7 @@ "value": "" } ], - "query": "", + "query": "ba3c5e76-d15a-40fb-bb0c-a6dc0220fa8c", "skipUrlSync": false, "type": "textbox" }, @@ -1019,7 +1169,7 @@ "value": "" } ], - "query": "", + "query": "Webui::PackageController#meta", "skipUrlSync": false, "type": "textbox" } @@ -1047,7 +1197,7 @@ ] }, "timezone": "", - "title": "Ruby On Rails Performance (per Request)", - "uid": "H8S9fSVWz", - "version": 1 -} + "title": "Performance (per Request)", + "uid": "influxdb-rails-request", + "version": 9 +} \ No newline at end of file diff --git a/sample-dashboard/provisioning/performance.json b/sample-dashboard/provisioning/performance.json index 1c8f14e..bd498a0 100644 --- a/sample-dashboard/provisioning/performance.json +++ b/sample-dashboard/provisioning/performance.json @@ -1,8 +1,8 @@ { "__inputs": [ { - "name": "DS_INFLUXDB", - "label": "InfluxDB", + "name": "DS_INFLUXDB-RAILS", + "label": "InfluxDB-Rails", "description": "", "type": "datasource", "pluginId": "influxdb", @@ -14,7 +14,7 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "6.2.4" + "version": "7.1.1" }, { "type": "panel", @@ -30,14 +30,8 @@ }, { "type": "panel", - "id": "singlestat", - "name": "Singlestat", - "version": "" - }, - { - "type": "panel", - "id": "table", - "name": "Table", + "id": "stat", + "name": "Stat", "version": "" } ], @@ -54,83 +48,81 @@ } ] }, - "description": "Ruby on Rails Performance Insights based on influxdb and influxdb-rails", + "description": "Insights based on influxdb-rails", "editable": true, "gnetId": 10428, "graphTooltip": 0, "id": null, - "iteration": 1571758610473, - "links": [], + "iteration": 1616428241231, + "links": [ + { + "$$hashKey": "object:269", + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "influxdb-rails" + ], + "targetBlank": false, + "type": "dashboards" + } + ], "panels": [ { "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], "datasource": "InfluxDB", - "description": "", - "format": "ms", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "fieldConfig": { + "defaults": { + "custom": {}, + "displayName": "Requests", + "mappings": [], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [] }, - "id": 10, + "gridPos": { + "h": 3, + "w": 4, + "x": 0, + "y": 0 + }, + "id": 16, "interval": null, "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "sum" + ], + "fields": "", + "values": false + }, + "textMode": "auto" }, - "tableColumn": "", + "pluginVersion": "7.1.1", "targets": [ { "groupBy": [ { "params": [ - "$__interval" + "$per" ], "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" } ], "hide": false, @@ -143,13 +135,13 @@ [ { "params": [ - "controller" + "request_id" ], "type": "field" }, { "params": [], - "type": "mean" + "type": "count" } ] ], @@ -162,93 +154,57 @@ ] } ], - "thresholds": "200,300", - "title": "Average Controller Action Time", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" + "title": "Requests served", + "type": "stat" }, { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], "datasource": "InfluxDB", - "format": "ms", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] }, "gridPos": { "h": 3, - "w": 6, - "x": 6, + "w": 4, + "x": 4, "y": 0 }, - "id": 12, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 + "id": 26, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "sum" + ], + "fields": "", + "values": false }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true + "textMode": "auto" }, - "tableColumn": "", + "pluginVersion": "7.1.1", "targets": [ { "groupBy": [ { "params": [ - "$__interval" + "$per" ], "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" } ], "measurement": "rails", @@ -260,13 +216,13 @@ [ { "params": [ - "db" + "value" ], "type": "field" }, { "params": [], - "type": "mean" + "type": "count" } ] ], @@ -274,90 +230,62 @@ { "key": "hook", "operator": "=", - "value": "process_action" + "value": "perform" } ] } ], - "thresholds": "50,100", - "title": "Average Database Query Time", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" + "timeFrom": null, + "timeShift": null, + "title": "Jobs Executed", + "type": "stat" }, { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], "datasource": "InfluxDB", - "format": "ms", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] }, "gridPos": { "h": 3, - "w": 6, - "x": 12, + "w": 4, + "x": 8, "y": 0 }, - "id": 14, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 + "id": 27, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "sum" + ], + "fields": "", + "values": false }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true + "textMode": "auto" }, - "tableColumn": "", + "pluginVersion": "7.1.1", "targets": [ { "groupBy": [ { "params": [ - "$interval" + "$per" ], "type": "time" } @@ -371,13 +299,13 @@ [ { "params": [ - "view" + "value" ], "type": "field" }, { "params": [], - "type": "mean" + "type": "count" } ] ], @@ -385,88 +313,88 @@ { "key": "hook", "operator": "=", - "value": "process_action" + "value": "deliver" } ] } ], - "thresholds": "50,100", - "title": "Average View Rendering Time", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" + "timeFrom": null, + "timeShift": null, + "title": "Mails Sent", + "type": "stat" }, { "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], "datasource": "InfluxDB", - "decimals": null, - "format": "short", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "description": "", + "fieldConfig": { + "defaults": { + "custom": {}, + "displayName": "Response Time", + "mappings": [], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#299c46", + "value": null + }, + { + "color": "yellow", + "value": 150 + }, + { + "color": "red", + "value": 300 + } + ] + }, + "unit": "ms" + }, + "overrides": [] }, "gridPos": { "h": 3, - "w": 6, - "x": 18, + "w": 4, + "x": 12, "y": 0 }, - "id": 16, + "id": 10, "interval": null, "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto" }, - "tableColumn": "", + "pluginVersion": "7.1.1", "targets": [ { - "groupBy": [], + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], "hide": false, "measurement": "rails", "orderByTime": "ASC", @@ -477,13 +405,13 @@ [ { "params": [ - "request_id" + "controller" ], "type": "field" }, { "params": [], - "type": "count" + "type": "mean" } ] ], @@ -496,84 +424,76 @@ ] } ], - "thresholds": "", - "title": "Total Number of Requests", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" + "title": "Average Response", + "type": "stat" }, { - "aliasColors": { - "rails.controller.mean": "#1f78c1" - }, - "bars": false, - "dashLength": 10, - "dashes": false, + "cacheTimeout": null, "datasource": "InfluxDB", - "description": "Time spent in controller actions", - "fill": 1, - "gridPos": { - "h": 9, - "w": 8, - "x": 0, - "y": 3 + "fieldConfig": { + "defaults": { + "custom": {}, + "displayName": "Response Time", + "mappings": [], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#299c46", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 50 + }, + { + "color": "#d44a3a", + "value": 100 + } + ] + }, + "unit": "ms" + }, + "overrides": [] }, - "id": 6, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": false, - "total": false, - "values": false + "gridPos": { + "h": 3, + "w": 4, + "x": 16, + "y": 0 }, - "lines": true, - "linewidth": 1, + "id": 12, + "interval": null, "links": [], - "nullPointMode": "null", - "options": {}, - "paceLength": 10, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Maximum", - "fillBelowTo": "Minimum", - "lines": false + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false }, - { - "alias": "Minimum", - "lines": false - } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "textMode": "auto" + }, + "pluginVersion": "7.1.1", "targets": [ { - "alias": "Maximum", "groupBy": [ { "params": [ - "$__interval" + "$per" ], "type": "time" }, { "params": [ - "0" + "null" ], "type": "fill" } @@ -581,19 +501,19 @@ "measurement": "rails", "orderByTime": "ASC", "policy": "default", - "refId": "C", + "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ - "controller" + "db" ], "type": "field" }, { "params": [], - "type": "max" + "type": "mean" } ] ], @@ -604,62 +524,78 @@ "value": "process_action" } ] + } + ], + "title": "Average Database Response", + "type": "stat" + }, + { + "cacheTimeout": null, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {}, + "displayName": "Response Time", + "mappings": [], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#299c46", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 1500 + }, + { + "color": "#d44a3a", + "value": 3000 + } + ] + }, + "unit": "ms" }, - { - "alias": "Mean", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "0" - ], - "type": "fill" - } - ], - "measurement": "rails", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "controller" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 20, + "y": 0 + }, + "id": 28, + "interval": null, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" ], - "tags": [ - { - "key": "hook", - "operator": "=", - "value": "process_action" - } - ] + "fields": "", + "values": false }, + "textMode": "auto" + }, + "pluginVersion": "7.1.1", + "targets": [ { - "alias": "Minimum", "groupBy": [ { "params": [ - "$__interval" + "$per" ], "type": "time" }, { "params": [ - "0" + "null" ], "type": "fill" } @@ -667,19 +603,19 @@ "measurement": "rails", "orderByTime": "ASC", "policy": "default", - "refId": "B", + "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ - "controller" + "value" ], "type": "field" }, { "params": [], - "type": "min" + "type": "mean" } ] ], @@ -687,113 +623,75 @@ { "key": "hook", "operator": "=", - "value": "process_action" + "value": "perform" } ] } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Controller Action Runtime", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "dtdurationms", - "label": null, - "logBase": 2, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "title": "Average Job Execution", + "type": "stat" }, { - "aliasColors": {}, - "bars": false, + "aliasColors": { + "Error": "dark-red", + "Success": "semi-dark-green" + }, + "bars": true, "dashLength": 10, "dashes": false, "datasource": "InfluxDB", - "description": "Time spent in executing database queries", + "description": "Requests Served", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 1, + "fillGradient": 0, "gridPos": { - "h": 9, - "w": 8, - "x": 8, + "h": 7, + "w": 12, + "x": 0, "y": 3 }, - "id": 2, + "hiddenSeries": false, + "id": 18, "legend": { "avg": false, "current": false, "max": false, "min": false, - "show": false, + "show": true, "total": false, "values": false }, - "lines": true, + "lines": false, "linewidth": 1, "links": [], "nullPointMode": "null", - "options": {}, - "paceLength": 10, "percentage": false, - "pointradius": 5, + "pluginVersion": "7.1.1", + "pointradius": 2, "points": false, "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Maximum", - "fillBelowTo": "Minimum", - "lines": false - }, - { - "alias": "Minimum", - "lines": false - } - ], + "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { - "alias": "Maximum", + "alias": "Success", "groupBy": [ { "params": [ - "$__interval" + "$per" ], "type": "time" }, { "params": [ - "0" + "previous" ], "type": "fill" } @@ -801,19 +699,19 @@ "measurement": "rails", "orderByTime": "ASC", "policy": "default", - "refId": "B", + "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ - "db" + "controller" ], "type": "field" }, { "params": [], - "type": "max" + "type": "count" } ] ], @@ -822,64 +720,27 @@ "key": "hook", "operator": "=", "value": "process_action" - } - ] - }, - { - "alias": "Mean", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" }, { - "params": [ - "0" - ], - "type": "fill" - } - ], - "measurement": "rails", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "db" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [ - { - "key": "hook", + "condition": "AND", + "key": "status", "operator": "=", - "value": "process_action" + "value": "200" } ] }, { - "alias": "Minimum", + "alias": "Error", "groupBy": [ { "params": [ - "$__interval" + "$per" ], "type": "time" }, { "params": [ - "0" + "previous" ], "type": "fill" } @@ -887,19 +748,19 @@ "measurement": "rails", "orderByTime": "ASC", "policy": "default", - "refId": "C", + "refId": "B", "resultFormat": "time_series", "select": [ [ { "params": [ - "db" + "controller" ], "type": "field" }, { "params": [], - "type": "min" + "type": "count" } ] ], @@ -908,6 +769,12 @@ "key": "hook", "operator": "=", "value": "process_action" + }, + { + "condition": "AND", + "key": "status", + "operator": "!=", + "value": "200" } ] } @@ -916,7 +783,7 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "Database Query Runtime", + "title": "Requests per $per", "tooltip": { "shared": true, "sort": 0, @@ -932,14 +799,16 @@ }, "yaxes": [ { - "format": "dtdurationms", + "$$hashKey": "object:477", + "format": "short", "label": null, - "logBase": 2, + "logBase": 1, "max": null, "min": null, "show": true }, { + "$$hashKey": "object:478", "format": "short", "label": null, "logBase": 1, @@ -955,27 +824,37 @@ }, { "aliasColors": { - "rails.view.mean": "#eab839" + "rails.controller.mean": "#1f78c1" }, "bars": false, "dashLength": 10, "dashes": false, "datasource": "InfluxDB", - "description": "Time spent in rendering views", - "fill": 0, + "description": "Time spent in controller actions", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, "gridPos": { - "h": 9, - "w": 8, - "x": 16, + "h": 7, + "w": 12, + "x": 12, "y": 3 }, - "id": 4, + "hiddenSeries": false, + "id": 6, "legend": { + "alignAsTable": false, "avg": false, "current": false, "max": false, "min": false, - "show": false, + "rightSide": false, + "show": true, "total": false, "values": false }, @@ -983,9 +862,9 @@ "linewidth": 1, "links": [], "nullPointMode": "null", - "options": {}, "paceLength": 10, "percentage": false, + "pluginVersion": "7.1.1", "pointradius": 5, "points": false, "renderer": "flot", @@ -1005,17 +884,17 @@ "steppedLine": false, "targets": [ { - "alias": "Maximum", + "alias": "P99", "groupBy": [ { "params": [ - "$__interval" + "$per" ], "type": "time" }, { "params": [ - "0" + "null" ], "type": "fill" } @@ -1023,19 +902,21 @@ "measurement": "rails", "orderByTime": "ASC", "policy": "default", - "refId": "C", + "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ - "view" + "controller" ], "type": "field" }, { - "params": [], - "type": "max" + "params": [ + "99" + ], + "type": "percentile" } ] ], @@ -1048,17 +929,17 @@ ] }, { - "alias": "Mean", + "alias": "P95", "groupBy": [ { "params": [ - "$__interval" + "$per" ], "type": "time" }, { "params": [ - "0" + "null" ], "type": "fill" } @@ -1066,19 +947,64 @@ "measurement": "rails", "orderByTime": "ASC", "policy": "default", - "refId": "A", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "controller" + ], + "type": "field" + }, + { + "params": [ + "95" + ], + "type": "percentile" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "process_action" + } + ] + }, + { + "alias": "P50", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "C", "resultFormat": "time_series", "select": [ [ { "params": [ - "view" + "controller" ], "type": "field" }, { "params": [], - "type": "mean" + "type": "median" } ] ], @@ -1091,17 +1017,17 @@ ] }, { - "alias": "Minimum", + "alias": "Mean", "groupBy": [ { "params": [ - "$__interval" + "$per" ], "type": "time" }, { "params": [ - "0" + "null" ], "type": "fill" } @@ -1109,19 +1035,19 @@ "measurement": "rails", "orderByTime": "ASC", "policy": "default", - "refId": "B", + "refId": "D", "resultFormat": "time_series", "select": [ [ { "params": [ - "view" + "controller" ], "type": "field" }, { "params": [], - "type": "min" + "type": "mean" } ] ], @@ -1138,7 +1064,7 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "View Rendering Runtime", + "title": "Controller Action Performance", "tooltip": { "shared": true, "sort": 0, @@ -1154,7 +1080,8 @@ }, "yaxes": [ { - "format": "dtdurationms", + "$$hashKey": "object:2305", + "format": "ms", "label": null, "logBase": 2, "max": null, @@ -1162,12 +1089,13 @@ "show": true }, { + "$$hashKey": "object:2306", "format": "short", "label": null, "logBase": 1, "max": null, "min": null, - "show": true + "show": false } ], "yaxis": { @@ -1176,195 +1104,87 @@ } }, { - "columns": [], + "aliasColors": { + "Error": "dark-red", + "Success": "semi-dark-green" + }, + "bars": true, + "dashLength": 10, + "dashes": false, "datasource": "InfluxDB", - "description": "Data for the selected range by controller action.\n\n- Count: Number of occurrences\n- Mean: Average time spent\n- Median: Median time spent\n- Maximum: Slowest occurrence\n\n[Average vs. Median?](https://www.differencebetween.com/difference-between-mean-and-median/)", - "fontSize": "100%", + "description": "Records Instantiated", + "fieldConfig": { + "defaults": { + "custom": {}, + "displayName": "Records Instantiated" + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, "gridPos": { - "h": 13, + "h": 6, "w": 12, "x": 0, - "y": 12 + "y": 10 }, - "id": 18, - "links": [], - "options": {}, - "pageSize": null, - "scroll": true, - "showHeader": true, - "sort": { - "col": 5, - "desc": true + "hiddenSeries": false, + "id": 24, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false }, - "styles": [ - { - "alias": "Time", - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "pattern": "Time", - "type": "hidden" - }, - { - "alias": "Mean", - "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, - "mappingType": 1, - "pattern": "mean", - "thresholds": [], - "type": "number", - "unit": "ms" - }, - { - "alias": "Count", - "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": 0, - "mappingType": 1, - "pattern": "count", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Median", - "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, - "mappingType": 1, - "pattern": "median", - "thresholds": [], - "type": "number", - "unit": "ms" - }, - { - "alias": "Controller Action", - "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/$ACTION_DASHBOARD_UID/ruby-on-rails-performance-per-action?var-Action=${__cell}&from=$__from&to=$__to", - "mappingType": 1, - "pattern": "method", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Maximum", - "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, - "mappingType": 1, - "pattern": "max", - "thresholds": [], - "type": "number", - "unit": "ms" - }, - { - "alias": "", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 2, - "pattern": "/.*/", - "thresholds": [], - "type": "number", - "unit": "short" - } - ], + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, "targets": [ { + "alias": "", "groupBy": [ { "params": [ - "method" + "$per" + ], + "type": "time" + }, + { + "params": [ + "previous" ], - "type": "tag" + "type": "fill" } ], - "limit": "", "measurement": "rails", "orderByTime": "ASC", "policy": "default", "refId": "A", - "resultFormat": "table", + "resultFormat": "time_series", "select": [ [ { "params": [ - "controller" - ], - "type": "field" - }, - { - "params": [], - "type": "count" - } - ], - [ - { - "params": [ - "controller" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ], - [ - { - "params": [ - "controller" - ], - "type": "field" - }, - { - "params": [], - "type": "median" - } - ], - [ - { - "params": [ - "controller" + "record_count" ], "type": "field" }, { "params": [], - "type": "max" + "type": "sum" } ] ], @@ -1372,226 +1192,190 @@ { "key": "hook", "operator": "=", - "value": "process_action" + "value": "instantiation" } ] } ], - "title": "By Controller Action", - "transform": "table", - "type": "table" + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Instantiation per $per", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:477", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:478", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } }, { - "columns": [], + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, "datasource": "InfluxDB", - "description": "Data for the selected range by database query.\n\n- Count: Number of occurrences\n- Mean: Average time spent\n- Median: Median time spent\n- Maximum: Slowest occurrence\n\n[Average vs. Median?](https://www.differencebetween.com/difference-between-mean-and-median/)", - "fontSize": "100%", + "description": "Time spent in executing database queries", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, "gridPos": { - "h": 13, + "h": 6, "w": 12, "x": 12, - "y": 12 + "y": 10 }, - "id": 29, - "links": [], - "options": {}, - "pageSize": null, - "scroll": true, - "showHeader": true, - "sort": { - "col": 6, - "desc": true + "hiddenSeries": false, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false }, - "styles": [ - { - "alias": "Time", - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "pattern": "Time", - "type": "hidden" - }, - { - "alias": "Count", - "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": null, - "mappingType": 1, - "pattern": "count", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Mean", - "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, - "mappingType": 1, - "pattern": "mean", - "thresholds": [], - "type": "number", - "unit": "ms" - }, - { - "alias": "Median", - "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, - "mappingType": 1, - "pattern": "median", - "thresholds": [], - "type": "number", - "unit": "ms" - }, - { - "alias": "Controller Action", - "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/$ACTION_DASHBOARD_UID/ruby-on-rails-performance-per-action?var-Action=${__cell}&from=$__from&to=$__to", - "mappingType": 1, - "pattern": "location", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Name of the operation", - "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, - "mappingType": 1, - "pattern": "name", - "thresholds": [], - "type": "number", - "unit": "short" - }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ { "alias": "Maximum", - "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, - "mappingType": 1, - "pattern": "max", - "thresholds": [], - "type": "number", - "unit": "ms" + "fillBelowTo": "Minimum", + "lines": false }, { - "alias": "", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 2, - "pattern": "/.*/", - "thresholds": [], - "type": "number", - "unit": "short" + "alias": "Minimum", + "lines": false } ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, "targets": [ { + "alias": "P99", "groupBy": [ { "params": [ - "name" + "$per" ], - "type": "tag" + "type": "time" }, { "params": [ - "location" + "null" ], - "type": "tag" + "type": "fill" } ], "measurement": "rails", "orderByTime": "ASC", "policy": "default", "refId": "A", - "resultFormat": "table", + "resultFormat": "time_series", "select": [ [ { "params": [ - "value" + "db" ], "type": "field" }, - { - "params": [], - "type": "count" - } - ], - [ { "params": [ - "value" + "99" ], - "type": "field" - }, - { - "params": [], - "type": "mean" + "type": "percentile" } - ], + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "process_action" + } + ] + }, + { + "alias": "P95", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ [ { "params": [ - "value" + "db" ], "type": "field" }, - { - "params": [], - "type": "median" - } - ], - [ { "params": [ - "value" + "95" ], - "type": "field" - }, - { - "params": [], - "type": "max" + "type": "percentile" } ] ], @@ -1599,137 +1383,415 @@ { "key": "hook", "operator": "=", - "value": "sql" + "value": "process_action" } ] - } - ], - "title": "By Database Query", - "transform": "table", - "type": "table" - }, + }, + { + "alias": "P50", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "C", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "db" + ], + "type": "field" + }, + { + "params": [], + "type": "median" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "process_action" + } + ] + }, + { + "alias": "Mean", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "D", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "db" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "process_action" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Database Query Performance", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:2533", + "format": "dtdurationms", + "label": null, + "logBase": 2, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:2534", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, { - "columns": [], + "aliasColors": { + "Failed": "red", + "Jobs": "green" + }, + "bars": true, + "dashLength": 10, + "dashes": false, "datasource": "InfluxDB", - "description": "Data for the selected range by view rendering.\n\n- Count: Number of occurrences\n- Mean: Average time spent\n- Median: Median time spent\n- Maximum: Slowest occurrence\n\n[Average vs. Median?](https://www.differencebetween.com/difference-between-mean-and-median/)", - "fontSize": "100%", + "description": "Jobs Performed", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, "gridPos": { - "h": 13, + "h": 6, "w": 12, "x": 0, - "y": 25 + "y": 16 }, - "id": 27, - "links": [], - "options": {}, - "pageSize": null, - "scroll": true, - "showHeader": true, - "sort": { - "col": 5, - "desc": true + "hiddenSeries": false, + "id": 20, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false }, - "styles": [ - { - "alias": "Time", - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "pattern": "Time", - "type": "hidden" - }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ { - "alias": "Count", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" + "alias": "Success", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "count", - "thresholds": [], - "type": "number", - "unit": "short" + "hide": false, + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "perform" + }, + { + "condition": "AND", + "key": "state", + "operator": "=", + "value": "succeeded" + } + ] }, { - "alias": "Mean", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" + "alias": "Failed", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "mappingType": 1, - "pattern": "mean", - "thresholds": [], - "type": "number", - "unit": "ms" + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "perform" + }, + { + "condition": "AND", + "key": "state", + "operator": "=", + "value": "failed" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Jobs per $per", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:737", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true }, { - "alias": "Median", - "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, - "mappingType": 1, - "pattern": "median", - "thresholds": [], - "type": "number", - "unit": "ms" + "$$hashKey": "object:738", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": { + "rails.view.mean": "#eab839" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "InfluxDB", + "description": "Time spent in executing jobs", + "fieldConfig": { + "defaults": { + "custom": {} }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 16 + }, + "hiddenSeries": false, + "id": 23, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ { "alias": "Maximum", - "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, - "mappingType": 1, - "pattern": "max", - "thresholds": [], - "type": "number", - "unit": "ms" + "fillBelowTo": "Minimum", + "lines": false }, { - "alias": "View", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 2, - "pattern": "/.*/", - "thresholds": [], - "type": "number", - "unit": "short" + "alias": "Minimum", + "lines": false } ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, "targets": [ { + "alias": "P99", "groupBy": [ { "params": [ - "filename" + "$per" + ], + "type": "time" + }, + { + "params": [ + "null" ], - "type": "tag" + "type": "fill" } ], "measurement": "rails", "orderByTime": "ASC", "policy": "default", "refId": "A", - "resultFormat": "table", + "resultFormat": "time_series", "select": [ [ { @@ -1739,10 +1801,43 @@ "type": "field" }, { - "params": [], - "type": "count" + "params": [ + "99" + ], + "type": "percentile" } - ], + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "perform" + } + ] + }, + { + "alias": "P95", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ [ { "params": [ @@ -1751,10 +1846,45 @@ "type": "field" }, { - "params": [], - "type": "mean" + "params": [ + "95" + ], + "type": "percentile" } - ], + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "perform" + } + ] + }, + { + "alias": "P50", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT percentile(\"view\", 50) FROM \"rails\" WHERE (\"hook\" = 'process_action') AND $timeFilter GROUP BY time(1m) fill(null)", + "rawQuery": false, + "refId": "C", + "resultFormat": "time_series", + "select": [ [ { "params": [ @@ -1766,7 +1896,38 @@ "params": [], "type": "median" } - ], + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "perform" + } + ] + }, + { + "alias": "Mean", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "D", + "resultFormat": "time_series", + "select": [ [ { "params": [ @@ -1776,7 +1937,7 @@ }, { "params": [], - "type": "max" + "type": "mean" } ] ], @@ -1784,158 +1945,126 @@ { "key": "hook", "operator": "=", - "value": "render_template" + "value": "perform" } ] } ], - "title": "By View Rendering", - "transform": "table", - "type": "table" - }, - { - "columns": [], - "datasource": "InfluxDB", - "description": "Data for the selected range by request ID.\n\n- Maximum: Slowest occurrence", - "fontSize": "100%", - "gridPos": { - "h": 13, - "w": 12, - "x": 12, - "y": 25 + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "ActiveJob Performance", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" }, - "id": 33, - "links": [], - "options": {}, - "pageSize": null, - "scroll": true, - "showHeader": true, - "sort": { - "col": 4, - "desc": true + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] }, - "styles": [ - { - "alias": "Finished", - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "pattern": "Time", - "type": "hidden" - }, - { - "alias": "Started", - "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" - }, - { - "alias": "Maximum", - "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, - "mappingType": 1, - "pattern": "max", - "thresholds": [], - "type": "number", - "unit": "ms" - }, + "yaxes": [ { - "alias": "Request ID", - "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": false, - "linkTooltip": "View data per this Request", - "linkUrl": "/d/$REQUEST_DASHBOARD_UID/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" + "$$hashKey": "object:3057", + "format": "ms", + "label": null, + "logBase": 2, + "max": null, + "min": null, + "show": true }, { - "alias": "Controller Action", - "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/$ACTION_DASHBOARD_UID/ruby-on-rails-performance-per-action?var-Action=${__cell}&from=$__from&to=$__to", - "mappingType": 1, - "pattern": "method", - "thresholds": [], - "type": "number", - "unit": "short" + "$$hashKey": "object:3058", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false } ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "InfluxDB", + "description": "Emails Sent", + "fieldConfig": { + "defaults": { + "custom": {}, + "displayName": "Emails" + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 22 + }, + "hiddenSeries": false, + "id": 22, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": false, + "linewidth": 2, + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, "targets": [ { + "alias": "", "groupBy": [ { "params": [ - "method" + "$per" ], - "type": "tag" + "type": "time" } ], - "limit": "20", "measurement": "rails", "orderByTime": "ASC", "policy": "default", "refId": "A", - "resultFormat": "table", + "resultFormat": "time_series", "select": [ [ { "params": [ - "started" - ], - "type": "field" - } - ], - [ - { - "params": [ - "request_id" - ], - "type": "field" - } - ], - [ - { - "params": [ - "controller" + "value" ], "type": "field" }, { "params": [], - "type": "max" + "type": "count" } ] ], @@ -1943,65 +2072,145 @@ { "key": "hook", "operator": "=", - "value": "process_action" + "value": "deliver" } ] } ], - "title": "By Request ID", - "transform": "table", - "type": "table" + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Mails per $per", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:282", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:283", + "decimals": 0, + "format": "Misc", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } } ], "refresh": "5m", - "schemaVersion": 18, + "schemaVersion": 26, "style": "dark", "tags": [ - "performance", - "ruby on rails", - "influxdb" + "Performance", + "Ruby on Rails", + "influxdb-rails" ], "templating": { "list": [ { - "allValue": null, + "auto": true, + "auto_count": "50", + "auto_min": "", "current": { - "text": "H8S9fSVWz", - "value": "H8S9fSVWz" + "selected": false, + "text": "auto", + "value": "$__auto_interval_per" }, - "hide": 2, - "includeAll": false, + "hide": 0, "label": null, - "multi": false, - "name": "REQUEST_DASHBOARD_UID", + "name": "per", "options": [ { "selected": true, - "text": "H8S9fSVWz", - "value": "H8S9fSVWz" - } - ], - "query": "H8S9fSVWz", - "skipUrlSync": false, - "type": "custom" - }, - { - "current": { - "value": "Gpp3B1Pik", - "text": "Gpp3B1Pik" - }, - "hide": 2, - "label": null, - "name": "ACTION_DASHBOARD_UID", - "options": [ + "text": "auto", + "value": "$__auto_interval_per" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "5m", + "value": "5m" + }, + { + "selected": false, + "text": "10m", + "value": "10m" + }, + { + "selected": false, + "text": "30m", + "value": "30m" + }, + { + "selected": false, + "text": "1h", + "value": "1h" + }, + { + "selected": false, + "text": "6h", + "value": "6h" + }, + { + "selected": false, + "text": "12h", + "value": "12h" + }, + { + "selected": false, + "text": "1d", + "value": "1d" + }, + { + "selected": false, + "text": "7d", + "value": "7d" + }, + { + "selected": false, + "text": "14d", + "value": "14d" + }, { - "value": "Gpp3B1Pik", - "text": "Gpp3B1Pik" + "selected": false, + "text": "30d", + "value": "30d" } ], - "query": "Gpp3B1Pik", + "query": "1m,5m,10m,30m,1h,6h,12h,1d,7d,14d,30d", + "queryValue": "", + "refresh": 2, "skipUrlSync": false, - "type": "constant" + "type": "interval" } ] }, @@ -2011,7 +2220,6 @@ }, "timepicker": { "refresh_intervals": [ - "5s", "10s", "30s", "1m", @@ -2035,7 +2243,7 @@ ] }, "timezone": "", - "title": "Ruby On Rails Performance Overview", - "uid": "K2CJtIVZz", - "version": 1 -} + "title": "Performance", + "uid": "influxdb-rails-overview", + "version": 24 +} \ No newline at end of file diff --git a/sample-dashboard/provisioning/requests.json b/sample-dashboard/provisioning/requests.json new file mode 100644 index 0000000..dfdbc6f --- /dev/null +++ b/sample-dashboard/provisioning/requests.json @@ -0,0 +1,834 @@ +{ + "__inputs": [ + { + "name": "DS_INFLUXDB-RAILS", + "label": "InfluxDB-Rails", + "description": "", + "type": "datasource", + "pluginId": "influxdb", + "pluginName": "InfluxDB" + } + ], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "7.1.1" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph", + "version": "" + }, + { + "type": "datasource", + "id": "influxdb", + "name": "InfluxDB", + "version": "1.0.0" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": null, + "iteration": 1616428850617, + "links": [ + { + "$$hashKey": "object:55", + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "influxdb-rails" + ], + "type": "dashboards" + } + ], + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "InfluxDB", + "description": "", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "id": 12, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_exception", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "exception" + ], + "type": "tag" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "controller" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "process_action" + }, + { + "condition": "AND", + "key": "exception", + "operator": "=~", + "value": "/\\w/" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Exceptions", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "InfluxDB", + "description": "", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 0 + }, + "hiddenSeries": false, + "id": 10, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_http_method", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "http_method" + ], + "type": "tag" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "controller" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "process_action" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Methods", + "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": 2, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 9 + }, + "hiddenSeries": false, + "id": 13, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "Value", + "hideTooltip": true, + "legend": false + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_status", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "status" + ], + "type": "tag" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "controller" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "process_action" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "HTTP Status", + "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": 2, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "InfluxDB", + "description": "", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 9 + }, + "hiddenSeries": false, + "id": 8, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_format", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "format" + ], + "type": "tag" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "controller" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "process_action" + }, + { + "condition": "AND", + "key": "format", + "operator": "=~", + "value": "/\\w/" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Format", + "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": 2, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 22, + "w": 24, + "x": 0, + "y": 18 + }, + "hiddenSeries": false, + "id": 15, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "hideEmpty": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "total", + "sortDesc": true, + "total": true, + "values": true + }, + "lines": false, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_location", + "groupBy": [ + { + "params": [ + "$per" + ], + "type": "time" + }, + { + "params": [ + "location" + ], + "type": "tag" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "controller" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "process_action" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Actions", + "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": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": "5m", + "schemaVersion": 26, + "style": "dark", + "tags": [ + "Health", + "Ruby on Rails", + "influxdb-rails" + ], + "templating": { + "list": [ + { + "auto": true, + "auto_count": "50", + "auto_min": "", + "current": { + "selected": true, + "text": "auto", + "value": "$__auto_interval_per" + }, + "hide": 0, + "label": null, + "name": "per", + "options": [ + { + "selected": true, + "text": "auto", + "value": "$__auto_interval_per" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "5m", + "value": "5m" + }, + { + "selected": false, + "text": "15m", + "value": "15m" + }, + { + "selected": false, + "text": "30m", + "value": "30m" + }, + { + "selected": false, + "text": "1h", + "value": "1h" + }, + { + "selected": false, + "text": "12h", + "value": "12h" + }, + { + "selected": false, + "text": "1d", + "value": "1d" + }, + { + "selected": false, + "text": "1w", + "value": "1w" + } + ], + "query": "1m,5m,15m,30m,1h,12h,1d,1w", + "queryValue": "", + "refresh": 2, + "skipUrlSync": false, + "type": "interval" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "Requests", + "uid": "influxdb-rails-requests", + "version": 17 +} \ No newline at end of file diff --git a/sample-dashboard/provisioning/slowlog-action.json b/sample-dashboard/provisioning/slowlog-action.json new file mode 100644 index 0000000..335f41f --- /dev/null +++ b/sample-dashboard/provisioning/slowlog-action.json @@ -0,0 +1,278 @@ +{ + "__inputs": [ + { + "name": "DS_INFLUXDB-RAILS", + "label": "InfluxDB-Rails", + "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 controller actions", + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": null, + "links": [ + { + "$$hashKey": "object:349", + "icon": "external link", + "keepTime": true, + "tags": [ + "influxdb-rails" + ], + "type": "dashboards" + } + ], + "panels": [ + { + "columns": [], + "datasource": "InfluxDB", + "description": "The list of slowest controller actions", + "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": 3, + "desc": true + }, + "styles": [ + { + "$$hashKey": "object:5125", + "alias": "Finished", + "align": "auto", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "hidden" + }, + { + "$$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", + "50000" + ], + "type": "number", + "unit": "ms" + }, + { + "$$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_1}&from=${__cell_2}&to=${__cell_0}", + "mappingType": 1, + "pattern": "method", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "$$hashKey": "object:505", + "alias": "Started", + "align": "", + "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, + "mappingType": 1, + "pattern": "started", + "thresholds": [], + "type": "hidden", + "unit": "short" + }, + { + "$$hashKey": "object:826", + "alias": "Ended", + "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, + "mappingType": 1, + "pattern": "ended", + "thresholds": [], + "type": "hidden", + "unit": "short" + } + ], + "targets": [ + { + "groupBy": [ + { + "params": [ + "method" + ], + "type": "tag" + } + ], + "limit": "", + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "table", + "select": [ + [ + { + "params": [ + "started" + ], + "type": "field" + } + ], + [ + { + "params": [ + "controller" + ], + "type": "field" + }, + { + "params": [], + "type": "max" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "process_action" + } + ] + } + ], + "title": "Slowest Actions", + "transform": "table", + "transformations": [ + { + "id": "calculateField", + "options": { + "alias": "ended", + "binary": { + "left": "started", + "operator": "+", + "reducer": "sum", + "right": "max" + }, + "mode": "binary", + "reduce": { + "reducer": "sum" + } + } + } + ], + "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": "Slowlog by Controller Action", + "uid": "influxdb-rails-slowlog-action", + "version": 12 +} \ No newline at end of file diff --git a/sample-dashboard/provisioning/slowlog-requests.json b/sample-dashboard/provisioning/slowlog-requests.json new file mode 100644 index 0000000..7c7cde6 --- /dev/null +++ b/sample-dashboard/provisioning/slowlog-requests.json @@ -0,0 +1,277 @@ +{ + "__inputs": [ + { + "name": "DS_INFLUXDB-RAILS", + "label": "InfluxDB-Rails", + "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": "", + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": null, + "links": [ + { + "$$hashKey": "object:419", + "icon": "external link", + "tags": [ + "influxdb-rails" + ], + "type": "dashboards" + } + ], + "panels": [ + { + "columns": [], + "datasource": "InfluxDB", + "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": "Slowlog by Request", + "uid": "influxdb-rails-slowlog-request", + "version": 12 +} \ No newline at end of file diff --git a/sample-dashboard/provisioning/slowlog-sql.json b/sample-dashboard/provisioning/slowlog-sql.json new file mode 100644 index 0000000..e82d54a --- /dev/null +++ b/sample-dashboard/provisioning/slowlog-sql.json @@ -0,0 +1,328 @@ +{ + "__inputs": [ + { + "name": "DS_INFLUXDB-RAILS", + "label": "InfluxDB-Rails", + "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": "The sloweds queries in your app in the last hour", + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": null, + "links": [ + { + "$$hashKey": "object:40", + "icon": "external link", + "tags": [ + "influxdb-rails" + ], + "type": "dashboards" + } + ], + "panels": [ + { + "columns": [], + "datasource": "InfluxDB", + "description": "Data for the selected range by database query.\n\n- Count: Number of occurrences\n- Mean: Average time spent\n- Median: Median time spent\n- Maximum: Slowest occurrence\n\n[Average vs. Median?](https://www.differencebetween.com/difference-between-mean-and-median/)", + "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": 6, + "desc": true + }, + "styles": [ + { + "alias": "Time", + "align": "auto", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "hidden" + }, + { + "alias": "Count", + "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": null, + "mappingType": 1, + "pattern": "count", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Mean", + "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, + "mappingType": 1, + "pattern": "mean", + "thresholds": [], + "type": "number", + "unit": "ms" + }, + { + "alias": "Median", + "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, + "mappingType": 1, + "pattern": "median", + "thresholds": [], + "type": "number", + "unit": "ms" + }, + { + "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": "location", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Name of the operation", + "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, + "mappingType": 1, + "pattern": "name", + "thresholds": [], + "type": "string", + "unit": "short", + "valueMaps": [ + { + "text": "Raw", + "value": "" + } + ] + }, + { + "alias": "Maximum", + "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" + } + ], + "targets": [ + { + "groupBy": [ + { + "params": [ + "name" + ], + "type": "tag" + }, + { + "params": [ + "location" + ], + "type": "tag" + } + ], + "measurement": "rails", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "table", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ], + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ], + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "median" + } + ], + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "max" + } + ] + ], + "tags": [ + { + "key": "hook", + "operator": "=", + "value": "sql" + } + ] + } + ], + "title": "Slowest Database Query", + "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": { + "hidden": false, + "refresh_intervals": [ + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "Slowlog by SQL Query", + "uid": "influxdb-rails-slowlog-sql", + "version": 14 +} \ No newline at end of file