Skip to content

Commit d5dbf7a

Browse files
authored
Steve/lpx 369 increase yolo queue depth alarm settings (#8)
* expose queue configuration in manifest and change to Average statistic * update tenant queue alarm * fix key * rename keys
1 parent 7341024 commit d5dbf7a

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ environments:
245245
security-group:
246246
codedeploy:
247247
strategy: without-load-balancing|with-load-balancing
248+
queue:
249+
depth-alarm-evaluation-periods: 3
250+
depth-alarm-period: 300
251+
depth-alarm-threshold: 100
248252

249253
asset-url: # defaults to aws.cloudfront
250254
mysqldump: false

src/Steps/Standalone/SyncQueueAlarmStep.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Codinglabs\Yolo\Aws;
66
use Illuminate\Support\Arr;
77
use Codinglabs\Yolo\Helpers;
8+
use Codinglabs\Yolo\Manifest;
89
use Codinglabs\Yolo\AwsResources;
910
use Codinglabs\Yolo\Contracts\Step;
1011
use Codinglabs\Yolo\Enums\StepResult;
@@ -40,12 +41,12 @@ public function __invoke(array $options): StepResult
4041
'Value' => Helpers::keyedResourceName(),
4142
],
4243
],
43-
'EvaluationPeriods' => 3, // number of breached of Period before alarm
44+
'EvaluationPeriods' => Manifest::get('aws.queue.depth-alarm-evaluation-periods', 3), // number of breaches of the Period before alarm
4445
'MetricName' => 'ApproximateNumberOfMessagesVisible',
4546
'Namespace' => 'AWS/SQS',
46-
'Period' => 300, // time to evaluate the metric
47-
'Statistic' => 'Sum',
48-
'Threshold' => 100,
47+
'Period' => Manifest::get('aws.queue.depth-alarm-period', 300), // time to evaluate the metric
48+
'Statistic' => 'Average',
49+
'Threshold' => Manifest::get('aws.queue.depth-alarm-threshold', 100),
4950
'TreatMissingData' => 'notBreaching',
5051
'AlarmActions' => [$snsTopic['TopicArn']],
5152
'OKActions' => [$snsTopic['TopicArn']],

src/Steps/Tenant/SyncQueueAlarmStep.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Codinglabs\Yolo\Aws;
66
use Illuminate\Support\Arr;
77
use Codinglabs\Yolo\Helpers;
8+
use Codinglabs\Yolo\Manifest;
89
use Codinglabs\Yolo\AwsResources;
910
use Codinglabs\Yolo\Enums\StepResult;
1011
use Codinglabs\Yolo\Steps\TenantStep;
@@ -40,12 +41,12 @@ public function __invoke(array $options): StepResult
4041
'Value' => Helpers::keyedResourceName($this->tenantId()),
4142
],
4243
],
43-
'EvaluationPeriods' => 3, // number of breached of Period before alarm
44+
'EvaluationPeriods' => Manifest::get('aws.queue.depth-alarm-evaluation-periods', 3), // number of breaches of the Period before alarm
4445
'MetricName' => 'ApproximateNumberOfMessagesVisible',
4546
'Namespace' => 'AWS/SQS',
46-
'Period' => 300, // time to evaluate the metric
47-
'Statistic' => 'Sum',
48-
'Threshold' => 100,
47+
'Period' => Manifest::get('aws.queue.depth-alarm-period', 300), // time to evaluate the metric
48+
'Statistic' => 'Average',
49+
'Threshold' => Manifest::get('aws.queue.depth-alarm-threshold', 100),
4950
'TreatMissingData' => 'notBreaching',
5051
'AlarmActions' => [$snsTopic['TopicArn']],
5152
'OKActions' => [$snsTopic['TopicArn']],

0 commit comments

Comments
 (0)