Skip to content

Commit

Permalink
Dashboard response codes grouping (#684)
Browse files Browse the repository at this point in the history
* Group by response code in app developer dashboard

* Group errors on PE dashboard by response code instead of 4xx/5xx
  • Loading branch information
david-martin authored Jun 5, 2024
1 parent 6823ed0 commit ec5351d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 123 deletions.
40 changes: 8 additions & 32 deletions examples/dashboards/app_developer.json
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@
"type": "prometheus",
"uid": "${datasource}"
},
"description": "Requests per second, broken down by success (2xx,3xx) and error (4xx,5xx)",
"description": "Requests per second, broken down by response code e.g. 200, 302, 403, 500",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -509,26 +509,14 @@
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(rate(istio_requests_total{response_code=~\"4.*|5.*\",destination_service_name=~\"$api\"}[5m])) by (destination_service_name) * on(destination_service_name) group_right() (group without(cluster_id, instance, app_kubernetes_io_instance) (label_replace(gatewayapi_httproute_labels{deployment=~\"$api\"}, \"destination_service_name\", \"$1\",\"service\", \"(.+)\")))",
"expr": "sum(rate(istio_requests_total{destination_service_name=~\"$api\"}[5m])) by (destination_service_name, response_code) * on(destination_service_name) group_left(name) (group without(cluster_id, instance, app_kubernetes_io_instance) (label_replace(gatewayapi_httproute_labels{deployment=~\"$api\"}, \"destination_service_name\", \"$1\",\"service\", \"(.+)\")))",
"hide": false,
"legendFormat": "error (4xx,5xx)",
"legendFormat": "{{response_code}}",
"range": true,
"refId": "B"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(rate(istio_requests_total{response_code=~\"2.*|3.*\",destination_service_name=~\"$api\"}[5m])) by (destination_service_name) * on(destination_service_name) group_right() (group without(cluster_id, instance, app_kubernetes_io_instance) (label_replace(gatewayapi_httproute_labels{deployment=~\"$api\"}, \"destination_service_name\", \"$1\",\"service\", \"(.+)\")))",
"hide": false,
"legendFormat": "success (2xx,3xx)",
"range": true,
"refId": "C"
}
],
"title": "request breakdown (req/s)",
"title": "request breakdown by code (req/s)",
"type": "timeseries"
},
{
Expand Down Expand Up @@ -1308,7 +1296,7 @@
"type": "prometheus",
"uid": "${datasource}"
},
"description": "Requests per second, broken down by success (2xx,3xx) and error (4xx,5xx)",
"description": "Requests per second, broken down by response code e.g. 200, 302, 403, 500",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -1443,26 +1431,14 @@
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(rate(istio_requests_total{response_code=~\"4.*|5.*\",destination_service_name=~\"$api\"}[5m])) by (cluster_id, destination_service_name) * on(cluster_id, destination_service_name) group_right() (group without(instance, app_kubernetes_io_instance) (label_replace(gatewayapi_httproute_labels{deployment=~\"$api\"}, \"destination_service_name\", \"$1\",\"service\", \"(.+)\")))",
"expr": "sum(rate(istio_requests_total{destination_service_name=~\"$api\"}[5m])) by (cluster_id, destination_service_name, response_code) * on(cluster_id, destination_service_name) group_left(name) (group without(instance, app_kubernetes_io_instance) (label_replace(gatewayapi_httproute_labels{deployment=~\"$api\"}, \"destination_service_name\", \"$1\",\"service\", \"(.+)\")))",
"hide": false,
"legendFormat": "\"{{cluster_id}}\" error (4xx,5xx)",
"legendFormat": "\"{{cluster_id}}\" {{response_code}}",
"range": true,
"refId": "B"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(rate(istio_requests_total{response_code=~\"2.*|3.*\",destination_service_name=~\"$api\"}[5m])) by (cluster_id, destination_service_name) * on(cluster_id, destination_service_name) group_right() (group without(instance, app_kubernetes_io_instance) (label_replace(gatewayapi_httproute_labels{deployment=~\"$api\"}, \"destination_service_name\", \"$1\",\"service\", \"(.+)\")))",
"hide": false,
"legendFormat": "\"{{cluster_id}}\" success (2xx,3xx)",
"range": true,
"refId": "C"
}
],
"title": "request breakdown by cluster (req/s)",
"title": "request breakdown by cluster and code (req/s)",
"type": "timeseries"
},
{
Expand Down
100 changes: 9 additions & 91 deletions examples/dashboards/platform_engineer.json
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,7 @@
"type": "prometheus",
"uid": "${datasource}"
},
"description": "Rate of 4xx, 5xx and total HTTP response code errors by API/HTTPRoute",
"description": "Rate of 4xx & 5xx response codes and total HTTP response code errors by API/HTTPRoute",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -1403,8 +1403,8 @@
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(rate(istio_requests_total{response_code=~\"4.*|5.*\"}[5m])) by (destination_service_name) * on(destination_service_name) group_right() (group without(cluster_id, instance, app_kubernetes_io_instance) (label_replace(gatewayapi_httproute_labels{exported_namespace=~\"${api_policy_namespace}\"}, \"destination_service_name\", \"$1\",\"service\", \"(.+)\")))",
"legendFormat": "Total Errors: {{name}} ",
"expr": "sum(rate(istio_requests_total{response_code=~\"4.*|5.*\"}[5m])) by (destination_service_name, response_code) * on(destination_service_name) group_left(name) (group without(cluster_id, instance, app_kubernetes_io_instance) (label_replace(gatewayapi_httproute_labels{exported_namespace=~\"${api_policy_namespace}\"}, \"destination_service_name\", \"$1\",\"service\", \"(.+)\")))",
"legendFormat": "{{name}} - {{response_code}}",
"range": true,
"refId": "A"
},
Expand All @@ -1414,95 +1414,11 @@
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(rate(istio_requests_total{response_code=~\"4.*\"}[5m])) by (destination_service_name) * on(destination_service_name) group_right() (group without(cluster_id, instance, app_kubernetes_io_instance) (label_replace(gatewayapi_httproute_labels{exported_namespace=~\"${api_policy_namespace}\"}, \"destination_service_name\", \"$1\",\"service\", \"(.+)\")))",
"expr": "sum(rate(istio_requests_total{response_code=~\"4.*|5.*\"}[5m])) by (destination_service_name) * on(destination_service_name) group_left(name) (group without(cluster_id, instance, app_kubernetes_io_instance) (label_replace(gatewayapi_httproute_labels{exported_namespace=~\"${api_policy_namespace}\"}, \"destination_service_name\", \"$1\",\"service\", \"(.+)\")))",
"hide": false,
"legendFormat": "4xx: {{name}} ",
"legendFormat": "{{name}} - Total Errors",
"range": true,
"refId": "B"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(rate(istio_requests_total{response_code=~\"5.*\"}[5m])) by (destination_service_name) * on(destination_service_name) group_right() (group without(cluster_id, instance, app_kubernetes_io_instance) (label_replace(gatewayapi_httproute_labels{exported_namespace=~\"${api_policy_namespace}\"}, \"destination_service_name\", \"$1\",\"service\", \"(.+)\")))",
"hide": false,
"legendFormat": "5xx: {{name}} ",
"range": true,
"refId": "C"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(rate(istio_requests_total{response_code=~\"404\"}[5m])) by (destination_service_name) * on(destination_service_name) group_right() (group without(cluster_id, instance, app_kubernetes_io_instance) (label_replace(gatewayapi_httproute_labels{exported_namespace=~\"${api_policy_namespace}\"}, \"destination_service_name\", \"$1\",\"service\", \"(.+)\")))",
"hide": false,
"legendFormat": "404: {{name}}",
"range": true,
"refId": "D"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(rate(istio_requests_total{response_code=~\"401\"}[5m])) by (destination_service_name) * on(destination_service_name) group_right() (group without(cluster_id, instance, app_kubernetes_io_instance) (label_replace(gatewayapi_httproute_labels{exported_namespace=~\"${api_policy_namespace}\"}, \"destination_service_name\", \"$1\",\"service\", \"(.+)\")))",
"hide": false,
"legendFormat": "401: {{name}}",
"range": true,
"refId": "E"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(rate(istio_requests_total{response_code=~\"429\"}[5m])) by (destination_service_name) * on(destination_service_name) group_right() (group without(cluster_id, instance, app_kubernetes_io_instance) (label_replace(gatewayapi_httproute_labels{exported_namespace=~\"${api_policy_namespace}\"}, \"destination_service_name\", \"$1\",\"service\", \"(.+)\")))",
"hide": false,
"legendFormat": "429: {{name}}",
"range": true,
"refId": "F"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(rate(istio_requests_total{response_code=~\"500\"}[5m])) by (destination_service_name) * on(destination_service_name) group_right() (group without(cluster_id, instance, app_kubernetes_io_instance) (label_replace(gatewayapi_httproute_labels{exported_namespace=~\"${api_policy_namespace}\"}, \"destination_service_name\", \"$1\",\"service\", \"(.+)\")))",
"hide": false,
"legendFormat": "500: {{name}}",
"range": true,
"refId": "G"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(rate(istio_requests_total{response_code=~\"501\"}[5m])) by (destination_service_name) * on(destination_service_name) group_right() (group without(cluster_id, instance, app_kubernetes_io_instance) (label_replace(gatewayapi_httproute_labels{exported_namespace=~\"${api_policy_namespace}\"}, \"destination_service_name\", \"$1\",\"service\", \"(.+)\")))",
"hide": false,
"legendFormat": "501: {{name}}",
"range": true,
"refId": "H"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(rate(istio_requests_total{response_code=~\"503\"}[5m])) by (destination_service_name) * on(destination_service_name) group_right() (group without(cluster_id, instance, app_kubernetes_io_instance) (label_replace(gatewayapi_httproute_labels{exported_namespace=~\"${api_policy_namespace}\"}, \"destination_service_name\", \"$1\",\"service\", \"(.+)\")))",
"hide": false,
"legendFormat": "503: {{name}}",
"range": true,
"refId": "I"
}
],
"title": "Errors (req/s)",
Expand Down Expand Up @@ -1556,7 +1472,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
Expand Down Expand Up @@ -1736,7 +1653,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
Expand Down

0 comments on commit ec5351d

Please sign in to comment.