Skip to content

Commit

Permalink
feat(grafana): Add RDS instance baseline/burst information
Browse files Browse the repository at this point in the history
  • Loading branch information
vmercierfr committed May 24, 2024
1 parent 93a4d24 commit 08f27ff
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 17 deletions.
30 changes: 25 additions & 5 deletions configs/grafana/panels/instance.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ local colors = common.colors;
]),

diskIOPSScaling:
ts.base('Disk IOPS', "Regardless of the allocated disk IOPS, the EC2 instance behind RDS also has disk IOPS limits. You can't use more IOPS than EC2's instance limit", [queries.instance.disk.iops.usage, queries.instance.disk.iops.max, queries.instance.disk.iops.instanceTypeMax])
ts.base('Disk IOPS', "Regardless of the allocated disk IOPS, the EC2 instance behind RDS also has disk IOPS limits. You can't use more IOPS than EC2's instance limit. Burst IOPS are supported 30 minutes at least once every 24 hours.", [queries.instance.disk.iops.usage, queries.instance.disk.iops.max, queries.instance.disk.iops.instanceTypeBaseline, queries.instance.disk.iops.instanceTypeBurst])
+ options.legend.withSortBy('Max')
+ options.legend.withSortDesc(true)
+ standardOptions.withUnit('locale')
+ standardOptions.withOverrides([
fieldOverride.byName.new('Max')
Expand All @@ -170,7 +172,15 @@ local colors = common.colors;
+ standardOptions.withDisplayName('Allocated')
+ custom.withFillOpacity(0)
),
fieldOverride.byRegexp.new('Instance type limit.*')
fieldOverride.byRegexp.new('.* burst')
+ standardOptions.override.byType.withPropertiesFromOptions(
timeSeries.fieldConfig.defaults.custom.lineStyle.withDash([10, 10])
+ timeSeries.fieldConfig.defaults.custom.lineStyle.withFill('dash')
+ color.withMode('fixed')
+ color.withFixedColor(colors.limit)
+ custom.withFillOpacity(0)
),
fieldOverride.byRegexp.new('.* baseline')
+ standardOptions.override.byType.withPropertiesFromOptions(
color.withMode('fixed')
+ color.withFixedColor(colors.limit)
Expand All @@ -179,17 +189,27 @@ local colors = common.colors;
]),

