Skip to content

Commit fe3762e

Browse files
Merge pull request #379 from vbhavsar/vishal/execution-succeeded
feat: add ExecutionSucceeded as a valid metric
2 parents 6a765b5 + 820e298 commit fe3762e

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ stepFunctions:
126126
- executionsAborted
127127
- metric: executionThrottled
128128
treatMissingData: breaching # overrides below default
129+
- executionsSucceeded
129130
treatMissingData: ignore # optional
130131
hellostepfunc2:
131132
definition:
@@ -254,6 +255,7 @@ stepFunctions:
254255
- executionsFailed
255256
- executionsAborted
256257
- executionThrottled
258+
- executionSucceeded
257259
treatMissingData: missing
258260
```
259261

@@ -298,6 +300,7 @@ alarms:
298300
- executionsAborted
299301
- metric: executionThrottled
300302
treatMissingData: breaching # override
303+
- executionsSucceeded
301304
treatMissingData: ignore # default
302305
```
303306

lib/deploy/stepFunctions/compileAlarms.js

+2
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ const cloudWatchMetricNames = {
1010
executionsFailed: 'ExecutionsFailed',
1111
executionsAborted: 'ExecutionsAborted',
1212
executionThrottled: 'ExecutionThrottled',
13+
executionSucceeded: 'ExecutionSucceeded',
1314
};
1415

1516
const alarmDescriptions = {
1617
executionsTimedOut: 'executions timed out',
1718
executionsFailed: 'executions failed',
1819
executionsAborted: 'executions were aborted',
1920
executionThrottled: 'execution were throttled',
21+
executionSucceeded: 'execution succeeded',
2022
};
2123

2224
function getCloudWatchAlarms(

lib/deploy/stepFunctions/compileAlarms.schema.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ const treatMissingData = Joi.string()
2121
.default('missing');
2222

2323
const simpleMetric = Joi.string()
24-
.allow('executionsTimedOut', 'executionsFailed', 'executionsAborted', 'executionThrottled');
24+
.allow('executionsTimedOut', 'executionsFailed', 'executionsAborted', 'executionThrottled',
25+
'executionSucceeded');
2526

2627
const complexMetric = Joi.object().keys({
2728
metric: simpleMetric.required(),

lib/deploy/stepFunctions/compileAlarms.test.js

+3
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ describe('#compileAlarms', () => {
6464
'executionsFailed',
6565
'executionsAborted',
6666
'executionThrottled',
67+
'executionSucceeded',
6768
],
6869
},
6970
});
@@ -296,6 +297,7 @@ describe('#compileAlarms', () => {
296297
'executionsFailed',
297298
'executionsAborted',
298299
'executionThrottled',
300+
'executionSucceeded',
299301
],
300302
treatMissingData: 'ignore',
301303
},
@@ -352,6 +354,7 @@ describe('#compileAlarms', () => {
352354
{ metric: 'executionsFailed', treatMissingData: 'breaching' },
353355
'executionsAborted',
354356
'executionThrottled',
357+
'executionSucceeded',
355358
],
356359
treatMissingData: 'ignore',
357360
},

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
"mocha-param": "^2.0.0",
4141
"nyc": "^15.0.0",
4242
"semantic-release": "^15.14.0",
43-
"sinon": "^1.17.5",
44-
"serverless": "^1.72.0"
43+
"serverless": "^1.72.0",
44+
"sinon": "^1.17.5"
4545
},
4646
"dependencies": {
4747
"@hapi/joi": "^15.0.2",

0 commit comments

Comments
 (0)