diff --git a/aws/grafana-dashboards/README.md b/aws/grafana-dashboards/README.md index 7807aba0..b117acf8 100644 --- a/aws/grafana-dashboards/README.md +++ b/aws/grafana-dashboards/README.md @@ -6,9 +6,9 @@ Example: ```terraform module "grafana_dashboards" { - source = "github.com/thoughtbot/flightdeck//aws/grafana-datashboards?ref=VERSION" + source = "github.com/thoughtbot/flightdeck//aws/grafana-dashboards?ref=VERSION" - create_istio_dashboard = true + dashboards_to_create = ["istio", "rds-databases", "slo-details", "slo-overview"] } ``` @@ -31,11 +31,11 @@ module "grafana_dashboards" { | Name | Type | |------|------| -| [grafana_dashboard.istio](https://registry.terraform.io/providers/grafana/grafana/latest/docs/resources/dashboard) | resource | +| [grafana_dashboard.this](https://registry.terraform.io/providers/grafana/grafana/latest/docs/resources/dashboard) | resource | ## Inputs | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [create\_istio\_dashboard](#input\_create\_istio\_dashboard) | Create Istio dashboard | `bool` | `false` | no | +| [dashboards\_to\_create](#input\_dashboards\_to\_create) | List of dashboards to create (cluster-resources, istio, rds-databases, slo-details, and/or slo-overview) | `list(string)` | n/a | yes | \ No newline at end of file diff --git a/aws/grafana-dashboards/dashboards/cluster-resources.json b/aws/grafana-dashboards/dashboards/cluster-resources.json new file mode 100644 index 00000000..68452593 --- /dev/null +++ b/aws/grafana-dashboards/dashboards/cluster-resources.json @@ -0,0 +1,435 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 36, + "iteration": 1687796379150, + "links": [], + "liveNow": false, + "panels": [ + { + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 50, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 3, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.4.7", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "exemplar": true, + "expr": "sum(deploy:cluster_autoscaler:cpu_current_cores:gauge) by (cluster)", + "hide": false, + "interval": "", + "legendFormat": "{{cluster}}", + "refId": "B" + } + ], + "title": "Cluster CPU Cores", + "type": "timeseries" + }, + { + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 50, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 5, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.4.7", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "exemplar": true, + "expr": "sum(deploy:cluster_autoscaler:memory_current_bytes:gauge) by (cluster)", + "hide": false, + "interval": "", + "legendFormat": "{{cluster}}", + "refId": "B" + } + ], + "title": "Cluster Memory", + "type": "timeseries" + }, + { + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "bars", + "fillOpacity": 100, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 8 + }, + "id": 7, + "interval": "5m", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "exemplar": true, + "expr": "sum(deploy:cluster_autoscaler:nodes_count:gauge{state=\"ready\"}) by (cluster)", + "interval": "", + "legendFormat": "{{cluster}}", + "refId": "A" + } + ], + "title": "Cluster Nodes", + "type": "timeseries" + }, + { + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 8 + }, + "id": 9, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "exemplar": false, + "expr": "avg(deploy:replicas_available:mean{namespace=\"$namespace\"}) by (deployment)", + "interval": "", + "legendFormat": "{{deployment}}", + "refId": "A" + } + ], + "title": "Pods", + "type": "timeseries" + } + ], + "schemaVersion": 35, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "Prometheus (production)", + "value": "Prometheus (production)" + }, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "Datasource", + "options": [], + "query": "prometheus", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "definition": "label_values(istio:namespace_destination_service_name_response_code:istio_requests:rate5m, destination_service_namespace)", + "hide": 0, + "includeAll": true, + "multi": false, + "name": "namespace", + "options": [], + "query": { + "query": "label_values(istio:namespace_destination_service_name_response_code:istio_requests:rate5m, destination_service_namespace)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Cluster Resources & Pods", + "uid": "bomq76lnz", + "version": 4, + "weekStart": "" +} \ No newline at end of file diff --git a/aws/grafana-dashboards/dashboards/rds-databases.json b/aws/grafana-dashboards/dashboards/rds-databases.json new file mode 100644 index 00000000..4a87805b --- /dev/null +++ b/aws/grafana-dashboards/dashboards/rds-databases.json @@ -0,0 +1,1503 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 4, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 0, + "y": 0 + }, + "id": 9, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "dimensions": { + "DBInstanceIdentifier": "$database" + }, + "expression": "", + "id": "", + "label": "", + "logGroups": [], + "matchExact": true, + "metricEditorMode": 0, + "metricName": "CPUUtilization", + "metricQueryType": 0, + "namespace": "AWS/RDS", + "period": "", + "queryMode": "Metrics", + "refId": "A", + "region": "default", + "sqlExpression": "", + "statistic": "Average" + } + ], + "title": "CPU Utilization", + "type": "timeseries" + }, + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 6, + "y": 0 + }, + "id": 12, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "dimensions": { + "DBInstanceIdentifier": "$database" + }, + "expression": "", + "id": "", + "label": "", + "logGroups": [], + "matchExact": true, + "metricEditorMode": 0, + "metricName": "FreeStorageSpace", + "metricQueryType": 0, + "namespace": "AWS/RDS", + "period": "", + "queryMode": "Metrics", + "refId": "A", + "region": "default", + "sqlExpression": "", + "statistic": "Average" + } + ], + "title": "Free Storage Space", + "type": "timeseries" + }, + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 12, + "y": 0 + }, + "id": 11, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "dimensions": { + "DBInstanceIdentifier": "$database" + }, + "expression": "", + "id": "", + "label": "", + "logGroups": [], + "matchExact": true, + "metricEditorMode": 0, + "metricName": "FreeableMemory", + "metricQueryType": 0, + "namespace": "AWS/RDS", + "period": "", + "queryMode": "Metrics", + "refId": "A", + "region": "default", + "sqlExpression": "", + "statistic": "Average" + } + ], + "title": "Freeable Memory", + "type": "timeseries" + }, + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 18, + "y": 0 + }, + "id": 10, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "dimensions": { + "DBInstanceIdentifier": "$database" + }, + "expression": "", + "id": "", + "label": "", + "logGroups": [], + "matchExact": true, + "metricEditorMode": 0, + "metricName": "SwapUsage", + "metricQueryType": 0, + "namespace": "AWS/RDS", + "period": "", + "queryMode": "Metrics", + "refId": "A", + "region": "default", + "sqlExpression": "", + "statistic": "Average" + } + ], + "title": "Swap Usage", + "type": "timeseries" + }, + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 0, + "y": 8 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "dimensions": { + "DBInstanceIdentifier": "$database" + }, + "expression": "", + "id": "", + "label": "", + "logGroups": [], + "matchExact": true, + "metricEditorMode": 0, + "metricName": "ReadLatency", + "metricQueryType": 0, + "namespace": "AWS/RDS", + "period": "", + "queryMode": "Metrics", + "refId": "A", + "region": "default", + "sqlExpression": "", + "statistic": "Average" + } + ], + "title": "Read Latency", + "type": "timeseries" + }, + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 6, + "y": 8 + }, + "id": 3, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "dimensions": { + "DBInstanceIdentifier": "$database" + }, + "expression": "", + "id": "", + "label": "", + "logGroups": [], + "matchExact": true, + "metricEditorMode": 0, + "metricName": "WriteLatency", + "metricQueryType": 0, + "namespace": "AWS/RDS", + "period": "", + "queryMode": "Metrics", + "refId": "A", + "region": "default", + "sqlExpression": "", + "statistic": "Average" + } + ], + "title": "Write Latency", + "type": "timeseries" + }, + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 12, + "y": 8 + }, + "id": 14, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "dimensions": { + "DBInstanceIdentifier": "$database" + }, + "expression": "", + "id": "", + "label": "", + "logGroups": [], + "matchExact": true, + "metricEditorMode": 0, + "metricName": "ReadThroughput", + "metricQueryType": 0, + "namespace": "AWS/RDS", + "period": "", + "queryMode": "Metrics", + "refId": "A", + "region": "default", + "sqlExpression": "", + "statistic": "Average" + } + ], + "title": "Read Throughput", + "type": "timeseries" + }, + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 18, + "y": 8 + }, + "id": 15, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "dimensions": { + "DBInstanceIdentifier": "$database" + }, + "expression": "", + "id": "", + "label": "", + "logGroups": [], + "matchExact": true, + "metricEditorMode": 0, + "metricName": "WriteThroughput", + "metricQueryType": 0, + "namespace": "AWS/RDS", + "period": "", + "queryMode": "Metrics", + "refId": "A", + "region": "default", + "sqlExpression": "", + "statistic": "Average" + } + ], + "title": "Write Throughput", + "type": "timeseries" + }, + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 0, + "y": 16 + }, + "id": 4, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "dimensions": { + "DBInstanceIdentifier": "$database" + }, + "expression": "", + "id": "", + "label": "", + "logGroups": [], + "matchExact": true, + "metricEditorMode": 0, + "metricName": "ReadIOPS", + "metricQueryType": 0, + "namespace": "AWS/RDS", + "period": "", + "queryMode": "Metrics", + "refId": "A", + "region": "default", + "sqlExpression": "", + "statistic": "Average" + } + ], + "title": "Read IOPS", + "type": "timeseries" + }, + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 6, + "y": 16 + }, + "id": 5, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "dimensions": { + "DBInstanceIdentifier": "$database" + }, + "expression": "", + "id": "", + "label": "", + "logGroups": [], + "matchExact": true, + "metricEditorMode": 0, + "metricName": "WriteIOPS", + "metricQueryType": 0, + "namespace": "AWS/RDS", + "period": "", + "queryMode": "Metrics", + "refId": "A", + "region": "default", + "sqlExpression": "", + "statistic": "Average" + } + ], + "title": "Write IOPS", + "type": "timeseries" + }, + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "line" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 6000 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 12, + "y": 16 + }, + "id": 6, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "dimensions": {}, + "expression": "", + "id": "", + "label": "", + "logGroups": [], + "matchExact": true, + "metricEditorMode": 0, + "metricName": "ReadIOPS", + "metricQueryType": 0, + "namespace": "AWS/RDS", + "period": "", + "queryMode": "Metrics", + "refId": "A", + "region": "default", + "sqlExpression": "", + "statistic": "Average" + }, + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "dimensions": { + "DBInstanceIdentifier": "$database" + }, + "expression": "", + "hide": false, + "id": "", + "label": "", + "logGroups": [], + "matchExact": true, + "metricEditorMode": 0, + "metricName": "WriteIOPS", + "metricQueryType": 0, + "namespace": "AWS/RDS", + "period": "", + "queryMode": "Metrics", + "refId": "B", + "region": "default", + "sqlExpression": "", + "statistic": "Average" + } + ], + "title": "Total IOPS", + "transformations": [ + { + "id": "calculateField", + "options": { + "alias": "Total IOPS (Maximum)", + "binary": { + "left": "ReadIOPS_Maximum", + "operator": "+", + "reducer": "sum", + "right": "ReadIOPS_Maximum" + }, + "mode": "binary", + "reduce": { + "reducer": "sum" + }, + "replaceFields": true + } + } + ], + "type": "timeseries" + }, + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 18, + "y": 16 + }, + "id": 8, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "dimensions": {}, + "expression": "", + "id": "", + "label": "", + "logGroups": [], + "matchExact": true, + "metricEditorMode": 0, + "metricName": "DiskQueueDepth", + "metricQueryType": 0, + "namespace": "AWS/RDS", + "period": "", + "queryMode": "Metrics", + "refId": "A", + "region": "default", + "sqlExpression": "", + "statistic": "Average" + } + ], + "title": "Disk Queue Depth", + "type": "timeseries" + }, + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 0, + "y": 24 + }, + "id": 13, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "dimensions": {}, + "expression": "", + "id": "", + "label": "", + "logGroups": [], + "matchExact": true, + "metricEditorMode": 0, + "metricName": "DatabaseConnections", + "metricQueryType": 0, + "namespace": "AWS/RDS", + "period": "", + "queryMode": "Metrics", + "refId": "A", + "region": "default", + "sqlExpression": "", + "statistic": "Average" + } + ], + "title": "Database Connections", + "type": "timeseries" + } + ], + "refresh": "", + "revision": 1, + "schemaVersion": 38, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "Cloudwatch (production)", + "value": "Cloudwatch (production)" + }, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "Datasource", + "options": [], + "query": "cloudwatch", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "datasource": { + "type": "cloudwatch", + "uid": "${Datasource}" + }, + "definition": "dimension_values(default, AWS/RDS, CPUUtilization, DBInstanceIdentifier)", + "hide": 0, + "includeAll": false, + "label": "Database", + "multi": false, + "name": "database", + "options": [], + "query": "dimension_values(default, AWS/RDS, CPUUtilization, DBInstanceIdentifier)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-12h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "RDS Databases", + "uid": "bibCwwWVk", + "version": 2, + "weekStart": "" +} diff --git a/aws/grafana-dashboards/dashboards/slo-details.json b/aws/grafana-dashboards/dashboards/slo-details.json new file mode 100644 index 00000000..80467b43 --- /dev/null +++ b/aws/grafana-dashboards/dashboards/slo-details.json @@ -0,0 +1,1239 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "description": "Details for SLO recorded by Sloth", + "editable": true, + "fiscalYearStartMonth": 0, + "gnetId": 14348, + "graphTooltip": 0, + "id": 2, + "iteration": 1687552053190, + "links": [], + "liveNow": false, + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 36, + "panels": [], + "title": "General", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "description": "The SLOs that currently are burning more error budget that then available", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "displayMode": "auto", + "filterable": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Burning rate %" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "thresholds" + } + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 1 + }, + { + "color": "red", + "value": 1.02 + } + ] + } + }, + { + "id": "custom.displayMode", + "value": "color-background" + }, + { + "id": "unit", + "value": "percentunit" + } + ] + } + ] + }, + "gridPos": { + "h": 12, + "w": 8, + "x": 0, + "y": 1 + }, + "id": 38, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "frameIndex": 0, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "Burning rate" + } + ] + }, + "pluginVersion": "8.4.7", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "exemplar": false, + "expr": "slo:current_burn_rate:ratio{state=\"$state\"} > ${min_burning_rate}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "queryType": "randomWalk", + "refId": "A" + } + ], + "title": "Exceeded burning rate SLOs ", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "names": [ + "sloth_service", + "sloth_slo", + "Value #A" + ] + } + } + }, + { + "id": "renameByRegex", + "options": { + "regex": "Value #A", + "renamePattern": "Burning rate %" + } + }, + { + "id": "renameByRegex", + "options": { + "regex": "sloth_service", + "renamePattern": "Service" + } + }, + { + "id": "renameByRegex", + "options": { + "regex": "sloth_slo", + "renamePattern": "SLO" + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "description": "The burning rate of the all the Service SLOs", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "points", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "graph": false, + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "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": [] + }, + "gridPos": { + "h": 12, + "w": 16, + "x": 8, + "y": 1 + }, + "id": 56, + "options": { + "graph": {}, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right" + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "exemplar": false, + "expr": "slo:current_burn_rate:ratio{state=\"$state\"} > ${min_burning_rate}", + "interval": "", + "legendFormat": "{{sloth_slo}}", + "queryType": "randomWalk", + "refId": "A" + } + ], + "title": "All burning rate (Filtered >${min_burning_rate}x)", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 13 + }, + "id": 8, + "panels": [], + "repeat": "slo", + "title": "${service}/${slo}", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 7, + "x": 0, + "y": 14 + }, + "id": 15, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "name" + }, + "pluginVersion": "8.4.7", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "exemplar": false, + "expr": "slo:objective:ratio{sloth_service=\"${service}\", sloth_slo=\"${slo}\"}", + "format": "time_series", + "instant": true, + "interval": "", + "legendFormat": "{{sloth_id}}", + "queryType": "randomWalk", + "refId": "A" + } + ], + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "axisSoftMax": 0.99, + "axisSoftMin": 0.99, + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 30, + "gradientMode": "opacity", + "hideFrom": { + "graph": false, + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "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 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Objective" + }, + "properties": [ + { + "id": "custom.fillOpacity", + "value": 0 + }, + { + "id": "color", + "value": { + "fixedColor": "orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "SLI" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 17, + "x": 7, + "y": 14 + }, + "id": 18, + "options": { + "graph": {}, + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "exemplar": true, + "expr": "1 - (max(slo:sli_error:ratio_rate${sli_window}{sloth_service=\"${service}\", sloth_slo=\"${slo}\"}) OR on() vector(0))", + "interval": "", + "legendFormat": "SLI", + "queryType": "randomWalk", + "refId": "A" + }, + { + "exemplar": false, + "expr": "slo:objective:ratio{sloth_service=\"${service}\", sloth_slo=\"${slo}\"}", + "hide": false, + "instant": false, + "interval": "", + "legendFormat": "Objective", + "refId": "B" + } + ], + "title": "SLI", + "transformations": [], + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 7, + "x": 0, + "y": 17 + }, + "id": 10, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "name" + }, + "pluginVersion": "8.4.7", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "exemplar": false, + "expr": "sloth_slo_info{sloth_service=\"${service}\", sloth_slo=\"${slo}\"}", + "instant": true, + "interval": "", + "legendFormat": "{{objective_details}}%", + "queryType": "randomWalk", + "refId": "A" + } + ], + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "description": "This moment burning % of the budget.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "orange", + "value": 0.9 + }, + { + "color": "red", + "value": 1 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 7, + "x": 0, + "y": 19 + }, + "id": 11, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value_and_name" + }, + "pluginVersion": "8.4.7", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "exemplar": false, + "expr": "slo:current_burn_rate:ratio{sloth_service=\"${service}\", sloth_slo=\"${slo}\"} or on() vector(0)", + "instant": true, + "interval": "", + "legendFormat": "Current burning budget %", + "queryType": "randomWalk", + "refId": "A" + } + ], + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "description": "A rolling window of the total period (30d) error budget remaining.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "light-yellow", + "value": 0.4 + }, + { + "color": "green", + "value": 0.9 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 7, + "x": 0, + "y": 21 + }, + "hideTimeOverride": true, + "id": 12, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value_and_name" + }, + "pluginVersion": "8.4.7", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "exemplar": false, + "expr": "clamp_min(\n 1-(\n sum_over_time(\n (\n sum(slo:sli_error:ratio_rate1h{sloth_service=\"${service}\", sloth_slo=\"${slo}\"}) by (sloth_id, sloth_service, sloth_slo)\n )[30d:1h]\n )\n / on(sloth_id)\n (\n max(slo:error_budget:ratio{sloth_service=\"${service}\", sloth_slo=\"${slo}\"}) by (sloth_id) *on() group_left() (24 * 30)\n )\n )\nor on() vector(1), 0)", + "instant": true, + "interval": "", + "legendFormat": "Remaining error budget (30d window)", + "queryType": "randomWalk", + "refId": "A" + } + ], + "timeFrom": "now-30d", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "description": "This graph shows the trailing 30 day budget burn down chart", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 38, + "gradientMode": "opacity", + "hideFrom": { + "graph": false, + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "purple", + "value": null + } + ] + }, + "unit": "percentunit" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Remaining error budget" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "yellow", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 17, + "x": 7, + "y": 21 + }, + "hideTimeOverride": true, + "id": 66, + "interval": "1h", + "maxDataPoints": 720, + "options": { + "graph": {}, + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "exemplar": true, + "expr": "1-(\n sum_over_time(\n (\n sum(slo:sli_error:ratio_rate1h{sloth_service=\"${service}\",sloth_slo=\"${slo}\",prometheus_replica=\"\"}) by (sloth_id, sloth_service, sloth_slo)\n * on() group_left() (\n time() >= bool vector(${__from:date:seconds})\n )\n )[30d:1h]\n )\n / on(sloth_id)\n (\n max(slo:error_budget:ratio{sloth_service=\"${service}\",sloth_slo=\"${slo}\",prometheus_replica=\"\"}) by (sloth_id) *on() group_left() (24 * 30)\n )\n)", + "hide": false, + "interval": "1h", + "legendFormat": "Remaining error budget", + "queryType": "randomWalk", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "exemplar": true, + "expr": "", + "hide": true, + "interval": "", + "legendFormat": "", + "refId": "B" + } + ], + "timeFrom": "now-30d", + "timeShift": "0h", + "title": "Error budget burn chart", + "transformations": [], + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "from": 1e-10, + "result": { + "text": "FIRING" + }, + "to": 1 + }, + "type": "range" + }, + { + "options": { + "from": -1, + "result": { + "text": "OK" + }, + "to": 0 + }, + "type": "range" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "orange", + "value": 1 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 7, + "x": 0, + "y": 23 + }, + "id": 13, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value_and_name" + }, + "pluginVersion": "8.4.7", + "targets": [ + { + "exemplar": false, + "expr": "max(ALERTS{sloth_service=\"${service}\", sloth_slo=\"${slo}\", sloth_severity=\"ticket\"}) OR on() vector(0)", + "instant": true, + "interval": "", + "legendFormat": "Warning alert", + "queryType": "randomWalk", + "refId": "A" + } + ], + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "from": 1e-10, + "result": { + "text": "FIRING" + }, + "to": 1 + }, + "type": "range" + }, + { + "options": { + "from": -1, + "result": { + "text": "OK" + }, + "to": 0 + }, + "type": "range" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 1 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 7, + "x": 0, + "y": 25 + }, + "id": 14, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value_and_name" + }, + "pluginVersion": "8.4.7", + "targets": [ + { + "exemplar": false, + "expr": "max(ALERTS{sloth_service=\"${service}\", sloth_slo=\"${slo}\", sloth_severity=\"page\"}) or on() vector(0)", + "instant": true, + "interval": "", + "legendFormat": "Critical alert", + "queryType": "randomWalk", + "refId": "A" + } + ], + "type": "stat" + } + ], + "refresh": "", + "schemaVersion": 35, + "style": "dark", + "tags": [ + "service levels", + "sli", + "slo", + "sloth" + ], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "Prometheus (production)", + "value": "Prometheus (production)" + }, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "Datasource", + "options": [], + "query": "prometheus", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "definition": "label_values(slo:objective:ratio, sloth_service)", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "service", + "options": [], + "query": { + "query": "label_values(slo:objective:ratio, sloth_service)", + "refId": "StandardVariableQuery" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 2, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "current": { + "selected": false, + "text": "agreed", + "value": "agreed" + }, + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "definition": "label_values(slo:objective:ratio, state)", + "hide": 0, + "includeAll": false, + "label": "State", + "multi": false, + "name": "state", + "options": [], + "query": { + "query": "label_values(slo:objective:ratio, state)", + "refId": "StandardVariableQuery" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": false, + "text": [ + "All" + ], + "value": [ + "$__all" + ] + }, + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "definition": "label_values(slo:objective:ratio{sloth_service=\"${service}\", state=\"$state\"}, sloth_slo)", + "hide": 0, + "includeAll": true, + "multi": true, + "name": "slo", + "options": [], + "query": { + "query": "label_values(slo:objective:ratio{sloth_service=\"${service}\", state=\"$state\"}, sloth_slo)", + "refId": "StandardVariableQuery" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "auto": false, + "auto_count": 50, + "auto_min": "5m", + "current": { + "selected": true, + "text": "5m", + "value": "5m" + }, + "description": "The time window used for the SLIs visualization", + "hide": 0, + "label": "SLI window", + "name": "sli_window", + "options": [ + { + "selected": true, + "text": "5m", + "value": "5m" + }, + { + "selected": false, + "text": "30m", + "value": "30m" + }, + { + "selected": false, + "text": "1h", + "value": "1h" + }, + { + "selected": false, + "text": "2h", + "value": "2h" + }, + { + "selected": false, + "text": "6h", + "value": "6h" + }, + { + "selected": false, + "text": "1d", + "value": "1d" + }, + { + "selected": false, + "text": "3d", + "value": "3d" + }, + { + "selected": false, + "text": "30d", + "value": "30d" + } + ], + "query": "5m,30m,1h,2h,6h,1d,3d,30d", + "queryValue": "", + "refresh": 2, + "skipUrlSync": false, + "type": "interval" + }, + { + "current": { + "selected": true, + "text": "1", + "value": "1" + }, + "description": "The minimum burning budget rate (0-1) to show on the general SLOs block", + "hide": 0, + "label": "Min Burning rate", + "name": "min_burning_rate", + "options": [ + { + "selected": true, + "text": "1", + "value": "1" + } + ], + "query": "1", + "skipUrlSync": false, + "type": "textbox" + } + ] + }, + "time": { + "from": "now-30d", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "SLO Details", + "uid": "FdIiI6O7z", + "version": 4, + "weekStart": "" +} diff --git a/aws/grafana-dashboards/dashboards/slo-overview.json b/aws/grafana-dashboards/dashboards/slo-overview.json new file mode 100644 index 00000000..7878b3ae --- /dev/null +++ b/aws/grafana-dashboards/dashboards/slo-overview.json @@ -0,0 +1,933 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "description": "A high level view of all Sloth SLOs", + "editable": true, + "fiscalYearStartMonth": 0, + "gnetId": 14643, + "graphTooltip": 0, + "id": 5, + "iteration": 1687552198486, + "links": [], + "liveNow": false, + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 102, + "panels": [], + "title": "Stats", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "dark-purple", + "mode": "fixed" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "purple", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 4, + "x": 0, + "y": 1 + }, + "id": 104, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "center", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "8.4.7", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "exemplar": false, + "expr": "count(slo:error_budget:ratio{state=\"$state\"})", + "interval": "", + "legendFormat": "SLOs", + "queryType": "randomWalk", + "refId": "A" + } + ], + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "dark-purple", + "mode": "fixed" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "purple", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 4, + "x": 4, + "y": 1 + }, + "id": 105, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "center", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "8.4.7", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "exemplar": false, + "expr": "count(max(slo:error_budget:ratio{state=\"$state\"}) by (sloth_service))", + "interval": "", + "legendFormat": "Services", + "queryType": "randomWalk", + "refId": "A" + } + ], + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "dark-purple", + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 1 + }, + { + "color": "orange", + "value": 2 + }, + { + "color": "red", + "value": 3 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 8, + "y": 1 + }, + "id": 106, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "center", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "8.4.7", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "exemplar": false, + "expr": "avg(slo:current_burn_rate:ratio{state=\"$state\"})", + "interval": "", + "legendFormat": "Avg burn rate", + "queryType": "randomWalk", + "refId": "A" + } + ], + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "dark-purple", + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "orange", + "value": 1 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 5, + "x": 14, + "y": 1 + }, + "id": 107, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "center", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "8.4.7", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "exemplar": true, + "expr": "max(ALERTS{sloth_id!=\"\",sloth_severity=\"ticket\",state=\"$state\"}) OR on() vector(0)", + "interval": "", + "legendFormat": "Warning alerts", + "queryType": "randomWalk", + "refId": "A" + } + ], + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "dark-purple", + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 1 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 5, + "x": 19, + "y": 1 + }, + "id": 108, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "center", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "8.4.7", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "exemplar": true, + "expr": "max(ALERTS{sloth_id!=\"\",sloth_severity=\"page\",state=\"$state\"}) OR on() vector(0)", + "interval": "", + "legendFormat": "Critical alerts", + "queryType": "randomWalk", + "refId": "A" + } + ], + "type": "stat" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 7 + }, + "id": 36, + "panels": [], + "title": "SLOs", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "description": "The burning rate of the all the Service SLOs", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "points", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "graph": false, + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "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": [] + }, + "gridPos": { + "h": 14, + "w": 15, + "x": 0, + "y": 8 + }, + "id": 56, + "options": { + "graph": {}, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right" + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "exemplar": true, + "expr": "slo:current_burn_rate:ratio{state=\"$state\"} > ${min_burning_rate}", + "interval": "", + "legendFormat": "{{sloth_id}}", + "queryType": "randomWalk", + "refId": "A" + } + ], + "title": "All burning rate (Filtered >${min_burning_rate}x)", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "description": "The SLOs that currently are burning more error budget that then available", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "displayMode": "auto", + "filterable": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Burning rate %" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "thresholds" + } + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 1 + }, + { + "color": "red", + "value": 1.1 + } + ] + } + }, + { + "id": "custom.displayMode", + "value": "color-background" + }, + { + "id": "unit", + "value": "percentunit" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Service" + }, + "properties": [ + { + "id": "custom.width", + "value": 119 + } + ] + } + ] + }, + "gridPos": { + "h": 14, + "w": 9, + "x": 15, + "y": 8 + }, + "id": 38, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "frameIndex": 0, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "Burning rate %" + } + ] + }, + "pluginVersion": "8.4.7", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "exemplar": false, + "expr": "slo:current_burn_rate:ratio{state=\"$state\"} > ${min_burning_rate}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "queryType": "randomWalk", + "refId": "A" + } + ], + "title": "Current exceeded burning rate SLOs ", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "names": [ + "sloth_service", + "sloth_slo", + "Value" + ] + } + } + }, + { + "id": "renameByRegex", + "options": { + "regex": "Value", + "renamePattern": "Burning rate %" + } + }, + { + "id": "renameByRegex", + "options": { + "regex": "sloth_service", + "renamePattern": "Service" + } + }, + { + "id": "renameByRegex", + "options": { + "regex": "sloth_slo", + "renamePattern": "SLO" + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "description": "Shows all the SLOs at the same time burning rate state", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "fillOpacity": 74, + "lineWidth": 0, + "spanNulls": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + }, + { + "color": "yellow", + "value": 1 + }, + { + "color": "red", + "value": 1.1 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 19, + "w": 15, + "x": 0, + "y": 22 + }, + "id": 100, + "options": { + "alignValue": "left", + "legend": { + "displayMode": "hidden", + "placement": "bottom" + }, + "mergeValues": true, + "rowHeight": 0.9, + "showValue": "never", + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "exemplar": true, + "expr": "max(slo:current_burn_rate:ratio{state=\"$state\"}) by (sloth_slo, sloth_service)", + "interval": "", + "legendFormat": "{{sloth_service}}/{{sloth_slo}}", + "queryType": "randomWalk", + "refId": "A" + } + ], + "title": "SLOs burn rate state timeline", + "type": "state-timeline" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "orange", + "value": 0.4 + }, + { + "color": "green", + "value": 0.7 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 19, + "w": 9, + "x": 15, + "y": 22 + }, + "id": 110, + "options": { + "displayMode": "gradient", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": true, + "text": {} + }, + "pluginVersion": "8.4.7", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "exemplar": false, + "expr": "clamp_min(\n 1-(\n sum_over_time(\n (\n sum(slo:sli_error:ratio_rate1h{state=\"$state\"}) by (sloth_id)\n )[30d:1h]\n )\n / on(sloth_id)\n (\n max(slo:error_budget:ratio{state=\"$state\"}) by (sloth_id) *on() group_left() (24 * 30)\n )\n )\nor on() vector(1), 0)", + "format": "time_series", + "instant": true, + "interval": "", + "legendFormat": "{{sloth_id}}", + "queryType": "randomWalk", + "refId": "A" + } + ], + "title": "Error Budget remaining 30-day window", + "transformations": [ + { + "id": "seriesToRows", + "options": {} + }, + { + "id": "sortBy", + "options": { + "fields": {}, + "sort": [ + { + "field": "Metric" + } + ] + } + }, + { + "id": "rowsToFields", + "options": { + "mappings": [ + { + "fieldName": "Time", + "handlerKey": "__ignore" + } + ] + } + } + ], + "type": "bargauge" + } + ], + "refresh": "30s", + "schemaVersion": 35, + "style": "dark", + "tags": [ + "service levels", + "sli", + "slo", + "sloth" + ], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "Prometheus (production)", + "value": "Prometheus (production)" + }, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "Datasource", + "options": [], + "query": "prometheus", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": { + "selected": true, + "text": "1", + "value": "1" + }, + "description": "The minimum burning budget rate (0-1) to show on the general SLOs block", + "hide": 0, + "label": "Min Burning rate", + "name": "min_burning_rate", + "options": [ + { + "selected": true, + "text": "1", + "value": "1" + } + ], + "query": "1", + "skipUrlSync": false, + "type": "textbox" + }, + { + "current": { + "selected": false, + "text": "agreed", + "value": "agreed" + }, + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "definition": "label_values(slo:objective:ratio, state)", + "hide": 0, + "includeAll": false, + "label": "State", + "multi": false, + "name": "state", + "options": [], + "query": { + "query": "label_values(slo:objective:ratio, state)", + "refId": "StandardVariableQuery" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-30d", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "SLO Overview", + "uid": "pqbHw3O7z", + "version": 7, + "weekStart": "" +} \ No newline at end of file diff --git a/aws/grafana-dashboards/main.tf b/aws/grafana-dashboards/main.tf index 18571eb6..b3d5e2bb 100644 --- a/aws/grafana-dashboards/main.tf +++ b/aws/grafana-dashboards/main.tf @@ -1,5 +1,5 @@ -resource "grafana_dashboard" "istio" { - count = var.create_istio_dashboard ? 1 : 0 +resource "grafana_dashboard" "this" { + for_each = toset(var.dashboards_to_create) - config_json = file("${path.module}/dashboards/istio.json") + config_json = file("${path.module}/dashboards/${each.value}.json") } diff --git a/aws/grafana-dashboards/variables.tf b/aws/grafana-dashboards/variables.tf index eed4c1ae..c1485294 100644 --- a/aws/grafana-dashboards/variables.tf +++ b/aws/grafana-dashboards/variables.tf @@ -1,5 +1,17 @@ -variable "create_istio_dashboard" { - description = "Create Istio dashboard" - type = bool - default = false +variable "dashboards_to_create" { + description = "List of dashboards to create (cluster-resources, istio, rds-databases, slo-details, and/or slo-overview)" + type = list(string) + + validation { + condition = length(setsubtract( + var.dashboards_to_create, + ["cluster-resources", "istio", "rds-databases", "slo-details", "slo-overview"], + )) == 0 + error_message = "Valid options for dashboards to create are: cluster-resources, istio, rds-databases, slo-details, slo-overview" + } + + validation { + condition = length(var.dashboards_to_create) > 0 + error_message = "At least one dashboard must be selected" + } }