{
  "dashboardID": "sock-shop",
  "name": "Sock Shop",
  "information": "This dashboard visualizes Sock Shop application metrics metrics interleaved with chaos events and chaos exporter metrics.",
  "chaosEventQueryTemplate": "litmuschaos_awaited_experiments{job=\"chaos-exporter\", chaos_injection_time!=\"\", instance=\"chaos-exporter-service\"}",
  "chaosVerdictQueryTemplate": "litmuschaos_experiment_verdict{job=\"chaos-exporter\", chaosresult_verdict!=\"Awaited\", instance=\"chaos-exporter-service\"}",
  "panelGroupMap": [
    {
      "groupName": "Orders Metrics",
      "panels": ["Orders QPS", "Orders Latency"]
    },
    {
      "groupName": "Catalogue Metrics",
      "panels": ["Catalogue QPS", "Catalogue Latency"]
    },
    {
      "groupName": "Payment Metrics",
      "panels": ["Payment QPS", "Payment Latency"]
    },
    {
      "groupName": "Shipping Metrics",
      "panels": ["Shipping QPS", "Shipping Latency"]
    },
    {
      "groupName": "User Metrics",
      "panels": ["User QPS", "User Latency"]
    },
    {
      "groupName": "Frontend Metrics",
      "panels": ["Frontend QPS", "Frontend Latency"]
    },
    {
      "groupName": "Cart Metrics",
      "panels": ["Cart QPS", "Cart Latency"]
    }
  ],
  "panelGroups": [
    {
      "panel_group_name": "Orders Metrics",
      "panels": [
        {
          "panel_name": "Orders QPS",
          "panel_options": {
            "points": false,
            "grids": true,
            "left_axis": true
          },
          "y_axis_left": "QPS (1 min)",
          "y_axis_right": "CHAOS",
          "x_axis_down": "Time",
          "unit": "qps",
          "prom_queries": [
            {
              "prom_query_name": "sum(rate(request_duration_seconds_count{job=\"orders\",status_code=~\"2..\",route!=\"metrics\"}[1m])) * 100",
              "legend": "2xx",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            },
            {
              "prom_query_name": "sum(rate(request_duration_seconds_count{ job=\"orders\", status_code=~\"4.+|5.+\" }[1m])) * 100",
              "legend": "4xx/5xx",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            }
          ]
        },
        {
          "panel_name": "Orders Latency",
          "panel_options": {
            "points": false,
            "grids": true,
            "left_axis": true
          },
          "y_axis_left": "time",
          "y_axis_right": "CHAOS",
          "x_axis_down": "Time",
          "unit": "ms",
          "prom_queries": [
            {
              "prom_query_name": "histogram_quantile(0.99, sum(rate(request_duration_seconds_bucket{job=\"orders\"}[1m])) by (name, le))",
              "legend": "99th quantile",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            },
            {
              "prom_query_name": "histogram_quantile(0.5, sum(rate(request_duration_seconds_bucket{job=\"orders\"}[1m])) by (name, le))",
              "legend": "50th quantile",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            },
            {
              "prom_query_name": "sum(rate(request_duration_seconds_sum{job=\"orders\"}[1m])) / sum(rate(request_duration_seconds_count{job=\"orders\"}[1m]))",
              "legend": "Mean",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            }
          ]
        }
      ]
    },
    {
      "panel_group_name": "Catalogue Metrics",
      "panels": [
        {
          "panel_name": "Catalogue QPS",
          "panel_options": {
            "points": false,
            "grids": true,
            "left_axis": true
          },
          "y_axis_left": "QPS (1 min)",
          "y_axis_right": "CHAOS",
          "x_axis_down": "Time",
          "unit": "qps",
          "prom_queries": [
            {
              "prom_query_name": "sum(rate(request_duration_seconds_count{job=\"catalogue\",status_code=~\"2..\",route!=\"metrics\"}[1m])) * 100",
              "legend": "2xx",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            },
            {
              "prom_query_name": "sum(rate(request_duration_seconds_count{ job=\"catalogue\", status_code=~\"4.+|5.+\" }[1m])) * 100",
              "legend": "4xx/5xx",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            }
          ]
        },
        {
          "panel_name": "Catalogue Latency",
          "panel_options": {
            "points": false,
            "grids": true,
            "left_axis": true
          },
          "y_axis_left": "time",
          "y_axis_right": "CHAOS",
          "x_axis_down": "Time",
          "unit": "ms",
          "prom_queries": [
            {
              "prom_query_name": "histogram_quantile(0.99, sum(rate(request_duration_seconds_bucket{job=\"catalogue\"}[1m])) by (name, le))",
              "legend": "99th quantile",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            },
            {
              "prom_query_name": "histogram_quantile(0.5, sum(rate(request_duration_seconds_bucket{job=\"catalogue\"}[1m])) by (name, le))",
              "legend": "50th quantile",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            },
            {
              "prom_query_name": "sum(rate(request_duration_seconds_sum{job=\"catalogue\"}[1m])) / sum(rate(request_duration_seconds_count{job=\"catalogue\"}[1m]))",
              "legend": "Mean",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            }
          ]
        }
      ]
    },
    {
      "panel_group_name": "Payment Metrics",
      "panels": [
        {
          "panel_name": "Payment QPS",
          "panel_options": {
            "points": false,
            "grids": true,
            "left_axis": true
          },
          "y_axis_left": "QPS (1 min)",
          "y_axis_right": "CHAOS",
          "x_axis_down": "Time",
          "unit": "qps",
          "prom_queries": [
            {
              "prom_query_name": "sum(rate(request_duration_seconds_count{job=\"payment\",status_code=~\"2..\",route!=\"metrics\"}[1m])) * 100",
              "legend": "2xx",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            },
            {
              "prom_query_name": "sum(rate(request_duration_seconds_count{ job=\"payment\", status_code=~\"4.+|5.+\" }[1m])) * 100",
              "legend": "4xx/5xx",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            }
          ]
        },
        {
          "panel_name": "Payment Latency",
          "panel_options": {
            "points": false,
            "grids": true,
            "left_axis": true
          },
          "y_axis_left": "time",
          "y_axis_right": "CHAOS",
          "x_axis_down": "Time",
          "unit": "ms",
          "prom_queries": [
            {
              "prom_query_name": "histogram_quantile(0.99, sum(rate(request_duration_seconds_bucket{job=\"payment\"}[1m])) by (name, le))",
              "legend": "99th quantile",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            },
            {
              "prom_query_name": "histogram_quantile(0.5, sum(rate(request_duration_seconds_bucket{job=\"payment\"}[1m])) by (name, le))",
              "legend": "50th quantile",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            },
            {
              "prom_query_name": "sum(rate(request_duration_seconds_sum{job=\"payment\"}[1m])) / sum(rate(request_duration_seconds_count{job=\"payment\"}[1m]))",
              "legend": "Mean",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            }
          ]
        }
      ]
    },
    {
      "panel_group_name": "Shipping Metrics",
      "panels": [
        {
          "panel_name": "Shipping QPS",
          "panel_options": {
            "points": false,
            "grids": true,
            "left_axis": true
          },
          "y_axis_left": "QPS (1 min)",
          "y_axis_right": "CHAOS",
          "x_axis_down": "Time",
          "unit": "qps",
          "prom_queries": [
            {
              "prom_query_name": "sum(rate(request_duration_seconds_count{job=\"shipping\",status_code=~\"2..\",route!=\"metrics\"}[1m])) * 100",
              "legend": "2xx",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            },
            {
              "prom_query_name": "sum(rate(request_duration_seconds_count{ job=\"shipping\", status_code=~\"4.+|5.+\" }[1m])) * 100",
              "legend": "4xx/5xx",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            }
          ]
        },
        {
          "panel_name": "Shipping Latency",
          "panel_options": {
            "points": false,
            "grids": true,
            "left_axis": true
          },
          "y_axis_left": "time",
          "y_axis_right": "CHAOS",
          "x_axis_down": "Time",
          "unit": "ms",
          "prom_queries": [
            {
              "prom_query_name": "histogram_quantile(0.99, sum(rate(request_duration_seconds_bucket{job=\"shipping\"}[1m])) by (name, le))",
              "legend": "99th quantile",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            },
            {
              "prom_query_name": "histogram_quantile(0.5, sum(rate(request_duration_seconds_bucket{job=\"shipping\"}[1m])) by (name, le))",
              "legend": "50th quantile",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            },
            {
              "prom_query_name": "sum(rate(request_duration_seconds_sum{job=\"shipping\"}[1m])) / sum(rate(request_duration_seconds_count{job=\"shipping\"}[1m]))",
              "legend": "Mean",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            }
          ]
        }
      ]
    },
    {
      "panel_group_name": "User Metrics",
      "panels": [
        {
          "panel_name": "User QPS",
          "panel_options": {
            "points": false,
            "grids": true,
            "left_axis": true
          },
          "y_axis_left": "QPS (1 min)",
          "y_axis_right": "CHAOS",
          "x_axis_down": "Time",
          "unit": "qps",
          "prom_queries": [
            {
              "prom_query_name": "sum(rate(request_duration_seconds_count{job=\"user\",status_code=~\"2..\",route!=\"metrics\"}[1m])) * 100",
              "legend": "2xx",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            },
            {
              "prom_query_name": "sum(rate(request_duration_seconds_count{ job=\"user\", status_code=~\"4.+|5.+\" }[1m])) * 100",
              "legend": "4xx/5xx",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            }
          ]
        },
        {
          "panel_name": "User Latency",
          "panel_options": {
            "points": false,
            "grids": true,
            "left_axis": true
          },
          "y_axis_left": "time",
          "y_axis_right": "CHAOS",
          "x_axis_down": "Time",
          "unit": "ms",
          "prom_queries": [
            {
              "prom_query_name": "histogram_quantile(0.99, sum(rate(request_duration_seconds_bucket{job=\"user\"}[1m])) by (name, le))",
              "legend": "99th quantile",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            },
            {
              "prom_query_name": "histogram_quantile(0.5, sum(rate(request_duration_seconds_bucket{job=\"user\"}[1m])) by (name, le))",
              "legend": "50th quantile",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            },
            {
              "prom_query_name": "sum(rate(request_duration_seconds_sum{job=\"user\"}[1m])) / sum(rate(request_duration_seconds_count{job=\"user\"}[1m]))",
              "legend": "Mean",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            }
          ]
        }
      ]
    },
    {
      "panel_group_name": "Frontend Metrics",
      "panels": [
        {
          "panel_name": "Frontend QPS",
          "panel_options": {
            "points": false,
            "grids": true,
            "left_axis": true
          },
          "y_axis_left": "QPS (1 min)",
          "y_axis_right": "CHAOS",
          "x_axis_down": "Time",
          "unit": "qps",
          "prom_queries": [
            {
              "prom_query_name": "sum(rate(request_duration_seconds_count{job=\"front-end\",status_code=~\"2..\",route!=\"metrics\"}[1m])) * 100",
              "legend": "2xx",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            },
            {
              "prom_query_name": "sum(rate(request_duration_seconds_count{ job=\"front-end\", status_code=~\"4.+|5.+\" }[1m])) * 100",
              "legend": "4xx/5xx",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            }
          ]
        },
        {
          "panel_name": "Frontend Latency",
          "panel_options": {
            "points": false,
            "grids": true,
            "left_axis": true
          },
          "y_axis_left": "time",
          "y_axis_right": "CHAOS",
          "x_axis_down": "Time",
          "unit": "ms",
          "prom_queries": [
            {
              "prom_query_name": "histogram_quantile(0.99, sum(rate(request_duration_seconds_bucket{job=\"front-end\"}[1m])) by (name, le))",
              "legend": "99th quantile",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            },
            {
              "prom_query_name": "histogram_quantile(0.5, sum(rate(request_duration_seconds_bucket{job=\"front-end\"}[1m])) by (name, le))",
              "legend": "50th quantile",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            },
            {
              "prom_query_name": "sum(rate(request_duration_seconds_sum{job=\"front-end\"}[1m])) / sum(rate(request_duration_seconds_count{job=\"front-end\"}[1m]))",
              "legend": "Mean",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            }
          ]
        }
      ]
    },
    {
      "panel_group_name": "Cart Metrics",
      "panels": [
        {
          "panel_name": "Cart QPS",
          "panel_options": {
            "points": false,
            "grids": true,
            "left_axis": true
          },
          "y_axis_left": "QPS (1 min)",
          "y_axis_right": "CHAOS",
          "x_axis_down": "Time",
          "unit": "qps",
          "prom_queries": [
            {
              "prom_query_name": "sum(rate(request_duration_seconds_count{job=\"carts\",status_code=~\"2..\",route!=\"metrics\"}[1m])) * 100",
              "legend": "2xx",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            },
            {
              "prom_query_name": "sum(rate(request_duration_seconds_count{ job=\"carts\", status_code=~\"4.+|5.+\" }[1m])) * 100",
              "legend": "4xx/5xx",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            }
          ]
        },
        {
          "panel_name": "Cart Latency",
          "panel_options": {
            "points": false,
            "grids": true,
            "left_axis": true
          },
          "y_axis_left": "time",
          "y_axis_right": "CHAOS",
          "x_axis_down": "Time",
          "unit": "ms",
          "prom_queries": [
            {
              "prom_query_name": "histogram_quantile(0.99, sum(rate(request_duration_seconds_bucket{job=\"carts\"}[1m])) by (name, le))",
              "legend": "99th quantile",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            },
            {
              "prom_query_name": "histogram_quantile(0.5, sum(rate(request_duration_seconds_bucket{job=\"carts\"}[1m])) by (name, le))",
              "legend": "50th quantile",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            },
            {
              "prom_query_name": "sum(rate(request_duration_seconds_sum{job=\"carts\"}[1m])) / sum(rate(request_duration_seconds_count{job=\"carts\"}[1m]))",
              "legend": "Mean",
              "resolution": "1/2",
              "minstep": "5",
              "line": true,
              "close_area": false
            }
          ]
        }
      ]
    }
  ]
}
