{
    "name": "Nginx",
    "tags": "",
    "ident": "",
    "configs": {
        "version": "3.0.0",
        "links": [],
        "var": [
            {
                "name": "datasource",
                "type": "datasource",
                "definition": "prometheus"
            },
            {
                "name": "Instance",
                "type": "query",
                "datasource": {
                    "cate": "prometheus",
                    "value": "${datasource}"
                },
                "definition": "label_values(nginx_vts_server_bytes_total, instance)",
                "reg": "",
                "multi": false
            },
            {
                "name": "Host",
                "type": "query",
                "datasource": {
                    "cate": "prometheus",
                    "value": "${datasource}"
                },
                "definition": "label_values(nginx_vts_server_bytes_total{instance=~\"$Instance\"}, host)",
                "reg": "",
                "multi": false
            },
            {
                "name": "Upstream",
                "type": "query",
                "datasource": {
                    "cate": "prometheus",
                    "value": "${datasource}"
                },
                "definition": "label_values(nginx_vts_upstream_bytes_total{instance=~\"$Instance\"}, upstream)",
                "reg": "",
                "multi": true,
                "allOption": true
            }
        ],
        "panels": [
            {
                "type": "row",
                "id": "77d90dad-9293-440d-8824-0cc3d3e49c72",
                "name": "Instance",
                "collapsed": true,
                "layout": {
                    "h": 1,
                    "w": 24,
                    "x": 0,
                    "y": 0,
                    "i": "77d90dad-9293-440d-8824-0cc3d3e49c72",
                    "isResizable": false
                },
                "panels": []
            },
            {
                "type": "timeseries",
                "id": "819545d5-08c6-4ce7-9312-1d361b7c0128",
                "layout": {
                    "h": 8,
                    "w": 12,
                    "x": 0,
                    "y": 1,
                    "i": "819545d5-08c6-4ce7-9312-1d361b7c0128",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "B",
                        "expr": "sum(nginx_vts_main_connections{instance=~\"$Instance\",status=~\"active|writing|reading|waiting\"}) by (status)",
                        "legend": "{{status}}"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Server Connections",
                "links": [],
                "description": "",
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "standardOptions": {},
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "linear",
                    "spanNulls": false,
                    "lineWidth": 1,
                    "fillOpacity": 0.5,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "type": "timeseries",
                "id": "b694fbf5-d2c1-4109-91ed-ff9f853e2396",
                "layout": {
                    "h": 8,
                    "w": 12,
                    "x": 12,
                    "y": 1,
                    "i": "b694fbf5-d2c1-4109-91ed-ff9f853e2396",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum(rate(nginx_vts_server_requests_total{instance=~\"$Instance\", code!=\"total\"}[1m])) by (code)",
                        "legend": "{{ code }}"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Server Requests",
                "links": [],
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "standardOptions": {
                        "util": "none",
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "linear",
                    "spanNulls": false,
                    "lineWidth": 1,
                    "fillOpacity": 0.5,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "type": "row",
                "id": "b50cc9b0-3087-4baa-b2a6-a67da0220423",
                "name": "Host",
                "collapsed": true,
                "layout": {
                    "h": 1,
                    "w": 24,
                    "x": 0,
                    "y": 9,
                    "i": "b50cc9b0-3087-4baa-b2a6-a67da0220423",
                    "isResizable": false
                },
                "panels": []
            },
            {
                "type": "timeseries",
                "id": "5155b7c9-6158-450a-a42e-682f381ec985",
                "layout": {
                    "h": 8,
                    "w": 12,
                    "x": 0,
                    "y": 10,
                    "i": "5155b7c9-6158-450a-a42e-682f381ec985",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum(irate(nginx_vts_server_bytes_total{instance=~\"$Instance\", host=\"$Host\"}[1m])) by (direction)",
                        "legend": "{{ direction }}"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Server Bytes",
                "links": [],
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "standardOptions": {
                        "util": "bytesSI"
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "linear",
                    "spanNulls": false,
                    "lineWidth": 1,
                    "fillOpacity": 0.5,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "type": "timeseries",
                "id": "daef639a-c4cf-4ee8-9593-dc6ffc1dd0dc",
                "layout": {
                    "h": 8,
                    "w": 12,
                    "x": 12,
                    "y": 10,
                    "i": "daef639a-c4cf-4ee8-9593-dc6ffc1dd0dc",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum(irate(nginx_vts_server_cache_total{instance=~\"$Instance\", host=\"$Host\"}[5m])) by (status)",
                        "legend": "{{ status }}"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Server Cache",
                "links": [],
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "standardOptions": {},
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "linear",
                    "spanNulls": false,
                    "lineWidth": 1,
                    "fillOpacity": 0.5,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "type": "timeseries",
                "id": "48e1c98d-387c-478e-86e8-69a75cf38d30",
                "layout": {
                    "h": 8,
                    "w": 12,
                    "x": 0,
                    "y": 18,
                    "i": "1eff4859-e558-440f-b7f5-b51e9f45cb23",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum(increase(nginx_vts_server_bytes_total{instance=~\"$Instance\", host=\"$Host\"}[1m])) by (direction)",
                        "legend": "{{ direction }}"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Server Network Usage",
                "links": [],
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "standardOptions": {
                        "decimals": 1
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "linear",
                    "spanNulls": false,
                    "lineWidth": 1,
                    "fillOpacity": 0.5,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "type": "timeseries",
                "id": "71209f6e-5f6f-4f39-9365-a29c11bb8040",
                "layout": {
                    "h": 8,
                    "w": 12,
                    "x": 12,
                    "y": 18,
                    "i": "8cd2ff43-2b35-4ed3-bc8b-1498e746e6fe",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum(rate(nginx_vts_server_requests_total{instance=~\"$Instance\", host=\"*\"}[1m])) by (code)",
                        "legend": ""
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "QPS",
                "links": [],
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "standardOptions": {
                        "util": "none",
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "linear",
                    "spanNulls": false,
                    "lineWidth": 1,
                    "fillOpacity": 0.5,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "type": "row",
                "id": "340259ea-3fe1-4edd-81ba-503013e13b67",
                "name": "Upstream",
                "collapsed": true,
                "layout": {
                    "h": 1,
                    "w": 24,
                    "x": 0,
                    "y": 26,
                    "i": "340259ea-3fe1-4edd-81ba-503013e13b67",
                    "isResizable": false
                },
                "panels": []
            },
            {
                "type": "timeseries",
                "id": "164611fe-4ddf-4d39-88f0-d7829a278a9a",
                "layout": {
                    "h": 8,
                    "w": 12,
                    "x": 0,
                    "y": 27,
                    "i": "164611fe-4ddf-4d39-88f0-d7829a278a9a",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum(rate(nginx_vts_upstream_bytes_total{instance=~\"$Instance\", upstream=~\"^$Upstream$\"}[5m])) by (direction)",
                        "legend": "{{ direction }}"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Upstream Bytes",
                "links": [],
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "standardOptions": {},
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "linear",
                    "spanNulls": false,
                    "lineWidth": 1,
                    "fillOpacity": 0.5,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "type": "timeseries",
                "id": "b885d95c-1704-448b-8c5b-35b6a3eba4ee",
                "layout": {
                    "h": 8,
                    "w": 12,
                    "x": 12,
                    "y": 27,
                    "i": "b885d95c-1704-448b-8c5b-35b6a3eba4ee",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum(increase(nginx_vts_upstream_requests_total{instance=~\"$Instance\", upstream=~\"^$Upstream$\",code!=\"total\"}[1m])) by (code)",
                        "legend": "{{ code }}"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Upstream Requests",
                "links": [],
                "description": "This one is providing aggregated error codes, but it's still possible to graph these per upstream.",
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "standardOptions": {},
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "linear",
                    "spanNulls": false,
                    "lineWidth": 1,
                    "fillOpacity": 0.5,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "type": "timeseries",
                "id": "0552ca57-ca56-4300-ab99-3dc16b0ac5e2",
                "layout": {
                    "h": 8,
                    "w": 12,
                    "x": 0,
                    "y": 35,
                    "i": "0552ca57-ca56-4300-ab99-3dc16b0ac5e2",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum(increase(nginx_vts_upstream_bytes_total{instance=~\"$Instance\", upstream=~\"^$Upstream$\"}[1h])) by (direction)",
                        "legend": "{{ direction }}"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Upstream Network Usage Hourly",
                "links": [],
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "standardOptions": {},
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "linear",
                    "spanNulls": false,
                    "lineWidth": 1,
                    "fillOpacity": 0.5,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "type": "timeseries",
                "id": "47f4f573-f2c8-467f-9d82-b7e23a0061a3",
                "layout": {
                    "h": 8,
                    "w": 12,
                    "x": 12,
                    "y": 35,
                    "i": "47f4f573-f2c8-467f-9d82-b7e23a0061a3",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum(nginx_vts_upstream_request_seconds_total{instance=~\"$Instance\", upstream=~\"^$Upstream$\"}) by (backend)",
                        "legend": "{{ backend }}"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Upstream Backend Response",
                "links": [],
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "standardOptions": {
                        "util": "milliseconds"
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "linear",
                    "spanNulls": false,
                    "lineWidth": 1,
                    "fillOpacity": 0.5,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "datasourceValue": "${datasource}"
            }
        ],
        "datasourceValue": "ztcloud-dg"
    }
}