diff --git a/nixos/modules/monitoring/server/grafana-dashboards/payments.json b/nixos/modules/monitoring/server/grafana-dashboards/payments.json index 3f35bdeade0fe3e216a9f34d13c6499b401b8351..ee721b78a8058880de41beb31f04cd442bbabeca 100644 --- a/nixos/modules/monitoring/server/grafana-dashboards/payments.json +++ b/nixos/modules/monitoring/server/grafana-dashboards/payments.json @@ -39,7 +39,7 @@ "type": "row" }, { - "description": "Our calls to the Stripe API: Attempted and successful credit card charges.", + "description": "Calls to our Stripe Webhook and the (obsolete) Charge endpoint.", "fieldConfig": { "defaults": { "color": { @@ -136,81 +136,149 @@ "placement": "bottom" }, "tooltip": { - "mode": "single" + "mode": "multi", + "sort": "none" } }, "pluginVersion": "8.3.4", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "LocalPrometheus" + }, + "exemplar": true, + "expr": "sum (http_responses_total{path=\"v1/stripe/webhook\"})", + "hide": false, + "interval": "", + "legendFormat": "Webhook attempts", + "refId": "Webhook attempts" + }, + { + "datasource": { + "type": "prometheus", + "uid": "LocalPrometheus" + }, + "exemplar": true, + "expr": "http_responses_total{path=\"v1/stripe/webhook\", status=\"2XX\"}", + "hide": false, + "interval": "", + "legendFormat": "Webhook successes", + "refId": "Webhook successes" + }, + { + "datasource": { + "type": "prometheus", + "uid": "LocalPrometheus" + }, "exemplar": true, "expr": "payment_processors_stripe_charge_attempts", "hide": false, "interval": "", - "legendFormat": "Attempts", - "refId": "B" + "legendFormat": "Charge attempts", + "refId": "Charge attempts" }, { + "datasource": { + "type": "prometheus", + "uid": "LocalPrometheus" + }, "exemplar": true, "expr": "payment_processors_stripe_charge_successes", + "hide": false, "interval": "", - "legendFormat": "Successes", - "refId": "C" + "legendFormat": "Charge successes", + "refId": "Charge successes" } ], - "title": "Stripe", + "title": "Stripe Webhook and (obsolete) Charge API", "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, "description": "", "fieldConfig": { "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, "unit": "short" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byType", + "options": "time" + }, + "properties": [ + { + "id": "custom.axisPlacement", + "value": "hidden" + } + ] + } + ] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 1 }, - "hiddenSeries": false, "id": 20, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Issued signatures", - "yaxis": 2 + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, + "pluginVersion": "8.4.7", "targets": [ { "datasource": { @@ -237,37 +305,415 @@ "refId": "B" } ], - "thresholds": [], - "timeRegions": [], "title": "Redemption", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 8 + }, + "id": 32, + "panels": [], + "title": "HTTP v1/stripe/webhook", + "type": "row" + }, + { + "description": "HTTPS responses per second", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 9 + }, + "id": 33, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.4", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "LocalPrometheus" + }, + "exemplar": true, + "expr": "rate(http_responses_total{path=\"v1/stripe/webhook\"}[5m])", + "instant": false, + "interval": "", + "legendFormat": "{{status}}", + "refId": "A" + } + ], + "title": "Requests per second", + "type": "timeseries" + }, + { + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 9 }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": false, - "values": [] + "id": 34, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } }, - "yaxes": [ + "pluginVersion": "8.3.4", + "targets": [ { - "$$hashKey": "object:408", - "format": "short", - "logBase": 1, - "show": true + "datasource": { + "type": "prometheus", + "uid": "LocalPrometheus" + }, + "exemplar": true, + "expr": "sum(http_responses_total{path=\"v1/stripe/webhook\", status=\"4XX\"}) / sum(http_responses_total{path=\"v1/stripe/webhook\"})", + "interval": "", + "legendFormat": "Client error (4XX) rate", + "refId": "A" }, { - "$$hashKey": "object:409", - "format": "short", - "logBase": 1, - "show": true + "datasource": { + "type": "prometheus", + "uid": "LocalPrometheus" + }, + "exemplar": true, + "expr": "sum(http_responses_total{path=\"v1/stripe/charge\", status=\"5XX\"}) / sum(http_responses_total{path=\"v1/stripe/webhook\"})", + "interval": "", + "legendFormat": "Server error (5XX) rate", + "refId": "B" } ], - "yaxis": { - "align": false - } + "title": "Error rate", + "type": "timeseries" + }, + { + "description": "Request durations, stacked.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "=< 0.1s" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "=< 1s" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "=< 5s" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "> 5s" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "orange", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 9 + }, + "id": 13, + "links": [], + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.4", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "LocalPrometheus" + }, + "exemplar": true, + "expr": "http_request_duration_seconds_bucket{path=\"v1/stripe/webhook\", le=\"0.1\"}", + "format": "time_series", + "hide": false, + "instant": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "=< 0.1s", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "LocalPrometheus" + }, + "exemplar": true, + "expr": "http_request_duration_seconds_bucket{path=\"v1/stripe/webhook\", le=\"1.0\"} - ignoring(le) http_request_duration_seconds_bucket{path=\"v1/stripe/webhook\", le=\"0.1\"}", + "format": "time_series", + "hide": false, + "instant": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "=< 1s", + "refId": "D" + }, + { + "datasource": { + "type": "prometheus", + "uid": "LocalPrometheus" + }, + "exemplar": true, + "expr": "http_request_duration_seconds_bucket{path=\"v1/stripe/webhook\", le=\"5.0\"} - ignoring(le) http_request_duration_seconds_bucket{path=\"v1/stripe/webhook\", le=\"1.0\"}", + "format": "time_series", + "hide": false, + "instant": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "=< 5s", + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "LocalPrometheus" + }, + "exemplar": true, + "expr": "http_request_duration_seconds_bucket{path=\"v1/stripe/webhook\", le=\"+Inf\"} - ignoring(le) http_request_duration_seconds_bucket{path=\"v1/stripe/webhook\", le=\"5.0\"}", + "format": "time_series", + "hide": false, + "instant": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "> 5s", + "refId": "C" + } + ], + "title": "Durations", + "type": "timeseries" }, { "collapsed": false, @@ -275,7 +721,7 @@ "h": 1, "w": 24, "x": 0, - "y": 8 + "y": 16 }, "id": 18, "panels": [], @@ -341,7 +787,7 @@ "h": 7, "w": 8, "x": 0, - "y": 9 + "y": 17 }, "id": 4, "options": { @@ -351,7 +797,8 @@ "placement": "bottom" }, "tooltip": { - "mode": "single" + "mode": "single", + "sort": "none" } }, "pluginVersion": "8.3.4", @@ -428,7 +875,7 @@ "h": 7, "w": 8, "x": 8, - "y": 9 + "y": 17 }, "id": 15, "options": { @@ -438,7 +885,8 @@ "placement": "bottom" }, "tooltip": { - "mode": "single" + "mode": "multi", + "sort": "none" } }, "pluginVersion": "8.3.4", @@ -581,7 +1029,7 @@ "h": 7, "w": 8, "x": 16, - "y": 9 + "y": 17 }, "id": 12, "links": [], @@ -592,7 +1040,8 @@ "placement": "bottom" }, "tooltip": { - "mode": "single" + "mode": "multi", + "sort": "none" } }, "pluginVersion": "8.3.4", @@ -651,7 +1100,7 @@ "h": 1, "w": 24, "x": 0, - "y": 16 + "y": 24 }, "id": 11, "panels": [], @@ -717,7 +1166,7 @@ "h": 7, "w": 8, "x": 0, - "y": 17 + "y": 25 }, "id": 2, "options": { @@ -727,7 +1176,8 @@ "placement": "bottom" }, "tooltip": { - "mode": "single" + "mode": "single", + "sort": "none" } }, "pluginVersion": "8.3.4", @@ -806,7 +1256,7 @@ "h": 7, "w": 8, "x": 8, - "y": 17 + "y": 25 }, "id": 16, "options": { @@ -816,7 +1266,8 @@ "placement": "bottom" }, "tooltip": { - "mode": "multi" + "mode": "multi", + "sort": "none" } }, "pluginVersion": "8.3.4", @@ -836,7 +1287,7 @@ "type": "timeseries" }, { - "description": "Request durations, stacked.", + "description": "Request durations, stacked", "fieldConfig": { "defaults": { "color": { @@ -955,9 +1406,9 @@ "h": 7, "w": 8, "x": 16, - "y": 17 + "y": 25 }, - "id": 13, + "id": 35, "links": [], "options": { "legend": { @@ -966,14 +1417,15 @@ "placement": "bottom" }, "tooltip": { - "mode": "single" + "mode": "single", + "sort": "none" } }, "pluginVersion": "8.3.4", "targets": [ { "exemplar": true, - "expr": "http_request_duration_seconds_bucket{path=\"v1/redeem\", le=\"0.1\"}", + "expr": "http_request_duration_seconds_bucket{path=\"v1/stripe/charge\", le=\"0.1\"}", "format": "time_series", "hide": false, "instant": false, @@ -984,7 +1436,7 @@ }, { "exemplar": true, - "expr": "http_request_duration_seconds_bucket{path=\"v1/redeem\", le=\"1.0\"} - ignoring(le) http_request_duration_seconds_bucket{path=\"v1/redeem\", le=\"0.1\"}", + "expr": "http_request_duration_seconds_bucket{path=\"v1/stripe/charge\", le=\"1.0\"} - ignoring(le) http_request_duration_seconds_bucket{path=\"v1/stripe/charge\", le=\"0.1\"}", "format": "time_series", "hide": false, "instant": false, @@ -995,7 +1447,7 @@ }, { "exemplar": true, - "expr": "http_request_duration_seconds_bucket{path=\"v1/redeem\", le=\"5.0\"} - ignoring(le) http_request_duration_seconds_bucket{path=\"v1/redeem\", le=\"1.0\"}", + "expr": "http_request_duration_seconds_bucket{path=\"v1/stripe/charge\", le=\"5.0\"} - ignoring(le) http_request_duration_seconds_bucket{path=\"v1/stripe/charge\", le=\"1.0\"}", "format": "time_series", "hide": false, "instant": false, @@ -1006,7 +1458,7 @@ }, { "exemplar": true, - "expr": "http_request_duration_seconds_bucket{path=\"v1/redeem\", le=\"+Inf\"} - ignoring(le) http_request_duration_seconds_bucket{path=\"v1/redeem\", le=\"5.0\"}", + "expr": "http_request_duration_seconds_bucket{path=\"v1/stripe/charge\", le=\"+Inf\"} - ignoring(le) http_request_duration_seconds_bucket{path=\"v1/stripe/charge\", le=\"5.0\"}", "format": "time_series", "hide": false, "instant": false, @@ -1025,7 +1477,7 @@ "h": 1, "w": 24, "x": 0, - "y": 24 + "y": 32 }, "id": 26, "panels": [], @@ -1097,7 +1549,7 @@ "h": 8, "w": 12, "x": 0, - "y": 25 + "y": 33 }, "id": 28, "options": { @@ -1107,7 +1559,8 @@ "placement": "bottom" }, "tooltip": { - "mode": "single" + "mode": "single", + "sort": "none" } }, "targets": [ @@ -1134,7 +1587,7 @@ "h": 8, "w": 12, "x": 12, - "y": 25 + "y": 33 }, "id": 30, "options": { @@ -1162,7 +1615,7 @@ } ], "refresh": "5m", - "schemaVersion": 34, + "schemaVersion": 35, "style": "dark", "tags": [], "templating": {