diff --git a/examples/grafana/README.md b/examples/grafana/README.md index a398f2b4..f04d325c 100644 --- a/examples/grafana/README.md +++ b/examples/grafana/README.md @@ -1,57 +1,44 @@ # Grafana Dashboard -The `NGINX Mesh Top` Grafana dashboard provides a high-level picture -of the request volume and success rate of all your applications in the mesh. -NGINX Service Mesh deploys Grafana and adds `NGINX Mesh Top` as the -default dashboard. If you prefer to use an existing Grafana deployment, you can import -the `NGINX Mesh Top` dashboard included in this directory. +Two Grafana dashboards have been included as examples for use in your environment: +- NGINX Mesh Top +- NGINX Service Mesh Summary + +Both Grafana dashboards provide a high-level picture of the request volume and success rate of all your applications in the mesh, and each have been included to provide two different references for consuming and rendering NGINX Service Mesh metrics data. + +NGINX Service Mesh deploys Grafana and adds `NGINX Mesh Top` as the default dashboard. If you prefer to use an existing Grafana deployment, you can import either or both example dashboards included in this directory. ## Prerequisties - Grafana version >= 5.2.0 -- Prometheus datasource must be - [configured](https://prometheus.io/docs/visualization/grafana/#creating-a-prometheus-data-source). +- Prometheus datasource must be [configured](https://prometheus.io/docs/visualization/grafana/#creating-a-prometheus-data-source). - **Note:** If you are using the Prometheus server deployed by NGINX Service Mesh you can - find the address by running [`nginx-meshctl - config`](https://docs.nginx.com/nginx-service-mesh/reference/nginx-meshctl/#usage). - If you are using your own Prometheus server, make sure to add the NGINX - Service Mesh [scrape config](../prometheus/README.md) to your - Prometheus configuration. - + **Note:** If you are using the Prometheus server deployed by NGINX Service Mesh you can find the address by running [`nginx-meshctl config`](https://docs.nginx.com/nginx-service-mesh/reference/nginx-meshctl/#usage). + If you are using your own Prometheus server, make sure to add the NGINX Service Mesh [scrape config](../prometheus/README.md) to your Prometheus configuration. -## Installing the NGINX Mesh Top Dashboard +## Installing Example Dashboards -To install the NGINX Mesh Top Dashboard using the Grafana UI follow these steps: +To install an example dashboard using the Grafana UI follow these steps: - Select the New Dashboard button and click Import. -- Upload the [nginx-mesh-top.json](nginx-mesh-top.json) file or copy and paste the contents of the file in the textbox and click Load. -- Select the Prometheus data source you configured previously from the dropdown - menu and click Import. +- Upload the dashboard JSON, ex: [nginx-mesh-top.json](nginx-mesh-top.json), file or copy and paste the contents of the file in the textbox and click Load. +- Select the Prometheus data source you configured previously from the dropdown menu and click Import. ![nginx-mesh-top](dashboard.png) ### Features -NGINX Mesh Top dashboard includes the following stats and graphs: +The default NGINX Mesh Top dashboard includes the following stats and graphs: - Stats: - - Global Success Rate: the percentage of requests that are successful over - the last 30 seconds (`nginxplus_upstream_server_responses` with response codes of `1xx` or `2xx`). - - Global Request Volume: the volume of requests over the last 30 seconds, - measured in requests per second (`nginxplus_http_total_requests`) . + - Global Success Rate: the percentage of requests that are successful over the last 30 seconds (`nginxplus_upstream_server_responses` with response codes of `1xx` or `2xx`). + - Global Request Volume: the volume of requests over the last 30 seconds, measured in requests per second (`nginxplus_http_total_requests`) . - Pods Monitored: The number of pods being scraped by Prometheus. - Graphs: - - Request Volume: this graph shows the volume of requests per Pod, in - requests per second (`nginxplus_http_total_requests`). - - Pod Success: this graph shows the percentage of requests that are - successful per Pod (`nginxplus_upstream_server_responses` with response codes of - `1xx` or `2xx`). + - Request Volume: this graph shows the volume of requests per Pod, in requests per second (`nginxplus_http_total_requests`). + - Pod Success: this graph shows the percentage of requests that are successful per Pod (`nginxplus_upstream_server_responses` with response codes of `1xx` or `2xx`). - Sidecar Memory Usage (RSS): this graph shows the Resident Set Size (RSS) of the NSM sidecars. - Sidecar Memory Usage (Private): this graph shows the Private memory used by the NSM sidecars. ## Customizing your own Dashboard -NGINX Service Mesh exposes NGINX Plus metrics in Prometheus format that can be used to -create your own panels and custom dashboards. For a list of available metrics, labels, -and example Prometheus queries, see the [Traffic Metrics -guide](https://docs.nginx.com/nginx-service-mesh/guides/traffic-metrics/). +NGINX Service Mesh exposes NGINX Plus metrics in Prometheus format that can be used to create your own panels and custom dashboards. For a list of available metrics, labels, and example Prometheus queries, see the [Traffic Metrics guide](https://docs.nginx.com/nginx-service-mesh/guides/traffic-metrics/). diff --git a/examples/grafana/nginx-service-mesh-summary.json b/examples/grafana/nginx-service-mesh-summary.json new file mode 100644 index 00000000..705b97cc --- /dev/null +++ b/examples/grafana/nginx-service-mesh-summary.json @@ -0,0 +1,592 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 4, + "iteration": 1611968770327, + "links": [], + "panels": [ + { + "collapsed": false, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 14, + "panels": [], + "title": "Global", + "type": "row" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 24, + "x": 0, + "y": 1 + }, + "id": 12, + "options": { + "content": "
\nGlobal View\n
", + "mode": "html" + }, + "pluginVersion": "7.1.0", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "text" + }, + { + "datasource": "$datasource", + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [ + { + "from": "", + "id": 0, + "text": "N/A", + "to": "", + "type": 1, + "value": "null" + } + ], + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + }, + { + "color": "dark-red", + "value": 89 + }, + { + "color": "rgb(242, 154, 54)", + "value": 90 + }, + { + "color": "rgb(255, 242, 0)", + "value": 95 + }, + { + "color": "rgb(0, 150, 57)", + "value": 99.99999 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 9, + "x": 0, + "y": 3 + }, + "id": 2, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "expr": "sum(irate(nginxplus_upstream_server_responses{code=~\"1xx|2xx\"}[30s])) / sum(irate(nginxplus_upstream_server_responses[30s]))", + "interval": "5s", + "legendFormat": "", + "refId": "A" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Global Sucess Rate", + "type": "stat" + }, + { + "datasource": "$datasource", + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [ + { + "from": "", + "id": 0, + "text": "N/A", + "to": "", + "type": 1, + "value": "null" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + }, + { + "color": "rgb(0, 150, 57)", + "value": 1 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 9, + "y": 3 + }, + "id": 6, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "expr": "count(nginxplus_http_requests_total)", + "interval": "5s", + "legendFormat": "", + "refId": "A" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Pods Monitored", + "type": "stat" + }, + { + "datasource": "$datasource", + "fieldConfig": { + "defaults": { + "custom": { + "align": null + }, + "mappings": [ + { + "from": "", + "id": 0, + "text": "N/A", + "to": "", + "type": 1, + "value": "null" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + }, + { + "color": "rgb(228, 0, 43)", + "value": 0 + }, + { + "color": "rgb(0, 150, 57)", + "value": 0.01 + } + ] + }, + "unit": "reqps" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 9, + "x": 15, + "y": 3 + }, + "id": 4, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "expr": "sum(irate(nginxplus_http_requests_total[30s]))", + "interval": "5s", + "legendFormat": "", + "refId": "A" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Global Request Volume", + "type": "stat" + }, + { + "collapsed": false, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 9 + }, + "id": 17, + "panels": [], + "title": "Workloads", + "type": "row" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 24, + "x": 0, + "y": 10 + }, + "id": 15, + "options": { + "content": "
\nWorkload View\n
", + "mode": "html" + }, + "pluginVersion": "7.1.0", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "text" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fieldConfig": { + "defaults": { + "custom": { + "align": null + }, + "mappings": [ + { + "from": "", + "id": 0, + "text": "N/A", + "to": "", + "type": 1, + "value": "null" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 3, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 12 + }, + "hiddenSeries": false, + "id": 8, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.5", + "pointradius": 2, + "points": true, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(nginxplus_http_requests_total[30s])", + "interval": "", + "legendFormat": "App: {{app}} Ver: {{version}} NS: {{namespace}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Request Volume", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:388", + "format": "reqps", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "$$hashKey": "object:389", + "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": "$datasource", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 2, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 12 + }, + "hiddenSeries": false, + "id": 10, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sideWidth": null, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.5", + "pointradius": 2, + "points": true, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "expr": "sum(irate(nginxplus_upstream_server_responses{code=~\"1xx|2xx\"}[30s])) by (app, version) / sum(irate(nginxplus_upstream_server_responses[30s])) by (app, version)", + "interval": "", + "legendFormat": "App: {{app}} Ver: {{version}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Pod Success", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:495", + "format": "percentunit", + "label": null, + "logBase": 1, + "max": "1", + "min": "0", + "show": true + }, + { + "$$hashKey": "object:496", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": "5s", + "schemaVersion": 26, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": true, + "text": [ + "prometheus" + ], + "value": [ + "prometheus" + ] + }, + "hide": 0, + "includeAll": true, + "label": "Datasource", + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + } + ] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "NGINX Service Mesh Dashboard", + "uid": "jeEbxdLMk", + "version": 15 +}