diskThroughputScaling:
ts.base('Disk throughput', "Regardless of the allocated disk throughput, the EC2 instance behind RDS also has disk throughput limits. You can't use more throughput than EC2's instance limit", [queries.instance.disk.throughput.usage, queries.instance.disk.throughput.max, queries.instance.disk.throughput.instanceTypeMax])
ts.base('Disk throughput', "Regardless of the allocated disk throughput, the EC2 instance behind RDS also has disk throughput limits. You can't use more throughput than EC2's instance limit. Burst throughput is supported 30 minutes at least once every 24 hours.", [queries.instance.disk.throughput.usage, queries.instance.disk.throughput.max, queries.instance.disk.throughput.instanceTypeBaseline, queries.instance.disk.throughput.instanceTypeBurst])
+ options.legend.withSortBy('Max')
+ options.legend.withSortDesc(true)
+ standardOptions.withUnit('bytes')
+ standardOptions.withOverrides([
fieldOverride.byName.new('Max')
+ standardOptions.override.byType.withPropertiesFromOptions(
color.withMode('fixed')
+ standardOptions.withDisplayName('Allocated')
+ color.withFixedColor(colors.warning)
+ standardOptions.withDisplayName('Allocated')
+ custom.withFillOpacity(0)
),
fieldOverride.byRegexp.new('.* burst')
+ standardOptions.override.byType.withPropertiesFromOptions(
timeSeries.fieldConfig.defaults.custom.lineStyle.withDash([10, 10])
+ timeSeries.fieldConfig.defaults.custom.lineStyle.withFill('dash')
+ color.withMode('fixed')
+ color.withFixedColor(colors.limit)
+ custom.withFillOpacity(0)
),
fieldOverride.byRegexp.new('Instance type limit.*')
fieldOverride.byRegexp.new('.* baseline')
+ standardOptions.override.byType.withPropertiesFromOptions(
color.withMode('fixed')
+ color.withFixedColor(colors.limit)
Expand Down
94 changes: 86 additions & 8 deletions configs/grafana/public/rds-instance.json
Original file line number Diff line number Diff line change
Expand Up @@ -2551,7 +2551,7 @@
"type": "datasource",
"uid": "-- Mixed --"
},
"description": "Regardless of the allocated disk IOPS, the EC2 instance behind RDS also has disk IOPS limits. You can't use more IOPS than EC2's instance limit",
"description": "Regardless of the allocated disk IOPS, the EC2 instance behind RDS also has disk IOPS limits. You can't use more IOPS than EC2's instance limit. Burst IOPS are supported 30 minutes at least once every 24 hours.",
"fieldConfig": {
"defaults": {
"custom": {
Expand Down Expand Up @@ -2588,7 +2588,36 @@
{
"matcher": {
"id": "byRegexp",
"options": "Instance type limit.*"
"options": ".* burst"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "red",
"mode": "fixed"
}
},
{
"id": "custom.fillOpacity",
"value": 0
},
{
"id": "custom.lineStyle",
"value": {
"dash": [
10,
10
],
"fill": "dash"
}
}
]
},
{
"matcher": {
"id": "byRegexp",
"options": ".* baseline"
},
"properties": [
{
Expand Down Expand Up @@ -2621,7 +2650,9 @@
"max"
],
"displayMode": "table",
"placement": "right"
"placement": "right",
"sortBy": "Max",
"sortDesc": true
}
},
"pluginVersion": "v10.2.0",
Expand All @@ -2642,13 +2673,21 @@
"expr": "max(rds_max_disk_iops_average{aws_account_id=\"$aws_account_id\",aws_region=\"$aws_region\",dbidentifier=\"$dbidentifier\"})\n",
"legendFormat": "Max"
},
{
"datasource": {
"type": "prometheus",
"uid": "$datasource"
},
"expr": "max(\n max(rds_instance_baseline_iops_average{}) by (instance_class)\n * on (instance_class)\n group_left(aws_account_id,aws_region,dbidentifier)\n max(rds_instance_info{aws_account_id=\"$aws_account_id\",aws_region=\"$aws_region\",dbidentifier=\"$dbidentifier\"}) by (aws_account_id, aws_region, dbidentifier, instance_class)\n) by (instance_class)\n",
"legendFormat": "{{instance_class}} baseline"
},
{
"datasource": {
"type": "prometheus",
"uid": "$datasource"
},
"expr": "max(\n max(rds_instance_max_iops_average{}) by (instance_class)\n * on (instance_class)\n group_left(aws_account_id,aws_region,dbidentifier)\n max(rds_instance_info{aws_account_id=\"$aws_account_id\",aws_region=\"$aws_region\",dbidentifier=\"$dbidentifier\"}) by (aws_account_id, aws_region, dbidentifier, instance_class)\n) by (instance_class)\n",
"legendFormat": "Instance type limit ({{instance_class}})"
"legendFormat": "{{instance_class}} burst"
}
],
"title": "Disk IOPS",
Expand Down Expand Up @@ -2734,7 +2773,7 @@
"type": "datasource",
"uid": "-- Mixed --"
},
"description": "Regardless of the allocated disk throughput, the EC2 instance behind RDS also has disk throughput limits. You can't use more throughput than EC2's instance limit",
"description": "Regardless of the allocated disk throughput, the EC2 instance behind RDS also has disk throughput limits. You can't use more throughput than EC2's instance limit. Burst throughput is supported 30 minutes at least once every 24 hours.",
"fieldConfig": {
"defaults": {
"custom": {
Expand Down Expand Up @@ -2771,7 +2810,36 @@
{
"matcher": {
"id": "byRegexp",
"options": "Instance type limit.*"
"options": ".* burst"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "red",
"mode": "fixed"
}
},
{
"id": "custom.fillOpacity",
"value": 0
},
{
"id": "custom.lineStyle",
"value": {
"dash": [
10,
10
],
"fill": "dash"
}
}
]
},
{
"matcher": {
"id": "byRegexp",
"options": ".* baseline"
},
"properties": [
{
Expand Down Expand Up @@ -2804,7 +2872,9 @@
"max"
],
"displayMode": "table",
"placement": "right"
"placement": "right",
"sortBy": "Max",
"sortDesc": true
}
},
"pluginVersion": "v10.2.0",
Expand All @@ -2825,13 +2895,21 @@
"expr": "max(rds_max_storage_throughput_bytes{dbidentifier=\"$dbidentifier\"})\n",
"legendFormat": "Max"
},
{
"datasource": {
"type": "prometheus",
"uid": "$datasource"
},
"expr": "max(\nmax(rds_instance_baseline_throughput_bytes{}) by (instance_class)\n* on (instance_class)\ngroup_left(aws_account_id,aws_region,dbidentifier)\nmax(rds_instance_info{aws_account_id=\"$aws_account_id\",aws_region=\"$aws_region\",dbidentifier=\"$dbidentifier\"}) by (aws_account_id, aws_region, dbidentifier, instance_class)\n) by (instance_class)\n",
"legendFormat": "{{instance_class}} baseline"
},
{
"datasource": {
"type": "prometheus",
"uid": "$datasource"
},
"expr": "max(\nmax(rds_instance_max_throughput_bytes{}) by (instance_class)\n* on (instance_class)\ngroup_left(aws_account_id,aws_region,dbidentifier)\nmax(rds_instance_info{aws_account_id=\"$aws_account_id\",aws_region=\"$aws_region\",dbidentifier=\"$dbidentifier\"}) by (aws_account_id, aws_region, dbidentifier, instance_class)\n) by (instance_class)\n",
"legendFormat": "Instance type limit ({{instance_class}})"
"legendFormat": "{{instance_class}} burst"
}
],
"title": "Disk throughput",
Expand Down
37 changes: 33 additions & 4 deletions configs/grafana/queries/instance.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ local variables = import '../variables.libsonnet';
|||
)
+ prometheusQuery.withLegendFormat('Usage'),
instanceTypeMax:

