From 5503a035a55feaade9344d651aea0531e2ac0c37 Mon Sep 17 00:00:00 2001 From: Jonny Adshead Date: Tue, 25 Aug 2020 12:18:28 -0700 Subject: [PATCH] fix(pollModuleMap): ensure single pollModuleMap (#284) --- __performance__/README.md | 8 +- .../grafana/dashboards/one-app-classic.json | 246 +- .../dashboards/one-app-performance.json | 5673 +++++++++-------- .../__snapshots__/one-app.spec.js.snap | 2 + .../__snapshots__/holocron.spec.js.snap | 2 + package.json | 3 + prod-sample/README.md | 2 + prod-sample/docker-compose.debug.yml | 10 + prod-sample/docker-compose.override.yml | 6 + prod-sample/docker-compose.yml | 62 +- prod-sample/one-app/debug.env | 18 + src/server/metrics/holocron.js | 10 + src/server/middleware/sendHtml.js | 2 +- src/server/utils/pollModuleMap.js | 14 +- 14 files changed, 3251 insertions(+), 2807 deletions(-) create mode 100644 prod-sample/docker-compose.debug.yml create mode 100644 prod-sample/docker-compose.override.yml create mode 100644 prod-sample/one-app/debug.env diff --git a/__performance__/README.md b/__performance__/README.md index 869260b34..ec55ebc4b 100644 --- a/__performance__/README.md +++ b/__performance__/README.md @@ -77,10 +77,10 @@ Wait for `🌎 One App server listening on port 8443` to appear in the logs to i > `npm run start:prod-sample` creates the `prod-sample_one-app-at-test-network` network which is required for the performance tools to start when running against prod-sample. -After prod-sample has successfully started you will need to start the performance test suite infrastructure in a new terminal window, navigate to `one-app/__performance__` and run the following: +After prod-sample has successfully started you will need to start the performance test suite infrastructure in a new terminal window, navigate to `one-app` and run the following: ```bash -docker-compose -f docker-compose.yml -f docker-compose.prod-sample.yml up --abort-on-container-exit influxdb grafana prometheus +npm run monitor:performance ``` You can now view the [Grafana metrics on localhost:3030](http://localhost:3030/d/tDGvrq7Mz/one-app-performance) @@ -122,10 +122,10 @@ If you want to run against a remote server you will need to update `targets` wit ] ``` -Next you can start the performance test suite infrastructure, navigate to `one-app/__performance__` and run the following: +Next you can start the performance test suite infrastructure, navigate to `one-app` and run the following: ```bash -docker-compose up --abort-on-container-exit influxdb grafana prometheus +npm run monitor:performance ``` You can now view the [Grafana metrics on localhost:3030](http://localhost:3030/d/tDGvrq7Mz/one-app-performance) diff --git a/__performance__/grafana/dashboards/one-app-classic.json b/__performance__/grafana/dashboards/one-app-classic.json index 4562e033e..b88c8fe5b 100644 --- a/__performance__/grafana/dashboards/one-app-classic.json +++ b/__performance__/grafana/dashboards/one-app-classic.json @@ -15,7 +15,7 @@ "editable": true, "gnetId": null, "graphTooltip": 0, - "iteration": 1597172051617, + "iteration": 1598299567756, "links": [], "panels": [ { @@ -229,8 +229,8 @@ "fill": 1, "fillGradient": 0, "gridPos": { - "h": 7, - "w": 12, + "h": 9, + "w": 6, "x": 0, "y": 4 }, @@ -326,13 +326,105 @@ "fill": 1, "fillGradient": 0, "gridPos": { - "h": 7, - "w": 12, + "h": 9, + "w": 6, + "x": 6, + "y": 4 + }, + "hiddenSeries": false, + "id": 44, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "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": [ + { + "expr": "rate(oneapp_holocron_module_map_poll_restarted_total[$granularity])", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Module Map Restarts", + "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": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 6, "x": 12, "y": 4 }, "hiddenSeries": false, - "id": 35, + "id": 46, "legend": { "avg": false, "current": false, @@ -344,11 +436,10 @@ }, "lines": true, "linewidth": 1, - "links": [], "nullPointMode": "null", "percentage": false, "pluginVersion": "7.1.1", - "pointradius": 5, + "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], @@ -357,11 +448,9 @@ "steppedLine": false, "targets": [ { - "expr": "rate(circuit{event=~\"open|close\"}[2m])", - "format": "time_series", + "expr": "rate(oneapp_holocron_module_map_updated_total[$granularity])", "interval": "", - "intervalFactor": 1, - "legendFormat": "{{name}} {{event}} ({{podname}})", + "legendFormat": "", "refId": "A" } ], @@ -369,7 +458,7 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "Circuit Events, Opening and Closing", + "title": "Module Map Updated", "tooltip": { "shared": true, "sort": 0, @@ -422,9 +511,9 @@ "fillGradient": 0, "gridPos": { "h": 9, - "w": 12, - "x": 0, - "y": 11 + "w": 6, + "x": 18, + "y": 4 }, "hiddenSeries": false, "id": 27, @@ -531,10 +620,10 @@ "fill": 1, "fillGradient": 0, "gridPos": { - "h": 9, + "h": 8, "w": 12, - "x": 12, - "y": 11 + "x": 0, + "y": 13 }, "hiddenSeries": false, "id": 29, @@ -612,6 +701,101 @@ "alignLevel": null } }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 13 + }, + "hiddenSeries": false, + "id": 35, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(circuit{event=~\"open|close\"}[2m])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{name}} {{event}} ({{podname}})", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Circuit Events, Opening and Closing", + "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": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, { "collapsed": false, "datasource": null, @@ -619,7 +803,7 @@ "h": 1, "w": 24, "x": 0, - "y": 20 + "y": 21 }, "id": 4, "panels": [], @@ -645,7 +829,7 @@ "h": 8, "w": 24, "x": 0, - "y": 21 + "y": 22 }, "hiddenSeries": false, "id": 8, @@ -758,7 +942,7 @@ "h": 8, "w": 12, "x": 0, - "y": 29 + "y": 30 }, "hiddenSeries": false, "id": 6, @@ -853,7 +1037,7 @@ "h": 8, "w": 12, "x": 12, - "y": 29 + "y": 30 }, "hiddenSeries": false, "id": 2, @@ -961,7 +1145,7 @@ "h": 1, "w": 24, "x": 0, - "y": 37 + "y": 38 }, "id": 14, "panels": [], @@ -986,7 +1170,7 @@ "h": 8, "w": 24, "x": 0, - "y": 38 + "y": 39 }, "hiddenSeries": false, "id": 16, @@ -1070,7 +1254,7 @@ "h": 1, "w": 24, "x": 0, - "y": 46 + "y": 47 }, "id": 10, "panels": [], @@ -1095,7 +1279,7 @@ "h": 9, "w": 24, "x": 0, - "y": 47 + "y": 48 }, "hiddenSeries": false, "id": 12, @@ -1200,7 +1384,7 @@ "h": 1, "w": 24, "x": 0, - "y": 56 + "y": 57 }, "id": 42, "panels": [], @@ -1225,7 +1409,7 @@ "h": 9, "w": 12, "x": 0, - "y": 57 + "y": 58 }, "hiddenSeries": false, "id": 40, @@ -1326,7 +1510,7 @@ "h": 9, "w": 12, "x": 12, - "y": 57 + "y": 58 }, "heatmap": {}, "hideZeroBuckets": false, @@ -1453,7 +1637,7 @@ ] }, "time": { - "from": "now-1h", + "from": "now-6h", "to": "now" }, "timepicker": { diff --git a/__performance__/grafana/dashboards/one-app-performance.json b/__performance__/grafana/dashboards/one-app-performance.json index 42704e537..438235186 100644 --- a/__performance__/grafana/dashboards/one-app-performance.json +++ b/__performance__/grafana/dashboards/one-app-performance.json @@ -14,8 +14,8 @@ }, "editable": true, "gnetId": null, - "graphTooltip": 2, - "iteration": 1597171988605, + "graphTooltip": 1, + "iteration": 1597788677662, "links": [], "panels": [ { @@ -374,690 +374,1446 @@ "type": "table-old" }, { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": "InfluxDB", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, + "collapsed": true, + "datasource": null, "gridPos": { - "h": 8, - "w": 8, + "h": 1, + "w": 24, "x": 0, "y": 5 }, - "hiddenSeries": false, - "id": 10, - "interval": ">1s", - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": false, - "linewidth": 1, - "nullPointMode": "null", - "percentage": false, - "pluginVersion": "7.1.1", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ + "id": 106, + "panels": [ { - "alias": "Active VUs", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {} }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 6 + }, + "hiddenSeries": false, + "id": 10, + "interval": ">1s", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": false, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ { - "params": [ - "none" + "alias": "Active VUs", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } ], - "type": "fill" + "measurement": "vus", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] } ], - "measurement": "vus", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "VU", + "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": true + } ], - "tags": [] - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "VU", - "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": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": "InfluxDB", - "fieldConfig": { - "defaults": { - "custom": {} + "yaxis": { + "align": false, + "alignLevel": null + } }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 8, - "x": 8, - "y": 5 - }, - "hiddenSeries": false, - "id": 45, - "interval": ">1s", - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": false, - "min": false, - "show": true, - "total": true, - "values": true - }, - "lines": false, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pluginVersion": "7.1.1", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Num Errors", - "color": "#BF1B00" - } - ], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ { - "alias": "$tag_check", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "1s" - ], - "type": "time" + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {} }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 8, + "x": 8, + "y": 6 + }, + "hiddenSeries": false, + "id": 45, + "interval": ">1s", + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": false, + "min": false, + "show": true, + "total": true, + "values": true + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ { - "params": [ - "check" - ], - "type": "tag" - }, + "alias": "Num Errors", + "color": "#BF1B00" + } + ], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ { - "params": [ - "none" + "alias": "$tag_check", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "1s" + ], + "type": "time" + }, + { + "params": [ + "check" + ], + "type": "tag" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "measurement": "checks", + "orderByTime": "ASC", + "policy": "default", + "refId": "C", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] ], - "type": "fill" + "tags": [] } ], - "measurement": "checks", - "orderByTime": "ASC", - "policy": "default", - "refId": "C", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "sum" - } - ] + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Checks Per Second", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } ], - "tags": [] - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Checks Per Second", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "none", - "label": null, - "logBase": 1, - "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": 8, - "w": 8, - "x": 16, - "y": 5 - }, - "hiddenSeries": false, - "id": 12, - "interval": "1s", - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": false, - "linewidth": 1, - "nullPointMode": "null", - "percentage": false, - "pluginVersion": "7.1.1", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ + "yaxis": { + "align": false, + "alignLevel": null + } + }, { - "alias": "Requests per Second", - "groupBy": [ - { - "params": [ - "1s" - ], - "type": "time" + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {} }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 8, + "x": 16, + "y": 6 + }, + "hiddenSeries": false, + "id": 12, + "interval": "1s", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": false, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ { - "params": [ - "0" + "alias": "Requests per Second", + "groupBy": [ + { + "params": [ + "1s" + ], + "type": "time" + }, + { + "params": [ + "0" + ], + "type": "fill" + } ], - "type": "fill" + "measurement": "http_reqs", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] } ], - "measurement": "http_reqs", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "sum" - } - ] + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Requests per Second", + "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": true + } ], - "tags": [] - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Requests per Second", - "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": true + "yaxis": { + "align": false, + "alignLevel": null + } } ], - "yaxis": { - "align": false, - "alignLevel": null - } + "title": "K6 VU requests", + "type": "row" }, { - "collapsed": false, + "collapsed": true, "datasource": null, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 13 + "y": 6 }, "id": 73, - "panels": [], - "repeat": "Measurement", - "scopedVars": { - "Measurement": { - "selected": true, - "text": "http_req_duration", - "value": "http_req_duration" - } - }, - "title": "$Measurement", - "type": "row" - }, - { - "cacheTimeout": null, - "datasource": "InfluxDB", - "fieldConfig": { - "defaults": { - "custom": {}, - "decimals": 2, - "mappings": [ + "panels": [ + { + "cacheTimeout": null, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {}, + "decimals": 2, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "N/A", + "type": 1, + "value": "null" + } + ], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 0, + "y": 22 + }, + "id": 79, + "interval": null, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "7.1.1", + "scopedVars": { + "Measurement": { + "selected": true, + "text": "http_req_duration", + "value": "http_req_duration" + } + }, + "targets": [ { - "id": 0, - "op": "=", - "text": "N/A", - "type": 1, - "value": "null" + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT mean(\"value\") FROM $Measurement WHERE $timeFilter ", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] } ], - "nullValueMode": "connected", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null + "title": "$Measurement (mean)", + "type": "stat" + }, + { + "cacheTimeout": null, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {}, + "decimals": 2, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "N/A", + "type": 1, + "value": "null" + } + ], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] }, - { - "color": "red", - "value": 80 - } - ] + "unit": "ms" + }, + "overrides": [] }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 0, - "y": 14 - }, - "id": 79, - "interval": null, - "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "mean" + "gridPos": { + "h": 3, + "w": 4, + "x": 4, + "y": 22 + }, + "id": 77, + "interval": null, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "7.1.1", + "scopedVars": { + "Measurement": { + "selected": true, + "text": "http_req_duration", + "value": "http_req_duration" + } + }, + "targets": [ + { + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT max(\"value\") FROM $Measurement WHERE $timeFilter", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } ], - "fields": "", - "values": false + "title": "$Measurement (max)", + "type": "stat" }, - "textMode": "auto" - }, - "pluginVersion": "7.1.1", - "scopedVars": { - "Measurement": { - "selected": true, - "text": "http_req_duration", - "value": "http_req_duration" - } - }, - "targets": [ { - "dsType": "influxdb", - "groupBy": [ + "cacheTimeout": null, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {}, + "decimals": 2, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "N/A", + "type": 1, + "value": "null" + } + ], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 8, + "y": 22 + }, + "id": 81, + "interval": null, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "7.1.1", + "scopedVars": { + "Measurement": { + "selected": true, + "text": "http_req_duration", + "value": "http_req_duration" + } + }, + "targets": [ { - "params": [ - "$__interval" + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT median(\"value\") FROM $Measurement WHERE $timeFilter", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "title": "$Measurement (med)", + "type": "stat" + }, + { + "cacheTimeout": null, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {}, + "decimals": 2, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "N/A", + "type": 1, + "value": "null" + } + ], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 12, + "y": 22 + }, + "id": 83, + "interval": null, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" ], - "type": "time" + "fields": "", + "values": false }, + "textMode": "auto" + }, + "pluginVersion": "7.1.1", + "scopedVars": { + "Measurement": { + "selected": true, + "text": "http_req_duration", + "value": "http_req_duration" + } + }, + "targets": [ { - "params": [ - "null" + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT min(\"value\") FROM $Measurement WHERE $timeFilter and value > 0", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] ], - "type": "fill" + "tags": [] } ], - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT mean(\"value\") FROM $Measurement WHERE $timeFilter ", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" + "title": "$Measurement (min)", + "type": "stat" + }, + { + "cacheTimeout": null, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {}, + "decimals": 2, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "N/A", + "type": 1, + "value": "null" + } + ], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [] - } - ], - "title": "$Measurement (mean)", - "type": "stat" - }, - { - "cacheTimeout": null, - "datasource": "InfluxDB", - "fieldConfig": { - "defaults": { - "custom": {}, - "decimals": 2, - "mappings": [ + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 16, + "y": 22 + }, + "id": 85, + "interval": null, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "7.1.1", + "scopedVars": { + "Measurement": { + "selected": true, + "text": "http_req_duration", + "value": "http_req_duration" + } + }, + "targets": [ { - "id": 0, - "op": "=", - "text": "N/A", - "type": 1, - "value": "null" + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT percentile(\"value\", 90) FROM $Measurement WHERE $timeFilter", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] } ], - "nullValueMode": "connected", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null + "title": "$Measurement (p90)", + "type": "stat" + }, + { + "cacheTimeout": null, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {}, + "decimals": 2, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "N/A", + "type": 1, + "value": "null" + } + ], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] }, - { - "color": "red", - "value": 80 - } - ] + "unit": "ms" + }, + "overrides": [] }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 4, - "y": 14 - }, - "id": 77, - "interval": null, - "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "mean" + "gridPos": { + "h": 3, + "w": 4, + "x": 20, + "y": 22 + }, + "id": 87, + "interval": null, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "7.1.1", + "scopedVars": { + "Measurement": { + "selected": true, + "text": "http_req_duration", + "value": "http_req_duration" + } + }, + "targets": [ + { + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT percentile(\"value\", 95) FROM $Measurement WHERE $timeFilter ", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } ], - "fields": "", - "values": false + "title": "$Measurement (p95)", + "type": "stat" }, - "textMode": "auto" - }, - "pluginVersion": "7.1.1", - "scopedVars": { - "Measurement": { - "selected": true, - "text": "http_req_duration", - "value": "http_req_duration" - } - }, - "targets": [ { - "dsType": "influxdb", - "groupBy": [ + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "InfluxDB", + "description": "Grouped by 1 sec intervals", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 25 + }, + "height": "250px", + "hiddenSeries": false, + "id": 89, + "interval": ">1s", + "legend": { + "alignAsTable": false, + "avg": true, + "current": false, + "hideEmpty": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 5, + "points": false, + "renderer": "flot", + "scopedVars": { + "Measurement": { + "selected": true, + "text": "http_req_duration", + "value": "http_req_duration" + } + }, + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "max", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "measurement": "/^$Measurement$/", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT max(\"value\") FROM /^$Measurement$/ WHERE $timeFilter and value > 0 GROUP BY time($__interval) fill(none)", + "rawQuery": true, + "refId": "C", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "max" + } + ] + ], + "tags": [] + }, { - "params": [ - "$__interval" + "alias": "p95", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } ], - "type": "time" + "measurement": "/^$Measurement$/", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT percentile(\"value\", 95) FROM /^$Measurement$/ WHERE $timeFilter and value > 0 GROUP BY time($__interval) fill(none)", + "rawQuery": true, + "refId": "D", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [ + 95 + ], + "type": "percentile" + } + ] + ], + "tags": [] + }, + { + "alias": "p90", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "measurement": "/^$Measurement$/", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT percentile(\"value\", 90) FROM /^$Measurement$/ WHERE $timeFilter and value > 0 GROUP BY time($__interval) fill(none)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [ + "90" + ], + "type": "percentile" + } + ] + ], + "tags": [] }, { - "params": [ - "null" + "alias": "min", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "measurement": "/^$Measurement$/", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT min(\"value\") FROM /^$Measurement$/ WHERE $timeFilter and value > 0 GROUP BY time($__interval) fill(none)", + "rawQuery": true, + "refId": "E", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "min" + } + ] ], - "type": "fill" + "tags": [] } ], - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT max(\"value\") FROM $Measurement WHERE $timeFilter", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [] - } - ], - "title": "$Measurement (max)", - "type": "stat" - }, - { - "cacheTimeout": null, - "datasource": "InfluxDB", - "fieldConfig": { - "defaults": { - "custom": {}, - "decimals": 2, - "mappings": [ + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "$Measurement (over time)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ { - "id": 0, - "op": "=", - "text": "N/A", - "type": 1, - "value": "null" + "format": "ms", + "label": null, + "logBase": 2, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true } ], - "nullValueMode": "connected", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ms" + "yaxis": { + "align": false, + "alignLevel": null + } }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 8, - "y": 14 - }, - "id": 81, - "interval": null, - "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "mean" + { + "cards": { + "cardPadding": null, + "cardRound": null + }, + "color": { + "cardColor": "rgb(0, 234, 255)", + "colorScale": "sqrt", + "colorScheme": "interpolateRdYlGn", + "exponent": 0.5, + "mode": "spectrum" + }, + "dataFormat": "timeseries", + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 25 + }, + "heatmap": {}, + "height": "250px", + "hideZeroBuckets": false, + "highlightCards": true, + "id": 91, + "interval": ">1s", + "legend": { + "show": false + }, + "links": [], + "reverseYBuckets": false, + "scopedVars": { + "Measurement": { + "selected": true, + "text": "http_req_duration", + "value": "http_req_duration" + } + }, + "targets": [ + { + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "http_req_duration", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT \"value\" FROM $Measurement WHERE $timeFilter and value > 0", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } ], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "7.1.1", + "title": "$Measurement (over time)", + "tooltip": { + "show": true, + "showHistogram": true + }, + "tooltipDecimals": null, + "type": "heatmap", + "xAxis": { + "show": true + }, + "xBucketNumber": null, + "xBucketSize": null, + "yAxis": { + "decimals": null, + "format": "ms", + "logBase": 2, + "max": null, + "min": null, + "show": true, + "splitFactor": null + }, + "yBucketBound": "auto", + "yBucketNumber": null, + "yBucketSize": null + } + ], + "repeat": "Measurement", "scopedVars": { "Measurement": { "selected": true, @@ -1065,383 +1821,1106 @@ "value": "http_req_duration" } }, - "targets": [ + "title": "$Measurement", + "type": "row" + }, + { + "collapsed": true, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 7 + }, + "id": 107, + "panels": [ { - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$__interval" + "cacheTimeout": null, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {}, + "decimals": 2, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "N/A", + "type": 1, + "value": "null" + } + ], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 0, + "y": 22 + }, + "id": 108, + "interval": null, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" ], - "type": "time" + "fields": "", + "values": false }, + "textMode": "auto" + }, + "pluginVersion": "7.1.1", + "repeatIteration": 1597788677662, + "repeatPanelId": 79, + "repeatedByRow": true, + "scopedVars": { + "Measurement": { + "selected": true, + "text": "http_req_blocked", + "value": "http_req_blocked" + } + }, + "targets": [ { - "params": [ - "null" + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } ], - "type": "fill" + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT mean(\"value\") FROM $Measurement WHERE $timeFilter ", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] } ], - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT median(\"value\") FROM $Measurement WHERE $timeFilter", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" + "title": "$Measurement (mean)", + "type": "stat" + }, + { + "cacheTimeout": null, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {}, + "decimals": 2, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "N/A", + "type": 1, + "value": "null" + } + ], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [] - } - ], - "title": "$Measurement (med)", - "type": "stat" - }, - { - "cacheTimeout": null, - "datasource": "InfluxDB", - "fieldConfig": { - "defaults": { - "custom": {}, - "decimals": 2, - "mappings": [ + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 4, + "y": 22 + }, + "id": 109, + "interval": null, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "7.1.1", + "repeatIteration": 1597788677662, + "repeatPanelId": 77, + "repeatedByRow": true, + "scopedVars": { + "Measurement": { + "selected": true, + "text": "http_req_blocked", + "value": "http_req_blocked" + } + }, + "targets": [ { - "id": 0, - "op": "=", - "text": "N/A", - "type": 1, - "value": "null" + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT max(\"value\") FROM $Measurement WHERE $timeFilter", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] } ], - "nullValueMode": "connected", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null + "title": "$Measurement (max)", + "type": "stat" + }, + { + "cacheTimeout": null, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {}, + "decimals": 2, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "N/A", + "type": 1, + "value": "null" + } + ], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] }, - { - "color": "red", - "value": 80 - } - ] + "unit": "ms" + }, + "overrides": [] }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 12, - "y": 14 - }, - "id": 83, - "interval": null, - "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" + "gridPos": { + "h": 3, + "w": 4, + "x": 8, + "y": 22 + }, + "id": 110, + "interval": null, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "7.1.1", + "repeatIteration": 1597788677662, + "repeatPanelId": 81, + "repeatedByRow": true, + "scopedVars": { + "Measurement": { + "selected": true, + "text": "http_req_blocked", + "value": "http_req_blocked" + } + }, + "targets": [ + { + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT median(\"value\") FROM $Measurement WHERE $timeFilter", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } ], - "fields": "", - "values": false + "title": "$Measurement (med)", + "type": "stat" }, - "textMode": "auto" - }, - "pluginVersion": "7.1.1", - "scopedVars": { - "Measurement": { - "selected": true, - "text": "http_req_duration", - "value": "http_req_duration" - } - }, - "targets": [ { - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$__interval" + "cacheTimeout": null, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {}, + "decimals": 2, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "N/A", + "type": 1, + "value": "null" + } + ], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 12, + "y": 22 + }, + "id": 111, + "interval": null, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" ], - "type": "time" + "fields": "", + "values": false }, + "textMode": "auto" + }, + "pluginVersion": "7.1.1", + "repeatIteration": 1597788677662, + "repeatPanelId": 83, + "repeatedByRow": true, + "scopedVars": { + "Measurement": { + "selected": true, + "text": "http_req_blocked", + "value": "http_req_blocked" + } + }, + "targets": [ { - "params": [ - "null" + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } ], - "type": "fill" + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT min(\"value\") FROM $Measurement WHERE $timeFilter and value > 0", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] } ], - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT min(\"value\") FROM $Measurement WHERE $timeFilter and value > 0", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" + "title": "$Measurement (min)", + "type": "stat" + }, + { + "cacheTimeout": null, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {}, + "decimals": 2, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "N/A", + "type": 1, + "value": "null" + } + ], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [] - } - ], - "title": "$Measurement (min)", - "type": "stat" - }, - { - "cacheTimeout": null, - "datasource": "InfluxDB", - "fieldConfig": { - "defaults": { - "custom": {}, - "decimals": 2, - "mappings": [ + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 16, + "y": 22 + }, + "id": 112, + "interval": null, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "7.1.1", + "repeatIteration": 1597788677662, + "repeatPanelId": 85, + "repeatedByRow": true, + "scopedVars": { + "Measurement": { + "selected": true, + "text": "http_req_blocked", + "value": "http_req_blocked" + } + }, + "targets": [ { - "id": 0, - "op": "=", - "text": "N/A", - "type": 1, - "value": "null" + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT percentile(\"value\", 90) FROM $Measurement WHERE $timeFilter", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] } ], - "nullValueMode": "connected", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null + "title": "$Measurement (p90)", + "type": "stat" + }, + { + "cacheTimeout": null, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {}, + "decimals": 2, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "N/A", + "type": 1, + "value": "null" + } + ], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] }, - { - "color": "red", - "value": 80 - } - ] + "unit": "ms" + }, + "overrides": [] }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 16, - "y": 14 - }, - "id": 85, - "interval": null, - "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "mean" + "gridPos": { + "h": 3, + "w": 4, + "x": 20, + "y": 22 + }, + "id": 113, + "interval": null, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "7.1.1", + "repeatIteration": 1597788677662, + "repeatPanelId": 87, + "repeatedByRow": true, + "scopedVars": { + "Measurement": { + "selected": true, + "text": "http_req_blocked", + "value": "http_req_blocked" + } + }, + "targets": [ + { + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT percentile(\"value\", 95) FROM $Measurement WHERE $timeFilter ", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } ], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "7.1.1", - "scopedVars": { - "Measurement": { - "selected": true, - "text": "http_req_duration", - "value": "http_req_duration" - } - }, - "targets": [ + "title": "$Measurement (p95)", + "type": "stat" + }, { - "dsType": "influxdb", - "groupBy": [ + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "InfluxDB", + "description": "Grouped by 1 sec intervals", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 25 + }, + "height": "250px", + "hiddenSeries": false, + "id": 114, + "interval": ">1s", + "legend": { + "alignAsTable": false, + "avg": true, + "current": false, + "hideEmpty": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.1", + "pointradius": 5, + "points": false, + "renderer": "flot", + "repeatIteration": 1597788677662, + "repeatPanelId": 89, + "repeatedByRow": true, + "scopedVars": { + "Measurement": { + "selected": true, + "text": "http_req_blocked", + "value": "http_req_blocked" + } + }, + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ { - "params": [ - "$__interval" + "alias": "max", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "measurement": "/^$Measurement$/", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT max(\"value\") FROM /^$Measurement$/ WHERE $timeFilter and value > 0 GROUP BY time($__interval) fill(none)", + "rawQuery": true, + "refId": "C", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "max" + } + ] ], - "type": "time" + "tags": [] }, { - "params": [ - "null" + "alias": "p95", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } ], - "type": "fill" - } - ], - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT percentile(\"value\", 90) FROM $Measurement WHERE $timeFilter", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [] - } - ], - "title": "$Measurement (p90)", - "type": "stat" - }, - { - "cacheTimeout": null, - "datasource": "InfluxDB", - "fieldConfig": { - "defaults": { - "custom": {}, - "decimals": 2, - "mappings": [ + "measurement": "/^$Measurement$/", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT percentile(\"value\", 95) FROM /^$Measurement$/ WHERE $timeFilter and value > 0 GROUP BY time($__interval) fill(none)", + "rawQuery": true, + "refId": "D", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [ + 95 + ], + "type": "percentile" + } + ] + ], + "tags": [] + }, { - "id": 0, - "op": "=", - "text": "N/A", - "type": 1, - "value": "null" + "alias": "p90", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "measurement": "/^$Measurement$/", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT percentile(\"value\", 90) FROM /^$Measurement$/ WHERE $timeFilter and value > 0 GROUP BY time($__interval) fill(none)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [ + "90" + ], + "type": "percentile" + } + ] + ], + "tags": [] + }, + { + "alias": "min", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "measurement": "/^$Measurement$/", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT min(\"value\") FROM /^$Measurement$/ WHERE $timeFilter and value > 0 GROUP BY time($__interval) fill(none)", + "rawQuery": true, + "refId": "E", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "min" + } + ] + ], + "tags": [] } ], - "nullValueMode": "connected", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "$Measurement (over time)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 20, - "y": 14 - }, - "id": 87, - "interval": null, - "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "mean" + "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": true + } ], - "fields": "", - "values": false + "yaxis": { + "align": false, + "alignLevel": null + } }, - "textMode": "auto" - }, - "pluginVersion": "7.1.1", - "scopedVars": { - "Measurement": { - "selected": true, - "text": "http_req_duration", - "value": "http_req_duration" - } - }, - "targets": [ { - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" + "cards": { + "cardPadding": null, + "cardRound": null + }, + "color": { + "cardColor": "rgb(0, 234, 255)", + "colorScale": "sqrt", + "colorScheme": "interpolateRdYlGn", + "exponent": 0.5, + "mode": "spectrum" + }, + "dataFormat": "timeseries", + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {} }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 25 + }, + "heatmap": {}, + "height": "250px", + "hideZeroBuckets": false, + "highlightCards": true, + "id": 115, + "interval": ">1s", + "legend": { + "show": false + }, + "links": [], + "repeatIteration": 1597788677662, + "repeatPanelId": 91, + "repeatedByRow": true, + "reverseYBuckets": false, + "scopedVars": { + "Measurement": { + "selected": true, + "text": "http_req_blocked", + "value": "http_req_blocked" + } + }, + "targets": [ { - "params": [ - "null" + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "http_req_duration", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT \"value\" FROM $Measurement WHERE $timeFilter and value > 0", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] ], - "type": "fill" + "tags": [] } ], - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT percentile(\"value\", 95) FROM $Measurement WHERE $timeFilter ", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [] + "title": "$Measurement (over time)", + "tooltip": { + "show": true, + "showHistogram": true + }, + "tooltipDecimals": null, + "type": "heatmap", + "xAxis": { + "show": true + }, + "xBucketNumber": null, + "xBucketSize": null, + "yAxis": { + "decimals": null, + "format": "ms", + "logBase": 2, + "max": null, + "min": null, + "show": true, + "splitFactor": null + }, + "yBucketBound": "auto", + "yBucketNumber": null, + "yBucketSize": null } ], - "title": "$Measurement (p95)", - "type": "stat" + "repeat": null, + "repeatIteration": 1597788677662, + "repeatPanelId": 73, + "scopedVars": { + "Measurement": { + "selected": true, + "text": "http_req_blocked", + "value": "http_req_blocked" + } + }, + "title": "$Measurement", + "type": "row" + }, + { + "collapsed": false, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 8 + }, + "id": 26, + "panels": [], + "title": "Memory", + "type": "row" }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, - "datasource": "InfluxDB", - "description": "Grouped by 1 sec intervals", + "datasource": "Prometheus", + "description": "RSS : stands for Resident Set Size, it is the total memory allocated for the process execution\n\nHeapTotal: total size of the allocated heap\n\nHeapUsed: actual memory used during the execution of our process . \n\nExternal: memory used by \"C++ objects bound to JavaScript objects managed by V8\"", "fieldConfig": { "defaults": { "custom": {} @@ -1451,217 +2930,71 @@ "fill": 1, "fillGradient": 0, "gridPos": { - "h": 7, - "w": 12, + "h": 10, + "w": 24, "x": 0, - "y": 17 + "y": 9 }, - "height": "250px", "hiddenSeries": false, - "id": 89, - "interval": ">1s", + "id": 28, "legend": { - "alignAsTable": false, + "alignAsTable": true, "avg": true, "current": false, - "hideEmpty": false, - "max": false, + "max": true, "min": false, + "rightSide": true, "show": true, "total": false, "values": true }, "lines": true, "linewidth": 1, - "links": [], "nullPointMode": "null", "percentage": false, "pluginVersion": "7.1.1", - "pointradius": 5, + "pointradius": 2, "points": false, "renderer": "flot", - "scopedVars": { - "Measurement": { - "selected": true, - "text": "http_req_duration", - "value": "http_req_duration" - } - }, "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { - "alias": "max", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "none" - ], - "type": "fill" - } - ], - "measurement": "/^$Measurement$/", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT max(\"value\") FROM /^$Measurement$/ WHERE $timeFilter and value > 0 GROUP BY time($__interval) fill(none)", - "rawQuery": true, - "refId": "C", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "max" - } - ] - ], - "tags": [] + "expr": "nodejs_heap_size_total_bytes", + "instant": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "HeapTotal", + "refId": "A" }, { - "alias": "p95", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "none" - ], - "type": "fill" - } - ], - "measurement": "/^$Measurement$/", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT percentile(\"value\", 95) FROM /^$Measurement$/ WHERE $timeFilter and value > 0 GROUP BY time($__interval) fill(none)", - "rawQuery": true, - "refId": "D", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [ - 95 - ], - "type": "percentile" - } - ] - ], - "tags": [] + "expr": "nodejs_heap_size_used_bytes", + "hide": false, + "instant": false, + "interval": "", + "legendFormat": "HeapUsed", + "refId": "B" }, { - "alias": "p90", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "none" - ], - "type": "fill" - } - ], - "measurement": "/^$Measurement$/", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT percentile(\"value\", 90) FROM /^$Measurement$/ WHERE $timeFilter and value > 0 GROUP BY time($__interval) fill(none)", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [ - "90" - ], - "type": "percentile" - } - ] - ], - "tags": [] + "expr": "process_resident_memory_bytes", + "interval": "", + "legendFormat": "RSS", + "refId": "C" }, { - "alias": "min", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "none" - ], - "type": "fill" - } - ], - "measurement": "/^$Measurement$/", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT min(\"value\") FROM /^$Measurement$/ WHERE $timeFilter and value > 0 GROUP BY time($__interval) fill(none)", - "rawQuery": true, - "refId": "E", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "min" - } - ] - ], - "tags": [] + "expr": "nodejs_external_memory_bytes", + "interval": "", + "legendFormat": "External", + "refId": "D" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "$Measurement (over time)", + "title": "Basic Memory Consumption", "tooltip": { "shared": true, "sort": 0, @@ -1677,20 +3010,22 @@ }, "yaxes": [ { - "format": "ms", + "$$hashKey": "object:502", + "format": "decbytes", "label": null, - "logBase": 2, + "logBase": 1, "max": null, "min": null, "show": true }, { + "$$hashKey": "object:503", "format": "short", "label": null, "logBase": 1, "max": null, "min": null, - "show": true + "show": false } ], "yaxis": { @@ -1699,716 +3034,382 @@ } }, { - "cards": { - "cardPadding": null, - "cardRound": null - }, - "color": { - "cardColor": "rgb(0, 234, 255)", - "colorScale": "sqrt", - "colorScheme": "interpolateRdYlGn", - "exponent": 0.5, - "mode": "spectrum" - }, - "dataFormat": "timeseries", - "datasource": "InfluxDB", + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, + "fill": 1, + "fillGradient": 0, "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 17 + "h": 11, + "w": 24, + "x": 0, + "y": 19 }, - "heatmap": {}, - "height": "250px", - "hideZeroBuckets": false, - "highlightCards": true, - "id": 91, - "interval": ">1s", + "hiddenSeries": false, + "id": 16, "legend": { - "show": false - }, - "links": [], - "reverseYBuckets": false, - "scopedVars": { - "Measurement": { - "selected": true, - "text": "http_req_duration", - "value": "http_req_duration" - } + "alignAsTable": true, + "avg": true, + "current": false, + "hideEmpty": true, + "hideZero": true, + "max": true, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "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": [ { - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "measurement": "http_req_duration", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT \"value\" FROM $Measurement WHERE $timeFilter and value > 0", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [] - } - ], - "title": "$Measurement (over time)", - "tooltip": { - "show": true, - "showHistogram": true - }, - "tooltipDecimals": null, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketNumber": null, - "xBucketSize": null, - "yAxis": { - "decimals": null, - "format": "ms", - "logBase": 2, - "max": null, - "min": null, - "show": true, - "splitFactor": null - }, - "yBucketBound": "auto", - "yBucketNumber": null, - "yBucketSize": null - }, - { - "collapsed": false, - "datasource": null, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 24 - }, - "id": 92, - "panels": [], - "repeat": null, - "repeatIteration": 1597171988605, - "repeatPanelId": 73, - "scopedVars": { - "Measurement": { - "selected": true, - "text": "http_req_blocked", - "value": "http_req_blocked" - } - }, - "title": "$Measurement", - "type": "row" - }, - { - "cacheTimeout": null, - "datasource": "InfluxDB", - "fieldConfig": { - "defaults": { - "custom": {}, - "decimals": 2, - "mappings": [ - { - "id": 0, - "op": "=", - "text": "N/A", - "type": 1, - "value": "null" - } - ], - "nullValueMode": "connected", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ms" + "expr": "nodejs_heap_space_size_available_bytes", + "instant": false, + "interval": "", + "legendFormat": "Available {{space}}", + "refId": "A" }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 0, - "y": 25 - }, - "id": 93, - "interval": null, - "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "mean" - ], - "fields": "", - "values": false + { + "expr": "nodejs_heap_space_size_used_bytes", + "interval": "", + "legendFormat": "Used heap {{space}}", + "refId": "B" }, - "textMode": "auto" - }, - "pluginVersion": "7.1.1", - "repeatIteration": 1597171988605, - "repeatPanelId": 79, - "repeatedByRow": true, - "scopedVars": { - "Measurement": { - "selected": true, - "text": "http_req_blocked", - "value": "http_req_blocked" - } - }, - "targets": [ { - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT mean(\"value\") FROM $Measurement WHERE $timeFilter ", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [] + "expr": "nodejs_heap_space_size_total_bytes", + "interval": "", + "legendFormat": "Total {{space}}", + "refId": "C" } ], - "title": "$Measurement (mean)", - "type": "stat" - }, - { - "cacheTimeout": null, - "datasource": "InfluxDB", - "fieldConfig": { - "defaults": { - "custom": {}, - "decimals": 2, - "mappings": [ - { - "id": 0, - "op": "=", - "text": "N/A", - "type": 1, - "value": "null" - } - ], - "nullValueMode": "connected", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 4, - "y": 25 - }, - "id": 94, - "interval": null, - "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "mean" - ], - "fields": "", - "values": false - }, - "textMode": "auto" + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Used heap details", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" }, - "pluginVersion": "7.1.1", - "repeatIteration": 1597171988605, - "repeatPanelId": 77, - "repeatedByRow": true, - "scopedVars": { - "Measurement": { - "selected": true, - "text": "http_req_blocked", - "value": "http_req_blocked" - } + "transformations": [], + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] }, - "targets": [ + "yaxes": [ { - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT max(\"value\") FROM $Measurement WHERE $timeFilter", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [] + "$$hashKey": "object:404", + "format": "decbytes", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:405", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false } ], - "title": "$Measurement (max)", - "type": "stat" + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": false, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 30 + }, + "id": 69, + "panels": [], + "title": "Eventloop", + "type": "row" }, { - "cacheTimeout": null, - "datasource": "InfluxDB", + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", "fieldConfig": { "defaults": { - "custom": {}, - "decimals": 2, - "mappings": [ - { - "id": 0, - "op": "=", - "text": "N/A", - "type": 1, - "value": "null" - } - ], - "nullValueMode": "connected", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ms" + "custom": {} }, "overrides": [] }, + "fill": 1, + "fillGradient": 0, "gridPos": { - "h": 3, - "w": 4, - "x": 8, - "y": 25 + "h": 9, + "w": 24, + "x": 0, + "y": 31 }, - "id": 95, - "interval": null, - "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "mean" - ], - "fields": "", - "values": false - }, - "textMode": "auto" + "hiddenSeries": false, + "id": 18, + "legend": { + "avg": false, + "current": false, + "hideZero": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, "pluginVersion": "7.1.1", - "repeatIteration": 1597171988605, - "repeatPanelId": 81, - "repeatedByRow": true, - "scopedVars": { - "Measurement": { - "selected": true, - "text": "http_req_blocked", - "value": "http_req_blocked" - } - }, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, "targets": [ { - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT median(\"value\") FROM $Measurement WHERE $timeFilter", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [] + "expr": "nodejs_eventloop_lag_seconds", + "interval": "", + "legendFormat": "Lag", + "refId": "A" } ], - "title": "$Measurement (med)", - "type": "stat" - }, - { - "cacheTimeout": null, - "datasource": "InfluxDB", - "fieldConfig": { - "defaults": { - "custom": {}, - "decimals": 2, - "mappings": [ - { - "id": 0, - "op": "=", - "text": "N/A", - "type": 1, - "value": "null" - } - ], - "nullValueMode": "connected", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ms" - }, - "overrides": [] + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Eventloop lag", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" }, - "gridPos": { - "h": 3, - "w": 4, - "x": 12, - "y": 25 + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] }, - "id": 96, - "interval": null, - "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false + "yaxes": [ + { + "$$hashKey": "object:764", + "format": "s", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true }, - "textMode": "auto" - }, - "pluginVersion": "7.1.1", - "repeatIteration": 1597171988605, - "repeatPanelId": 83, - "repeatedByRow": true, - "scopedVars": { - "Measurement": { - "selected": true, - "text": "http_req_blocked", - "value": "http_req_blocked" - } - }, - "targets": [ { - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT min(\"value\") FROM $Measurement WHERE $timeFilter and value > 0", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [] + "$$hashKey": "object:765", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false } ], - "title": "$Measurement (min)", - "type": "stat" + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": false, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 40 + }, + "id": 67, + "panels": [], + "title": "CPU", + "type": "row" }, { - "cacheTimeout": null, - "datasource": "InfluxDB", + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", "fieldConfig": { "defaults": { - "custom": {}, - "decimals": 2, - "mappings": [ - { - "id": 0, - "op": "=", - "text": "N/A", - "type": 1, - "value": "null" - } - ], - "nullValueMode": "connected", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ms" + "custom": {} }, "overrides": [] }, + "fill": 1, + "fillGradient": 0, "gridPos": { - "h": 3, - "w": 4, - "x": 16, - "y": 25 + "h": 9, + "w": 24, + "x": 0, + "y": 41 }, - "id": 97, - "interval": null, - "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "mean" - ], - "fields": "", - "values": false - }, - "textMode": "auto" + "hiddenSeries": false, + "id": 65, + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": true, + "min": true, + "rightSide": true, + "show": true, + "total": false, + "values": true }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, "pluginVersion": "7.1.1", - "repeatIteration": 1597171988605, - "repeatPanelId": 85, - "repeatedByRow": true, - "scopedVars": { - "Measurement": { - "selected": true, - "text": "http_req_blocked", - "value": "http_req_blocked" + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(process_cpu_seconds_total[$granularity])*100", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "Process CPU", + "refId": "A" + }, + { + "expr": "rate(process_cpu_system_seconds_total[$granularity])", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "System CPU", + "refId": "B" + }, + { + "expr": "rate(process_cpu_user_seconds_total[$granularity])", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "User CPU", + "refId": "C" } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "CPU", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" }, - "targets": [ + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ { - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT percentile(\"value\", 90) FROM $Measurement WHERE $timeFilter", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [] + "$$hashKey": "object:305", + "format": "percent", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:306", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true } ], - "title": "$Measurement (p90)", - "type": "stat" + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": false, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 50 + }, + "id": 63, + "panels": [], + "title": "GC", + "type": "row" }, { - "cacheTimeout": null, - "datasource": "InfluxDB", + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", "fieldConfig": { "defaults": { "custom": {}, - "decimals": 2, - "mappings": [ - { - "id": 0, - "op": "=", - "text": "N/A", - "type": 1, - "value": "null" - } - ], - "nullValueMode": "connected", + "mappings": [], "thresholds": { "mode": "absolute", "steps": [ @@ -2421,319 +3422,167 @@ "value": 80 } ] - }, - "unit": "ms" + } }, "overrides": [] }, + "fill": 2, + "fillGradient": 3, "gridPos": { - "h": 3, - "w": 4, - "x": 20, - "y": 25 + "h": 8, + "w": 12, + "x": 0, + "y": 51 }, - "id": 98, - "interval": null, - "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "mean" - ], - "fields": "", - "values": false - }, - "textMode": "auto" + "hiddenSeries": false, + "id": 30, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null as zero", + "percentage": false, "pluginVersion": "7.1.1", - "repeatIteration": 1597171988605, - "repeatPanelId": 87, - "repeatedByRow": true, - "scopedVars": { - "Measurement": { - "selected": true, - "text": "http_req_blocked", - "value": "http_req_blocked" + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(nodejs_gc_duration_seconds_sum[$granularity])", + "format": "time_series", + "instant": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{kind}}", + "refId": "A" } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "GC rate", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" }, - "targets": [ + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ { - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT percentile(\"value\", 95) FROM $Measurement WHERE $timeFilter ", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [] + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true } ], - "title": "$Measurement (p95)", - "type": "stat" + "yaxis": { + "align": false, + "alignLevel": null + } }, { "aliasColors": {}, - "bars": false, + "bars": true, "dashLength": 10, "dashes": false, - "datasource": "InfluxDB", - "description": "Grouped by 1 sec intervals", + "datasource": "Prometheus", "fieldConfig": { "defaults": { - "custom": {} + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { - "h": 7, + "h": 8, "w": 12, - "x": 0, - "y": 28 + "x": 12, + "y": 51 }, - "height": "250px", "hiddenSeries": false, - "id": 99, - "interval": ">1s", + "id": 33, "legend": { - "alignAsTable": false, - "avg": true, + "avg": false, "current": false, - "hideEmpty": false, "max": false, "min": false, "show": true, "total": false, - "values": true + "values": false }, - "lines": true, + "lines": false, "linewidth": 1, "links": [], - "nullPointMode": "null", + "nullPointMode": "null as zero", "percentage": false, "pluginVersion": "7.1.1", "pointradius": 5, "points": false, "renderer": "flot", - "repeatIteration": 1597171988605, - "repeatPanelId": 89, - "repeatedByRow": true, - "scopedVars": { - "Measurement": { - "selected": true, - "text": "http_req_blocked", - "value": "http_req_blocked" - } - }, "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { - "alias": "max", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "none" - ], - "type": "fill" - } - ], - "measurement": "/^$Measurement$/", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT max(\"value\") FROM /^$Measurement$/ WHERE $timeFilter and value > 0 GROUP BY time($__interval) fill(none)", - "rawQuery": true, - "refId": "C", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "max" - } - ] - ], - "tags": [] - }, - { - "alias": "p95", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "none" - ], - "type": "fill" - } - ], - "measurement": "/^$Measurement$/", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT percentile(\"value\", 95) FROM /^$Measurement$/ WHERE $timeFilter and value > 0 GROUP BY time($__interval) fill(none)", - "rawQuery": true, - "refId": "D", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [ - 95 - ], - "type": "percentile" - } - ] - ], - "tags": [] - }, - { - "alias": "p90", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "none" - ], - "type": "fill" - } - ], - "measurement": "/^$Measurement$/", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT percentile(\"value\", 90) FROM /^$Measurement$/ WHERE $timeFilter and value > 0 GROUP BY time($__interval) fill(none)", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [ - "90" - ], - "type": "percentile" - } - ] - ], - "tags": [] - }, - { - "alias": "min", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "none" - ], - "type": "fill" - } - ], - "measurement": "/^$Measurement$/", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT min(\"value\") FROM /^$Measurement$/ WHERE $timeFilter and value > 0 GROUP BY time($__interval) fill(none)", - "rawQuery": true, - "refId": "E", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "min" - } - ] - ], - "tags": [] + "expr": "histogram_quantile(0.95, sum(rate(nodejs_gc_duration_seconds_bucket[$granularity])) by (le))", + "format": "time_series", + "instant": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{gctype}} {{podname}}", + "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "$Measurement (over time)", + "title": "GC Runs rate", "tooltip": { "shared": true, "sort": 0, @@ -2749,9 +3598,9 @@ }, "yaxes": [ { - "format": "ms", + "format": "short", "label": null, - "logBase": 2, + "logBase": 1, "max": null, "min": null, "show": true @@ -2770,119 +3619,6 @@ "alignLevel": null } }, - { - "cards": { - "cardPadding": null, - "cardRound": null - }, - "color": { - "cardColor": "rgb(0, 234, 255)", - "colorScale": "sqrt", - "colorScheme": "interpolateRdYlGn", - "exponent": 0.5, - "mode": "spectrum" - }, - "dataFormat": "timeseries", - "datasource": "InfluxDB", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 28 - }, - "heatmap": {}, - "height": "250px", - "hideZeroBuckets": false, - "highlightCards": true, - "id": 100, - "interval": ">1s", - "legend": { - "show": false - }, - "links": [], - "repeatIteration": 1597171988605, - "repeatPanelId": 91, - "repeatedByRow": true, - "reverseYBuckets": false, - "scopedVars": { - "Measurement": { - "selected": true, - "text": "http_req_blocked", - "value": "http_req_blocked" - } - }, - "targets": [ - { - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "measurement": "http_req_duration", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT \"value\" FROM $Measurement WHERE $timeFilter and value > 0", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [] - } - ], - "title": "$Measurement (over time)", - "tooltip": { - "show": true, - "showHistogram": true - }, - "tooltipDecimals": null, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketNumber": null, - "xBucketSize": null, - "yAxis": { - "decimals": null, - "format": "ms", - "logBase": 2, - "max": null, - "min": null, - "show": true, - "splitFactor": null - }, - "yBucketBound": "auto", - "yBucketNumber": null, - "yBucketSize": null - }, { "collapsed": false, "datasource": null, @@ -2890,11 +3626,11 @@ "h": 1, "w": 24, "x": 0, - "y": 35 + "y": 59 }, - "id": 26, + "id": 57, "panels": [], - "title": "Memory", + "title": "Module Map", "type": "row" }, { @@ -2903,7 +3639,6 @@ "dashLength": 10, "dashes": false, "datasource": "Prometheus", - "description": "RSS : stands for Resident Set Size, it is the total memory allocated for the process execution\n\nHeapTotal: total size of the allocated heap\n\nHeapUsed: actual memory used during the execution of our process . \n\nExternal: memory used by \"C++ objects bound to JavaScript objects managed by V8\"", "fieldConfig": { "defaults": { "custom": {} @@ -2913,30 +3648,30 @@ "fill": 1, "fillGradient": 0, "gridPos": { - "h": 10, - "w": 24, + "h": 9, + "w": 6, "x": 0, - "y": 36 + "y": 60 }, "hiddenSeries": false, - "id": 28, + "id": 59, "legend": { "alignAsTable": true, - "avg": true, + "avg": false, "current": false, - "max": true, + "max": false, "min": false, - "rightSide": true, "show": true, "total": false, - "values": true + "values": false }, "lines": true, "linewidth": 1, + "links": [], "nullPointMode": "null", "percentage": false, "pluginVersion": "7.1.1", - "pointradius": 2, + "pointradius": 5, "points": false, "renderer": "flot", "seriesOverrides": [], @@ -2945,39 +3680,20 @@ "steppedLine": false, "targets": [ { - "expr": "nodejs_heap_size_total_bytes", + "expr": "increase(oneapp_holocron_module_map_poll_consecutive_errors_total[$granularity])", + "format": "time_series", "instant": false, "interval": "", "intervalFactor": 1, - "legendFormat": "HeapTotal", + "legendFormat": "{{podname}}", "refId": "A" - }, - { - "expr": "nodejs_heap_size_used_bytes", - "hide": false, - "instant": false, - "interval": "", - "legendFormat": "HeapUsed", - "refId": "B" - }, - { - "expr": "process_resident_memory_bytes", - "interval": "", - "legendFormat": "RSS", - "refId": "C" - }, - { - "expr": "nodejs_external_memory_bytes", - "interval": "", - "legendFormat": "External", - "refId": "D" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "Basic Memory Consumption", + "title": "Module Map Load Errors", "tooltip": { "shared": true, "sort": 0, @@ -2993,8 +3709,7 @@ }, "yaxes": [ { - "$$hashKey": "object:502", - "format": "decbytes", + "format": "short", "label": null, "logBase": 1, "max": null, @@ -3002,13 +3717,12 @@ "show": true }, { - "$$hashKey": "object:503", "format": "short", "label": null, "logBase": 1, "max": null, "min": null, - "show": false + "show": true } ], "yaxis": { @@ -3031,70 +3745,59 @@ "fill": 1, "fillGradient": 0, "gridPos": { - "h": 11, - "w": 24, - "x": 0, - "y": 46 + "h": 9, + "w": 6, + "x": 6, + "y": 60 }, "hiddenSeries": false, - "id": 16, + "id": 61, "legend": { "alignAsTable": true, - "avg": true, + "avg": false, "current": false, - "hideEmpty": true, - "hideZero": true, - "max": true, + "hideEmpty": false, + "hideZero": false, + "max": false, "min": false, - "rightSide": true, + "rightSide": false, "show": true, "total": false, - "values": true + "values": false }, "lines": true, "linewidth": 1, + "links": [], "nullPointMode": "null", "percentage": false, "pluginVersion": "7.1.1", - "pointradius": 2, + "pointradius": 5, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "nodejs_heap_space_size_available_bytes", - "instant": false, - "interval": "", - "legendFormat": "Available {{space}}", - "refId": "A" - }, - { - "expr": "nodejs_heap_space_size_used_bytes", - "interval": "", - "legendFormat": "Used heap {{space}}", - "refId": "B" - }, + "stack": false, + "steppedLine": false, + "targets": [ { - "expr": "nodejs_heap_space_size_total_bytes", + "expr": "rate(oneapp_holocron_module_map_poll_total[$granularity])", + "format": "time_series", "interval": "", - "legendFormat": "Total {{space}}", - "refId": "C" + "intervalFactor": 1, + "legendFormat": "{{podname}}", + "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "Used heap details", + "title": "Module Map Poll Rate", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, - "transformations": [], "type": "graph", "xaxis": { "buckets": null, @@ -3105,8 +3808,7 @@ }, "yaxes": [ { - "$$hashKey": "object:404", - "format": "decbytes", + "format": "short", "label": null, "logBase": 1, "max": null, @@ -3114,13 +3816,12 @@ "show": true }, { - "$$hashKey": "object:405", "format": "short", "label": null, "logBase": 1, "max": null, "min": null, - "show": false + "show": true } ], "yaxis": { @@ -3128,263 +3829,6 @@ "alignLevel": null } }, - { - "collapsed": true, - "datasource": null, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 57 - }, - "id": 69, - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "Prometheus", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 9, - "w": 24, - "x": 0, - "y": 38 - }, - "hiddenSeries": false, - "id": 18, - "legend": { - "avg": false, - "current": false, - "hideZero": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "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": [ - { - "expr": "nodejs_eventloop_lag_seconds", - "interval": "", - "legendFormat": "Lag", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Eventloop lag", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:764", - "format": "s", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "$$hashKey": "object:765", - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": false - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "title": "Eventloop", - "type": "row" - }, - { - "collapsed": true, - "datasource": null, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 58 - }, - "id": 67, - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "Prometheus", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 9, - "w": 24, - "x": 0, - "y": 39 - }, - "hiddenSeries": false, - "id": 65, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pluginVersion": "7.1.1", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate(process_cpu_seconds_total[$granularity])*100", - "format": "time_series", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Process CPU", - "refId": "A" - }, - { - "expr": "rate(process_cpu_system_seconds_total[$granularity])", - "format": "time_series", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "System CPU", - "refId": "B" - }, - { - "expr": "rate(process_cpu_user_seconds_total[$granularity])", - "format": "time_series", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "User CPU", - "refId": "C" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "CPU", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:305", - "format": "percent", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "$$hashKey": "object:306", - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "title": "CPU", - "type": "row" - }, - { - "collapsed": false, - "datasource": null, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 59 - }, - "id": 63, - "panels": [], - "title": "GC", - "type": "row" - }, { "aliasColors": {}, "bars": false, @@ -3392,35 +3836,21 @@ "dashes": false, "datasource": "Prometheus", "fieldConfig": { - "defaults": { - "custom": {}, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } + "defaults": { + "custom": {} }, "overrides": [] }, - "fill": 2, - "fillGradient": 3, + "fill": 1, + "fillGradient": 0, "gridPos": { - "h": 8, - "w": 12, - "x": 0, + "h": 9, + "w": 6, + "x": 12, "y": 60 }, "hiddenSeries": false, - "id": 30, + "id": 102, "legend": { "avg": false, "current": false, @@ -3432,7 +3862,7 @@ }, "lines": true, "linewidth": 1, - "nullPointMode": "null as zero", + "nullPointMode": "null", "percentage": false, "pluginVersion": "7.1.1", "pointradius": 2, @@ -3444,12 +3874,9 @@ "steppedLine": false, "targets": [ { - "expr": "rate(nodejs_gc_duration_seconds_sum[$granularity])", - "format": "time_series", - "instant": false, + "expr": "rate(oneapp_holocron_module_map_poll_restarted_total[$granularity])", "interval": "", - "intervalFactor": 1, - "legendFormat": "{{kind}}", + "legendFormat": "", "refId": "A" } ], @@ -3457,7 +3884,7 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "GC rate", + "title": "Module Map Restarts", "tooltip": { "shared": true, "sort": 0, @@ -3496,40 +3923,26 @@ }, { "aliasColors": {}, - "bars": true, + "bars": false, "dashLength": 10, "dashes": false, "datasource": "Prometheus", "fieldConfig": { "defaults": { - "custom": {}, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } + "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { - "h": 8, - "w": 12, - "x": 12, + "h": 9, + "w": 6, + "x": 18, "y": 60 }, "hiddenSeries": false, - "id": 33, + "id": 104, "legend": { "avg": false, "current": false, @@ -3539,13 +3952,12 @@ "total": false, "values": false }, - "lines": false, + "lines": true, "linewidth": 1, - "links": [], - "nullPointMode": "null as zero", + "nullPointMode": "null", "percentage": false, "pluginVersion": "7.1.1", - "pointradius": 5, + "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], @@ -3554,12 +3966,9 @@ "steppedLine": false, "targets": [ { - "expr": "histogram_quantile(0.95, sum(rate(nodejs_gc_duration_seconds_bucket[$granularity])) by (le))", - "format": "time_series", - "instant": false, + "expr": "rate(oneapp_holocron_module_map_updated_total[$granularity])", "interval": "", - "intervalFactor": 1, - "legendFormat": "{{gctype}} {{podname}}", + "legendFormat": "", "refId": "A" } ], @@ -3567,7 +3976,7 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "GC Runs rate", + "title": "Module Map Updated", "tooltip": { "shared": true, "sort": 0, @@ -3604,214 +4013,6 @@ "alignLevel": null } }, - { - "collapsed": true, - "datasource": null, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 68 - }, - "id": 57, - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "Prometheus", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 27 - }, - "hiddenSeries": false, - "id": 59, - "legend": { - "alignAsTable": true, - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pluginVersion": "7.1.1", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "increase(oneapp_holocron_module_map_poll_consecutive_errors_total[$granularity])", - "format": "time_series", - "instant": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{podname}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Module Map Load Errors", - "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": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "Prometheus", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 27 - }, - "hiddenSeries": false, - "id": 61, - "legend": { - "alignAsTable": true, - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pluginVersion": "7.1.1", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate(oneapp_holocron_module_map_poll_total[$granularity])", - "format": "time_series", - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{podname}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Module Map Poll Rate", - "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": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "title": "Module Map", - "type": "row" - }, { "collapsed": true, "datasource": null, @@ -4027,7 +4228,7 @@ { "allValue": null, "current": { - "selected": false, + "selected": true, "text": "2m", "value": "2m" }, @@ -4143,7 +4344,7 @@ ] }, "time": { - "from": "now-1h", + "from": "now-6h", "to": "now" }, "timepicker": { @@ -4162,5 +4363,5 @@ "timezone": "browser", "title": "One App Performance", "uid": "tDGvrq7Mz", - "version": 1 + "version": 3 } \ No newline at end of file diff --git a/__tests__/integration/__snapshots__/one-app.spec.js.snap b/__tests__/integration/__snapshots__/one-app.spec.js.snap index 822bfe4ac..09a89fddd 100644 --- a/__tests__/integration/__snapshots__/one-app.spec.js.snap +++ b/__tests__/integration/__snapshots__/one-app.spec.js.snap @@ -67,8 +67,10 @@ Array [ "nodejs_heap_space_size_used_bytes", "nodejs_version_info", "oneapp_holocron_module_map_poll_consecutive_errors_total", + "oneapp_holocron_module_map_poll_restarted_total", "oneapp_holocron_module_map_poll_total", "oneapp_holocron_module_map_poll_wait_seconds", + "oneapp_holocron_module_map_updated_total", "oneapp_version_info", "process_cpu_seconds_total", "process_cpu_system_seconds_total", diff --git a/__tests__/server/metrics/__snapshots__/holocron.spec.js.snap b/__tests__/server/metrics/__snapshots__/holocron.spec.js.snap index 143905f0d..665bbe8e1 100644 --- a/__tests__/server/metrics/__snapshots__/holocron.spec.js.snap +++ b/__tests__/server/metrics/__snapshots__/holocron.spec.js.snap @@ -32,7 +32,9 @@ Object { "default": Object { "moduleMapPoll": "oneapp_holocron_module_map_poll_total", "moduleMapPollConsecutiveErrors": "oneapp_holocron_module_map_poll_consecutive_errors_total", + "moduleMapPollRestarted": "oneapp_holocron_module_map_poll_restarted_total", "moduleMapPollWait": "oneapp_holocron_module_map_poll_wait_seconds", + "moduleMapUpdated": "oneapp_holocron_module_map_updated_total", }, } `; diff --git a/package.json b/package.json index 327f086eb..a287ac688 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,10 @@ "build:sample-modules": "node scripts/build-sample-modules.js", "start:watch": "node scripts/watch-server.js", "prestart:prod-sample": "npm run build:prod-sample", + "prestart:prod-sample:debug": "npm run build:prod-sample", "start:prod-sample": "docker-compose -f ./prod-sample/docker-compose.yml up --abort-on-container-exit", + "start:prod-sample:debug": "docker-compose -f ./prod-sample/docker-compose.yml -f ./prod-sample/docker-compose.debug.yml up --abort-on-container-exit", + "monitor:performance": "docker-compose -f ./__performance__/docker-compose.yml up --abort-on-container-exit influxdb grafana prometheus", "test:lockfile": "lockfile-lint -p package-lock.json -t npm -a npm -o https: -c -i", "test:lint": "eslint --ext js,jsx,md,snap .", "start": "node lib/server/index.js", diff --git a/prod-sample/README.md b/prod-sample/README.md index 31b8adf88..0df93db95 100644 --- a/prod-sample/README.md +++ b/prod-sample/README.md @@ -33,6 +33,8 @@ On Mac OS, you can do so natively: Click connect and a window will appear with Google Chrome open. This is where you can access One App at `https://one-app:8443`! +If you wish to run with node debug mode: `npm run start:prod-sample:debug`. + ### Options The entire setup invoked by `npm run start:prod-sample` can take ~10 minutes and is often unnecessary diff --git a/prod-sample/docker-compose.debug.yml b/prod-sample/docker-compose.debug.yml new file mode 100644 index 000000000..563e7d07b --- /dev/null +++ b/prod-sample/docker-compose.debug.yml @@ -0,0 +1,10 @@ +version: '3' + +services: + one-app: + ports: + - "3000:3000" + # node inspector + - "9229:9229" + env_file: ./one-app/debug.env + entrypoint: sh -c 'sleep 2s && node --inspect=0.0.0.0 lib/server' \ No newline at end of file diff --git a/prod-sample/docker-compose.override.yml b/prod-sample/docker-compose.override.yml new file mode 100644 index 000000000..4fa59f20d --- /dev/null +++ b/prod-sample/docker-compose.override.yml @@ -0,0 +1,6 @@ +version: '3' + +services: + one-app: + env_file: ./one-app/base.env + entrypoint: sh -c 'sleep 2s && node lib/server' \ No newline at end of file diff --git a/prod-sample/docker-compose.yml b/prod-sample/docker-compose.yml index c4dbc2d1d..36ef68192 100644 --- a/prod-sample/docker-compose.yml +++ b/prod-sample/docker-compose.yml @@ -1,5 +1,4 @@ version: '3' - networks: one-app-at-test-network: services: @@ -10,27 +9,26 @@ services: - http_proxy - https_proxy - no_proxy - # tags the built image as: - image: one-app:at-test + image: 'one-app:at-test' expose: - - "8443" - - "3005" + - '8443' + - '3005' ports: - - "3005:3005" + - '8443:8443' + - '3005:3005' volumes: - - ./one-app/one-app-cert.pem:/opt/cert.pem - - ./one-app/one-app-privkey.pem:/opt/key.pem - - ./nginx/nginx-cert.pem:/opt/nginx-cert.pem - - ./extra-certs.pem:/opt/extra-certs.pem - env_file: - - ./one-app/base.env + - './one-app/one-app-cert.pem:/opt/cert.pem' + - './one-app/one-app-privkey.pem:/opt/key.pem' + - './nginx/nginx-cert.pem:/opt/nginx-cert.pem' + - './extra-certs.pem:/opt/extra-certs.pem' networks: one-app-at-test-network: depends_on: - - "fast-api" - - "slow-api" - - "extra-slow-api" - - "nginx" + - fast-api + - slow-api + - extra-slow-api + - nginx + env_file: ./one-app/base.env entrypoint: sh -c 'sleep 2s && node lib/server' fast-api: build: @@ -40,7 +38,7 @@ services: - https_proxy - no_proxy ports: - - "8000:80" + - '8000:80' networks: one-app-at-test-network: aliases: @@ -53,12 +51,12 @@ services: - https_proxy - no_proxy ports: - - "8001:80" + - '8001:80' entrypoint: - - "npm" - - "start" - - "--" - - "3000" + - npm + - start + - '--' + - '3000' networks: one-app-at-test-network: aliases: @@ -71,23 +69,23 @@ services: - https_proxy - no_proxy ports: - - "8002:80" + - '8002:80' entrypoint: - - "npm" - - "start" - - "--" - - "8000" + - npm + - start + - '--' + - '8000' networks: one-app-at-test-network: aliases: - extra-slow.api.frank nginx: - image: nginx:1.17.5-alpine + image: 'nginx:1.17.5-alpine' volumes: - - ./nginx/default.conf:/etc/nginx/conf.d/default.conf - - ./nginx/nginx-cert.pem:/etc/ssl/nginx-cert.pem - - ./nginx/nginx-privkey.pem:/etc/ssl/nginx-privkey.pem - - ./nginx/origin-statics:/usr/share/nginx/html + - './nginx/default.conf:/etc/nginx/conf.d/default.conf' + - './nginx/nginx-cert.pem:/etc/ssl/nginx-cert.pem' + - './nginx/nginx-privkey.pem:/etc/ssl/nginx-privkey.pem' + - './nginx/origin-statics:/usr/share/nginx/html' networks: one-app-at-test-network: aliases: diff --git a/prod-sample/one-app/debug.env b/prod-sample/one-app/debug.env new file mode 100644 index 000000000..7470a9fa2 --- /dev/null +++ b/prod-sample/one-app/debug.env @@ -0,0 +1,18 @@ +HOLOCRON_MODULE_MAP_URL=https://sample-cdn.frank/module-map.json +ONE_CLIENT_REPORTING_URL=http://one-app:8443/_/report/errors +ONE_CLIENT_CSP_REPORTING_URL=http://one-app:8443/_/report/security/csp-violation +ONE_CLIENT_ROOT_MODULE_NAME=frank-lloyd-root +NODE_ENV=production +ONE_CLIENT_CDN_URL=https://sample-cdn.frank/ +HTTPS_PRIVATE_KEY_PATH=/opt/key.pem +HTTPS_PUBLIC_CERT_CHAIN_PATH=/opt/cert.pem +NODE_EXTRA_CA_CERTS=/opt/extra-certs.pem +ONE_CONFIG_ENV=development + +# reducing wait for module map updates to minimum for integration tests +ONE_MAP_POLLING_MAX=6 + +ONE_ENABLE_POST_TO_MODULE_ROUTES=true + +# feature flags: +ONE_SERVICE_WORKER=true diff --git a/src/server/metrics/holocron.js b/src/server/metrics/holocron.js index 1cd635ada..f9156e9af 100644 --- a/src/server/metrics/holocron.js +++ b/src/server/metrics/holocron.js @@ -26,6 +26,16 @@ createCounter({ help: 'total times the module map has been polled', }); +createCounter({ + name: holocronNamespace('module_map_updated', 'total'), + help: 'total times the module map has been updated', +}); + +createCounter({ + name: holocronNamespace('module_map_poll_restarted', 'total'), + help: 'total times the module map poll has been restarted', +}); + createGauge({ name: holocronNamespace('module_map_poll_wait', 'seconds'), help: 'delay until the next poll of the module map', diff --git a/src/server/middleware/sendHtml.js b/src/server/middleware/sendHtml.js index a574a0906..e223c8873 100644 --- a/src/server/middleware/sendHtml.js +++ b/src/server/middleware/sendHtml.js @@ -37,7 +37,7 @@ const legacyIndicators = [ 'MSIE', // IE ]; -const legacyUserAgent = (userAgent) => legacyIndicators +const legacyUserAgent = (userAgent) => userAgent && legacyIndicators .some((legacyIndicator) => userAgent.includes(legacyIndicator)); function getChunkAssets(assetsByChunkName) { return Object diff --git a/src/server/utils/pollModuleMap.js b/src/server/utils/pollModuleMap.js index b101aa843..fa28227a6 100644 --- a/src/server/utils/pollModuleMap.js +++ b/src/server/utils/pollModuleMap.js @@ -81,6 +81,7 @@ const setTimeoutWithoutBlockingStopping = setLaterWithoutBlockingStopping(setTim // used by the polling monitor let lastPollingRecordedAt; +let lastPollTimeout; function recordPollingForMonitor() { lastPollingRecordedAt = Date.now(); @@ -104,12 +105,16 @@ let startPollingMonitorIfNotAlready = () => { console.warn( `pollModuleMap: polling has unexpectedly stopped. Last poll: ${lastPollingTimeAgo}ms ago, Max poll: ${MAX_POLL_TIME}ms.` ); + // something really unusual happened, re-start polling - // first, make sure polling happens again + // ensure that the last timeout has actually stopped + clearTimeout(lastPollTimeout); + // make sure polling happens again // need the reference to use it, one needs to be defined first setImmediate(pollModuleMap); // eslint-disable-line no-use-before-define // log the restart console.warn('pollModuleMap: restarted polling'); + incrementCounter(holocronMetrics.moduleMapPollRestarted); // try to reset the next scheduled polling time to the minimum // should work, but if it doesn't we still want polling to occur // so schedule the polling restart first (above), then reset the time later (here) @@ -123,6 +128,9 @@ let startPollingMonitorIfNotAlready = () => { }; async function pollModuleMap() { + // record module map poll first to reduce risk that polling monitor + // triggers additional poll during current poll. + recordPollingForMonitor(); startPollingMonitorIfNotAlready(); let modulesUsingExternalsBeforeUpdate; let configBeforeUpdate; @@ -132,7 +140,6 @@ async function pollModuleMap() { modulesUsingExternalsBeforeUpdate = getModulesUsingExternals(); console.log('pollModuleMap: polling...'); incrementCounter(holocronMetrics.moduleMapPoll); - recordPollingForMonitor(); const modulesLoaded = await loadModules(); @@ -144,6 +151,7 @@ async function pollModuleMap() { `pollModuleMap: ${numberOfModulesLoaded} modules loaded/updated:`, modulesLoaded ); + incrementCounter(holocronMetrics.moduleMapUpdated); resetPollTime(); } else { incrementPollTime(); @@ -165,7 +173,7 @@ async function pollModuleMap() { currentPollTime = MIN_POLL_TIME; } } finally { - setTimeoutWithoutBlockingStopping(pollModuleMap, currentPollTime); + lastPollTimeout = setTimeoutWithoutBlockingStopping(pollModuleMap, currentPollTime); } }