Skip to content

Commit 1bfd810

Browse files
authored
Merge pull request #246 from qonto/feat-add-more-status
feat: add more supported status
2 parents a1a704d + 551c6de commit 1bfd810

File tree

8 files changed

+297
-121
lines changed

8 files changed

+297
-121
lines changed

README.md

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -126,25 +126,31 @@ It collects key metrics about:
126126

127127
### Supported RDS status
128128

129-
| Id | Meaning |
130-
| ---: | :----------------------------- |
131-
| 4 | Modifying |
132-
| 3 | Starting |
133-
| 2 | Backing Up |
134-
| 1 | Available |
135-
| | |
136-
| 0 | Stopped or can't scrap metrics |
137-
| | |
138-
| -1 | Unknown status reported by AWS |
139-
| -2 | Stopping |
140-
| -3 | Creating |
141-
| -4 | Deleting |
142-
| -5 | Rebooting |
143-
| -6 | Failed |
144-
| -7 | Storage Full |
145-
| -8 | Upgrading |
146-
147-
_IDs were arbitrarily chosen when building the exporter but as a rule of thumb, all ID ≤0 means that instance isn't available._
129+
| Id | Meaning |
130+
| ---: | :---------------------------------------------------------- |
131+
| 20 | Renaming, will reboot soon |
132+
| 11 | Storage optimization |
133+
| 10 | Storage initialization |
134+
| 5 | Configuring Enhanced Monitoring |
135+
| 4 | Modifying |
136+
| 3 | Starting |
137+
| 2 | Backing Up |
138+
| 1 | Available |
139+
| | |
140+
| 0 | Stopped or can't scrap metrics |
141+
| | |
142+
| -1 | Unknown status reported by AWS or unmapped by this exporter |
143+
| -2 | Stopping |
144+
| -3 | Creating |
145+
| -4 | Deleting |
146+
| -5 | Rebooting |
147+
| -6 | Failed |
148+
| -7 | Storage Full |
149+
| -8 | Upgrading |
150+
| -9 | Maintenance |
151+
| -10 | Restore error |
152+
153+
_IDs were arbitrarily chosen when building the exporter but as a rule of thumb, all ID ≤0 means that instance isn't available. [Refer to AWS Documentation for details](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/accessing-monitoring.html)_
148154

149155
## Dashboards
150156

