{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": { "type": "grafana", "uid": "-- Grafana --" },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 1,
  "id": null,
  "uid": null,
  "links": [],
  "panels": [
    {
      "collapsed": false,
      "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 },
      "id": 100,
      "title": "Request Rate",
      "type": "row"
    },
    {
      "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
      "fieldConfig": {
        "defaults": {
          "color": { "mode": "palette-classic" },
          "custom": {
            "axisColorMode": "text",
            "axisPlacement": "auto",
            "drawStyle": "line",
            "fillOpacity": 15,
            "gradientMode": "opacity",
            "lineInterpolation": "smooth",
            "lineWidth": 2,
            "showPoints": "never",
            "spanNulls": false,
            "stacking": { "group": "A", "mode": "none" },
            "thresholdsStyle": { "mode": "off" }
          },
          "unit": "reqps"
        }
      },
      "gridPos": { "h": 8, "w": 12, "x": 0, "y": 1 },
      "id": 1,
      "options": {
        "legend": { "calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom", "showLegend": true },
        "tooltip": { "mode": "multi", "sort": "desc" }
      },
      "targets": [
        {
          "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
          "expr": "sum by(method) (rate(http_requests_total[5m]))",
          "legendFormat": "{{method}}",
          "refId": "A"
        }
      ],
      "title": "Requests/sec by Method",
      "type": "timeseries"
    },
    {
      "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
      "fieldConfig": {
        "defaults": {
          "color": { "mode": "palette-classic" },
          "custom": {
            "axisColorMode": "text",
            "axisPlacement": "auto",
            "drawStyle": "line",
            "fillOpacity": 20,
            "gradientMode": "opacity",
            "lineInterpolation": "smooth",
            "lineWidth": 2,
            "showPoints": "never",
            "spanNulls": false,
            "stacking": { "group": "A", "mode": "none" },
            "thresholdsStyle": { "mode": "off" }
          },
          "unit": "reqps"
        },
        "overrides": [
          {
            "matcher": { "id": "byName", "options": "5xx Errors" },
            "properties": [{ "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } }]
          },
          {
            "matcher": { "id": "byName", "options": "4xx Errors" },
            "properties": [{ "id": "color", "value": { "fixedColor": "orange", "mode": "fixed" } }]
          }
        ]
      },
      "gridPos": { "h": 8, "w": 12, "x": 12, "y": 1 },
      "id": 2,
      "options": {
        "legend": { "calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom", "showLegend": true },
        "tooltip": { "mode": "multi", "sort": "desc" }
      },
      "targets": [
        {
          "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
          "expr": "sum(rate(http_requests_total{status_code=~\"5..\"}[5m]))",
          "legendFormat": "5xx Errors",
          "refId": "A"
        },
        {
          "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
          "expr": "sum(rate(http_requests_total{status_code=~\"4..\"}[5m]))",
          "legendFormat": "4xx Errors",
          "refId": "B"
        }
      ],
      "title": "Error Rate",
      "type": "timeseries"
    },
    {
      "collapsed": false,
      "gridPos": { "h": 1, "w": 24, "x": 0, "y": 9 },
      "id": 101,
      "title": "Latency",
      "type": "row"
    },
    {
      "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
      "fieldConfig": {
        "defaults": {
          "color": { "mode": "palette-classic" },
          "custom": {
            "axisColorMode": "text",
            "axisPlacement": "auto",
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "opacity",
            "lineInterpolation": "smooth",
            "lineWidth": 2,
            "showPoints": "never",
            "spanNulls": false,
            "stacking": { "group": "A", "mode": "none" },
            "thresholdsStyle": { "mode": "line" }
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              { "color": "transparent", "value": null },
              { "color": "red", "value": 1 }
            ]
          },
          "unit": "s"
        },
        "overrides": [
          {
            "matcher": { "id": "byName", "options": "p99" },
            "properties": [{ "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } }]
          },
          {
            "matcher": { "id": "byName", "options": "p95" },
            "properties": [{ "id": "color", "value": { "fixedColor": "orange", "mode": "fixed" } }]
          },
          {
            "matcher": { "id": "byName", "options": "p50" },
            "properties": [{ "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } }]
          }
        ]
      },
      "gridPos": { "h": 8, "w": 16, "x": 0, "y": 10 },
      "id": 3,
      "options": {
        "legend": { "calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom", "showLegend": true },
        "tooltip": { "mode": "multi", "sort": "desc" }
      },
      "targets": [
        {
          "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
          "expr": "histogram_quantile(0.50, sum(rate(http_request_duration_seconds_bucket[5m])) by (le))",
          "legendFormat": "p50",
          "refId": "A"
        },
        {
          "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
          "expr": "histogram_quantile(0.95, sum(rate(http_request_duration_seconds_bucket[5m])) by (le))",
          "legendFormat": "p95",
          "refId": "B"
        },
        {
          "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
          "expr": "histogram_quantile(0.99, sum(rate(http_request_duration_seconds_bucket[5m])) by (le))",
          "legendFormat": "p99",
          "refId": "C"
        }
      ],
      "title": "Request Latency Percentiles",
      "type": "timeseries"
    },
    {
      "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
      "fieldConfig": {
        "defaults": {
          "color": { "fixedColor": "super-light-blue", "mode": "fixed" },
          "custom": {
            "axisColorMode": "text",
            "axisPlacement": "auto",
            "drawStyle": "line",
            "fillOpacity": 15,
            "gradientMode": "opacity",
            "lineInterpolation": "smooth",
            "lineWidth": 2,
            "showPoints": "never",
            "spanNulls": false,
            "stacking": { "group": "A", "mode": "none" },
            "thresholdsStyle": { "mode": "off" }
          },
          "unit": "s"
        }
      },
      "gridPos": { "h": 8, "w": 8, "x": 16, "y": 10 },
      "id": 4,
      "options": {
        "legend": { "calcs": ["mean"], "displayMode": "list", "placement": "bottom", "showLegend": true },
        "tooltip": { "mode": "single", "sort": "none" }
      },
      "targets": [
        {
          "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
          "expr": "sum(rate(http_request_duration_seconds_sum[5m])) / sum(rate(http_request_duration_seconds_count[5m]))",
          "legendFormat": "Avg Latency",
          "refId": "A"
        }
      ],
      "title": "Average Request Latency",
      "type": "timeseries"
    },
    {
      "collapsed": false,
      "gridPos": { "h": 1, "w": 24, "x": 0, "y": 18 },
      "id": 102,
      "title": "Top Endpoints",
      "type": "row"
    },
    {
      "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
      "fieldConfig": {
        "defaults": {
          "color": { "mode": "thresholds" },
          "custom": {
            "align": "auto",
            "cellOptions": { "type": "auto" },
            "inspect": false
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              { "color": "green", "value": null }
            ]
          }
        },
        "overrides": [
          {
            "matcher": { "id": "byName", "options": "Value" },
            "properties": [
              { "id": "displayName", "value": "Requests (5m)" },
              { "id": "custom.cellOptions", "value": { "mode": "gradient", "type": "gauge" } },
              { "id": "color", "value": { "mode": "continuous-BlYlRd" } }
            ]
          },
          {
            "matcher": { "id": "byName", "options": "route" },
            "properties": [
              { "id": "displayName", "value": "Route" },
              { "id": "custom.width", "value": 300 }
            ]
          },
          {
            "matcher": { "id": "byName", "options": "method" },
            "properties": [
              { "id": "displayName", "value": "Method" },
              { "id": "custom.width", "value": 80 }
            ]
          }
        ]
      },
      "gridPos": { "h": 9, "w": 12, "x": 0, "y": 19 },
      "id": 5,
      "options": {
        "cellHeight": "sm",
        "footer": { "countRows": false, "enablePagination": false, "fields": "", "reducer": ["sum"], "show": false },
        "showHeader": true,
        "sortBy": [{ "desc": true, "displayName": "Requests (5m)" }]
      },
      "targets": [
        {
          "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
          "expr": "topk(15, sum by(method, route) (increase(http_requests_total[5m])))",
          "format": "table",
          "instant": true,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "Top Routes by Request Count",
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": { "Time": true },
            "renameByName": {}
          }
        }
      ],
      "type": "table"
    },
    {
      "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
      "fieldConfig": {
        "defaults": {
          "color": { "mode": "thresholds" },
          "custom": {
            "align": "auto",
            "cellOptions": { "type": "auto" },
            "inspect": false
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              { "color": "green", "value": null },
              { "color": "yellow", "value": 0.5 },
              { "color": "red", "value": 1 }
            ]
          }
        },
        "overrides": [
          {
            "matcher": { "id": "byName", "options": "Value" },
            "properties": [
              { "id": "displayName", "value": "p95 Latency (s)" },
              { "id": "unit", "value": "s" },
              { "id": "decimals", "value": 3 },
              { "id": "custom.cellOptions", "value": { "mode": "gradient", "type": "gauge" } },
              { "id": "color", "value": { "mode": "continuous-GrYlRd" } }
            ]
          },
          {
            "matcher": { "id": "byName", "options": "route" },
            "properties": [
              { "id": "displayName", "value": "Route" },
              { "id": "custom.width", "value": 300 }
            ]
          },
          {
            "matcher": { "id": "byName", "options": "method" },
            "properties": [
              { "id": "displayName", "value": "Method" },
              { "id": "custom.width", "value": 80 }
            ]
          }
        ]
      },
      "gridPos": { "h": 9, "w": 12, "x": 12, "y": 19 },
      "id": 6,
      "options": {
        "cellHeight": "sm",
        "footer": { "countRows": false, "enablePagination": false, "fields": "", "reducer": ["sum"], "show": false },
        "showHeader": true,
        "sortBy": [{ "desc": true, "displayName": "p95 Latency (s)" }]
      },
      "targets": [
        {
          "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
          "expr": "topk(15, histogram_quantile(0.95, sum by(method, route, le) (rate(http_request_duration_seconds_bucket[5m]))))",
          "format": "table",
          "instant": true,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "Slowest Routes by p95 Latency",
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": { "Time": true },
            "renameByName": {}
          }
        }
      ],
      "type": "table"
    }
  ],
  "refresh": "30s",
  "schemaVersion": 38,
  "tags": ["changemaker", "v2", "api", "performance"],
  "templating": { "list": [] },
  "time": { "from": "now-1h", "to": "now" },
  "timepicker": {},
  "timezone": "",
  "title": "Changemaker - API Performance",
  "version": 1
}