instanceTypeBurst:
prometheusQuery.new(
'$' + variables.datasource.name,
|||
Expand All @@ -232,7 +233,21 @@ local variables = import '../variables.libsonnet';
) by (instance_class)
|||
)
+ prometheusQuery.withLegendFormat('Instance type limit ({{instance_class}})'),
+ prometheusQuery.withLegendFormat('{{instance_class}} burst'),

instanceTypeBaseline:
prometheusQuery.new(
'$' + variables.datasource.name,
|||
max(
max(rds_instance_baseline_iops_average{}) by (instance_class)
* on (instance_class)
group_left(aws_account_id,aws_region,dbidentifier)
max(rds_instance_info{aws_account_id="$aws_account_id",aws_region="$aws_region",dbidentifier="$dbidentifier"}) by (aws_account_id, aws_region, dbidentifier, instance_class)
) by (instance_class)
|||
)
+ prometheusQuery.withLegendFormat('{{instance_class}} baseline'),
},
throughput: {
read:
Expand Down Expand Up @@ -272,7 +287,7 @@ local variables = import '../variables.libsonnet';
)
+ prometheusQuery.withLegendFormat('Max'),

instanceTypeMax:
instanceTypeBurst:
prometheusQuery.new(
'$' + variables.datasource.name,
|||
Expand All @@ -284,7 +299,21 @@ local variables = import '../variables.libsonnet';
) by (instance_class)
|||
)
+ prometheusQuery.withLegendFormat('Instance type limit ({{instance_class}})'),
+ prometheusQuery.withLegendFormat('{{instance_class}} burst'),

instanceTypeBaseline:
prometheusQuery.new(
'$' + variables.datasource.name,
|||
max(
max(rds_instance_baseline_throughput_bytes{}) by (instance_class)
* on (instance_class)
group_left(aws_account_id,aws_region,dbidentifier)
max(rds_instance_info{aws_account_id="$aws_account_id",aws_region="$aws_region",dbidentifier="$dbidentifier"}) by (aws_account_id, aws_region, dbidentifier, instance_class)
) by (instance_class)
|||
)
+ prometheusQuery.withLegendFormat('{{instance_class}} baseline'),
},
},
memory: {
Expand Down

0 comments on commit 08f27ff

Please sign in to comment.