Skip to content

feat: add ExecutionSucceeded as a valid metric #379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ stepFunctions:
- executionsAborted
- metric: executionThrottled
treatMissingData: breaching # overrides below default
- executionsSucceeded
treatMissingData: ignore # optional
hellostepfunc2:
definition:
Expand Down Expand Up @@ -254,6 +255,7 @@ stepFunctions:
- executionsFailed
- executionsAborted
- executionThrottled
- executionSucceeded
treatMissingData: missing
```

Expand Down Expand Up @@ -298,6 +300,7 @@ alarms:
- executionsAborted
- metric: executionThrottled
treatMissingData: breaching # override
- executionsSucceeded
treatMissingData: ignore # default
```

Expand Down
2 changes: 2 additions & 0 deletions lib/deploy/stepFunctions/compileAlarms.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ const cloudWatchMetricNames = {
executionsFailed: 'ExecutionsFailed',
executionsAborted: 'ExecutionsAborted',
executionThrottled: 'ExecutionThrottled',
executionSucceeded: 'ExecutionSucceeded',
};

const alarmDescriptions = {
executionsTimedOut: 'executions timed out',
executionsFailed: 'executions failed',
executionsAborted: 'executions were aborted',
executionThrottled: 'execution were throttled',
executionSucceeded: 'execution succeeded',
};

function getCloudWatchAlarms(
Expand Down
3 changes: 2 additions & 1 deletion lib/deploy/stepFunctions/compileAlarms.schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const treatMissingData = Joi.string()
.default('missing');

const simpleMetric = Joi.string()
.allow('executionsTimedOut', 'executionsFailed', 'executionsAborted', 'executionThrottled');
.allow('executionsTimedOut', 'executionsFailed', 'executionsAborted', 'executionThrottled',
'executionSucceeded');

const complexMetric = Joi.object().keys({
metric: simpleMetric.required(),
Expand Down
3 changes: 3 additions & 0 deletions lib/deploy/stepFunctions/compileAlarms.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ describe('#compileAlarms', () => {
'executionsFailed',
'executionsAborted',
'executionThrottled',
'executionSucceeded',
],
},
});
Expand Down Expand Up @@ -296,6 +297,7 @@ describe('#compileAlarms', () => {
'executionsFailed',
'executionsAborted',
'executionThrottled',
'executionSucceeded',
],
treatMissingData: 'ignore',
},
Expand Down Expand Up @@ -352,6 +354,7 @@ describe('#compileAlarms', () => {
{ metric: 'executionsFailed', treatMissingData: 'breaching' },
'executionsAborted',
'executionThrottled',
'executionSucceeded',
],
treatMissingData: 'ignore',
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"mocha-param": "^2.0.0",
"nyc": "^15.0.0",
"semantic-release": "^15.14.0",
"sinon": "^1.17.5",
"serverless": "^1.72.0"
"serverless": "^1.72.0",
"sinon": "^1.17.5"
},
"dependencies": {
"@hapi/joi": "^15.0.2",
Expand Down