configs/grafana/panels/instance.libsonnet

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -119,19 +119,25 @@ local colors = common.colors;
119119
+ standardOptions.withMappings([
120120
standardOptions.mapping.ValueMap.withType('value')
121121
+ standardOptions.mapping.ValueMap.withOptions({
122-
'-8': { index: 0, color: colors.info, text: 'Upgrading' },
123-
'-7': { index: 1, color: colors.danger, text: 'Storage-full' },
124-
'-6': { index: 2, color: colors.danger, text: 'Failed' },
125-
'-5': { index: 3, color: colors.warning, text: 'Rebooting' },
126-
'-4': { index: 4, color: colors.danger, text: 'Deleting' },
127-
'-3': { index: 5, color: colors.notice, text: 'Creating' },
128-
'-2': { index: 6, color: colors.notice, text: 'Stopping' },
129-
'-1': { index: 7, color: 'purple', text: 'Unknown' },
130-
'0': { index: 8, color: colors.danger, text: 'Stopped' },
131-
'1': { index: 9, color: colors.ok, text: 'Available' },
132-
'2': { index: 10, color: colors.notice, text: 'Backing-up' },
133-
'3': { index: 11, color: colors.ok, text: 'Starting' },
134-
'4': { index: 12, color: colors.info, text: 'Modifying' },
122+
'-10': { index: 0, color: colors.danger, text: 'Restore error' },
123+
'-9': { index: 1, color: colors.warning, text: 'Maintenance' },
124+
'-8': { index: 2, color: colors.info, text: 'Upgrading' },
125+
'-7': { index: 3, color: colors.danger, text: 'Storage-full' },
126+
'-6': { index: 4, color: colors.danger, text: 'Failed' },
127+
'-5': { index: 5, color: colors.warning, text: 'Rebooting' },
128+
'-4': { index: 6, color: colors.danger, text: 'Deleting' },
129+
'-3': { index: 7, color: colors.notice, text: 'Creating' },
130+
'-2': { index: 8, color: colors.notice, text: 'Stopping' },
131+
'-1': { index: 9, color: 'purple', text: 'Unknown' },
132+
'0': { index: 10, color: colors.danger, text: 'Stopped' },
133+
'1': { index: 11, color: colors.ok, text: 'Available' },
134+
'2': { index: 12, color: colors.notice, text: 'Backing-up' },
135+
'3': { index: 13, color: colors.ok, text: 'Starting' },
136+
'4': { index: 14, color: colors.info, text: 'Modifying' },
137+
'5': { index: 15, color: colors.info, text: 'Configuring enhanced monitoring' },
138+
'10': { index: 16, colors: colors.info, text: 'Storage initialization' },
139+
'11': { index: 17, colors: colors.notice, text: 'Storage optimization' },
140+
'20': { index: 18, colors: colors.notice, text: 'Renaming' },
135141
}),
136142
]),
137143
},
@@ -464,19 +470,25 @@ local colors = common.colors;
464470
+ standardOptions.withMappings([
465471
standardOptions.mapping.ValueMap.withType('value')
466472
+ standardOptions.mapping.ValueMap.withOptions({
467-
'-8': { index: 0, color: colors.info, text: 'Upgrading' },
468-
'-7': { index: 1, color: colors.danger, text: 'Storage-full' },
469-
'-6': { index: 2, color: colors.danger, text: 'Failed' },
470-
'-5': { index: 3, color: colors.warning, text: 'Rebooting' },
471-
'-4': { index: 4, color: colors.danger, text: 'Deleting' },
472-
'-3': { index: 5, color: colors.notice, text: 'Creating' },
473-
'-2': { index: 6, color: colors.notice, text: 'Stopping' },
474-
'-1': { index: 7, color: 'purple', text: 'Unknown' },
475-
'0': { index: 8, color: colors.danger, text: 'Stopped' },
476-
'1': { index: 9, color: colors.ok, text: 'Available' },
477-
'2': { index: 10, color: colors.notice, text: 'Backing-up' },
478-
'3': { index: 11, color: colors.ok, text: 'Starting' },
479-
'4': { index: 12, color: colors.info, text: 'Modifying' },
473+
'-10': { index: 0, color: colors.danger, text: 'Restore error' },
474+
'-9': { index: 1, color: colors.warning, text: 'Maintenance' },
475+
'-8': { index: 2, color: colors.info, text: 'Upgrading' },
476+
'-7': { index: 3, color: colors.danger, text: 'Storage-full' },
477+
'-6': { index: 4, color: colors.danger, text: 'Failed' },
478+
'-5': { index: 5, color: colors.warning, text: 'Rebooting' },
479+
'-4': { index: 6, color: colors.danger, text: 'Deleting' },
480+
'-3': { index: 7, color: colors.notice, text: 'Creating' },
481+
'-2': { index: 8, color: colors.notice, text: 'Stopping' },
482+
'-1': { index: 9, color: 'purple', text: 'Unknown' },
483+
'0': { index: 10, color: colors.danger, text: 'Stopped' },
484+
'1': { index: 11, color: colors.ok, text: 'Available' },
485+
'2': { index: 12, color: colors.notice, text: 'Backing-up' },
486+
'3': { index: 13, color: colors.ok, text: 'Starting' },
487+
'4': { index: 14, color: colors.info, text: 'Modifying' },
488+
'5': { index: 15, color: colors.info, text: 'Configuring enhanced monitoring' },
489+
'10': { index: 16, colors: colors.info, text: 'Storage initialization' },
490+
'11': { index: 17, colors: colors.notice, text: 'Storage optimization' },
491+
'20': { index: 18, colors: colors.notice, text: 'Renaming' },
480492
}),
481493
])
482494
+ standardOptions.withMin(null)

configs/grafana/public/rds-instance.json

Lines changed: 154 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,23 +1081,98 @@
10811081
"options": {
10821082
"-1": {
10831083
"color": "purple",
1084-
"index": 0,
1084+
"index": 9,
10851085
"text": "Unknown"
10861086
},
1087-
"0": {
1087+
"-10": {
1088+
"color": "red",
1089+
"index": 0,
1090+
"text": "Restore error"
1091+
},
1092+
"-2": {
1093+
"color": "yellow",
1094+
"index": 8,
1095+
"text": "Stopping"
1096+
},
1097+
"-3": {
1098+
"color": "yellow",
1099+
"index": 7,
1100+
"text": "Creating"
1101+
},
1102+
"-4": {
1103+
"color": "red",
1104+
"index": 6,
1105+
"text": "Deleting"
1106+
},
1107+
"-5": {
1108+
"color": "orange",
1109+
"index": 5,
1110+
"text": "Rebooting"
1111+
},
1112+
"-6": {
1113+
"color": "red",
1114+
"index": 4,
1115+
"text": "Failed"
1116+
},
1117+
"-7": {
10881118
"color": "red",
1119+
"index": 3,
1120+
"text": "Storage-full"
1121+
},
1122+
"-8": {
1123+
"color": "blue",
1124+
"index": 2,
1125+
"text": "Upgrading"
1126+
},
1127+
"-9": {
1128+
"color": "orange",
10891129
"index": 1,
1130+
"text": "Maintenance"
1131+
},
1132+
"0": {
1133+
"color": "red",
1134+
"index": 10,
10901135
"text": "Stopped"
10911136
},
10921137
"1": {
10931138
"color": "green",
1094-
"index": 2,
1139+
"index": 11,
10951140
"text": "Available"
10961141
},
1142+
"10": {
1143+
"colors": "blue",
1144+
"index": 16,
1145+
"text": "Storage initialization"
1146+
},
1147+
"11": {
1148+
"colors": "yellow",
1149+
"index": 17,
1150+
"text": "Storage optimization"
1151+
},
10971152
"2": {
10981153
"color": "yellow",
1099-
"index": 3,
1154+
"index": 12,
11001155
"text": "Backing-up"
1156+
},
1157+
"20": {
1158+
"colors": "yellow",
1159+
"index": 18,
1160+
"text": "Renaming"
1161+
},
1162+
"3": {
1163+
"color": "green",
1164+
"index": 13,
1165+
"text": "Starting"
1166+
},
1167+
"4": {
1168+
"color": "blue",
1169+
"index": 14,
1170+
"text": "Modifying"
1171+
},
1172+
"5": {
1173+
"color": "blue",
1174+
"index": 15,
1175+
"text": "Configuring enhanced monitoring"
11011176
}
11021177
},
11031178
"type": "value"
@@ -2262,34 +2337,99 @@
22622337
{
22632338
"options": {
22642339
"-1": {
2265-
"color": "yellow",
2266-
"index": -1,
2340+
"color": "purple",
2341+
"index": 9,
22672342
"text": "Unknown"
22682343
},
2344+
"-10": {
2345+
"color": "red",
2346+
"index": 0,
2347+
"text": "Restore error"
2348+
},
22692349
"-2": {
2270-
"color": "orange",
2271-
"index": -2,
2350+
"color": "yellow",
2351+
"index": 8,
22722352
"text": "Stopping"
22732353
},
2274-
"0": {
2354+
"-3": {
2355+
"color": "yellow",
2356+
"index": 7,
2357+
"text": "Creating"
2358+
},
2359+
"-4": {
2360+
"color": "red",
2361+
"index": 6,
2362+
"text": "Deleting"
2363+
},
2364+
"-5": {
2365+
"color": "orange",
2366+
"index": 5,
2367+
"text": "Rebooting"
2368+
},
2369+
"-6": {
2370+
"color": "red",
2371+
"index": 4,
2372+
"text": "Failed"
2373+
},
2374+
"-7": {
2375+
"color": "red",
2376+
"index": 3,
2377+
"text": "Storage-full"
2378+
},
2379+
"-8": {
2380+
"color": "blue",
2381+
"index": 2,
2382+
"text": "Upgrading"
2383+
},
2384+
"-9": {
22752385
"color": "orange",
2276-
"index": -1,
2386+
"index": 1,
2387+
"text": "Maintenance"
2388+
},
2389+
"0": {
2390+
"color": "red",
2391+
"index": 10,
22772392
"text": "Stopped"
22782393
},
22792394
"1": {
22802395
"color": "green",
2281-
"index": -1,
2396+
"index": 11,
22822397
"text": "Available"
22832398
},
2399+
"10": {
2400+
"colors": "blue",
2401+
"index": 16,
2402+
"text": "Storage initialization"
2403+
},
2404+
"11": {
2405+
"colors": "yellow",
2406+
"index": 17,
2407+
"text": "Storage optimization"
2408+
},
22842409
"2": {
22852410
"color": "yellow",
2286-
"index": -1,
2411+
"index": 12,
22872412
"text": "Backing-up"
22882413
},
2414+
"20": {
2415+
"colors": "yellow",
2416+
"index": 18,
2417+
"text": "Renaming"
2418+
},
22892419
"3": {
2290-
"color": "orange",
2291-
"index": -1,
2420+
"color": "green",
2421+
"index": 13,
22922422
"text": "Starting"
2423+
},
2424+
"4": {
2425+
"color": "blue",
2426+
"index": 14,
2427+
"text": "Modifying"
2428+
},
2429+
"5": {
2430+
"color": "blue",
2431+
"index": 15,
2432+
"text": "Configuring enhanced monitoring"
22932433
}
22942434
},
22952435
"type": "value"

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/qonto/prometheus-rds-exporter
22

3-
go 1.22.0
3+
go 1.23.0
44

55
toolchain go1.23.2
66

@@ -68,9 +68,9 @@ require (
6868
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect
6969
go.opentelemetry.io/otel/metric v1.34.0 // indirect
7070
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
71-
golang.org/x/net v0.34.0 // indirect
72-
golang.org/x/sys v0.29.0 // indirect
73-
golang.org/x/text v0.21.0 // indirect
71+
golang.org/x/net v0.37.0 // indirect
72+
golang.org/x/sys v0.31.0 // indirect
73+
golang.org/x/text v0.23.0 // indirect
7474
google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f // indirect
7575
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
7676
google.golang.org/grpc v1.69.4 // indirect

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,12 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
140140
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
141141
golang.org/x/exp v0.0.0-20231127185646-65229373498e h1:Gvh4YaCaXNs6dKTlfgismwWZKyjVZXwOPfIyUaqU3No=
142142
golang.org/x/exp v0.0.0-20231127185646-65229373498e/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI=
143-
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
144-
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
145-
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
146-
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
147-
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
148-
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
143+
golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c=
144+
golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
145+
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
146+
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
147+
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
148+
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
149149
google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f h1:gap6+3Gk41EItBuyi4XX/bp4oqJ3UwuIMl25yGinuAA=
150150
google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:Ic02D47M+zbarjYYUlK57y316f2MoN0gjAwI3f2S95o=
151151
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f h1:OxYkA3wjPsZyBylwymxSHa7ViiW1Sml4ToBrncvFehI=

internal/app/exporter/exporter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ func NewCollector(logger slog.Logger, collectorConfiguration Configuration, awsA
183183
[]string{"aws_account_id", "aws_region", "dbidentifier"}, nil,
184184
),
185185
status: prometheus.NewDesc("rds_instance_status",
186-
"Instance status (0 stopped or can't scrape) (1 ok | 2 backup | 3 startup | 4 modify) (-1 unknown | -2 stopping | -3 creating | -4 deleting | -5 rebooting | -6 failed | -7 full storage | -8 upgrading )",
186+
"Instance status (0 stopped or can't scrape) (1 ok | 2 backup | 3 startup | 4 modify | 5 monitoring config | 1X storage | 20 renaming) (-1 unknown | -2 stopping | -3 creating | -4 deleting | -5 rebooting | -6 failed | -7 full storage | -8 upgrading | -9 maintenance | -10 restore error)",
187187
[]string{"aws_account_id", "aws_region", "dbidentifier"}, nil,
188188
),
189189
logFilesSize: prometheus.NewDesc("rds_instance_log_files_size_bytes",

0 commit comments

Comments
 (0)