use of com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest in project Synapse-Stack-Builder by Sage-Bionetworks.
the class ElbAlarmSetup method createAlarms.
public void createAlarms(EnvironmentDescription ed) throws InterruptedException {
String topicArn = resources.getStackInstanceNotificationTopicArn();
LoadBalancer loadBalancer = getLoadBalancerFromEnvironmentName(ed.getEnvironmentName());
List<PutMetricAlarmRequest> reqs = createAllPutMetricAlarmRequests(ed.getEnvironmentName(), loadBalancer.getName(), topicArn);
for (PutMetricAlarmRequest req : reqs) {
this.cloudWatchClient.putMetricAlarm(req);
}
}
use of com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest in project Synapse-Stack-Builder by Sage-Bionetworks.
the class ElbAlarmSetup method createUnhealthyInstancesPutMetricAlarmRequest.
public static PutMetricAlarmRequest createUnhealthyInstancesPutMetricAlarmRequest(String prefix, String loadBalancerName, String topicArn) {
PutMetricAlarmRequest req = createDefaultPutMetricAlarmRequest(loadBalancerName, topicArn);
req.setAlarmName(prefix + "-unlhealthy-instance-count-alarm");
req.setStatistic(STATISTIC_MAX);
req.setMetricName(METRIC_UNHEALTHY_COUNT);
req.setComparisonOperator(ComparisonOperator.GreaterThanThreshold);
req.setThreshold(new Double(0));
req.setEvaluationPeriods(2);
req.setPeriod(FIVE_MINUTES_IN_SECONDS);
return req;
}
use of com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest in project onebusaway-application-modules by camsys.
the class DatabaseAlarmsImpl method createRdsReadLatencyAlarm.
@Override
public void createRdsReadLatencyAlarm(String dbInstance) {
PutMetricAlarmRequest putMetricAlarmRequest = getRDSMetricAlarmRequest(MetricName.ReadLatency, "RdsReadLatency", dbInstance);
putMetricAlarmRequest.setAlarmActions(getCriticalAction());
putMetricAlarmRequest.setUnit(StandardUnit.Count);
putMetricAlarmRequest.setThreshold(_configService.getConfigurationValueAsDouble("alarm.dbReadLatency", 0.3d));
_cloudWatchService.publishAlarm(putMetricAlarmRequest);
}
use of com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest in project onebusaway-application-modules by camsys.
the class DatabaseAlarmsImpl method createRdsLowStorageAlarm.
@Override
public void createRdsLowStorageAlarm(String dbInstance) {
PutMetricAlarmRequest putMetricAlarmRequest = getRDSMetricAlarmRequest(MetricName.FreeStorageSpace, "RdsLowStorageSpace", dbInstance);
putMetricAlarmRequest.setAlarmActions(getCriticalAction());
putMetricAlarmRequest.setUnit(StandardUnit.Count);
putMetricAlarmRequest.setThreshold(_configService.getConfigurationValueAsDouble("alarm.dbFreeStorageSpace", 3000000000d));
putMetricAlarmRequest.setComparisonOperator(ComparisonOperator.LessThanThreshold);
_cloudWatchService.publishAlarm(putMetricAlarmRequest);
}
use of com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest in project onebusaway-application-modules by camsys.
the class GtfsRtAlarmsImpl method createMessagesDelayedAlarm.
@Override
public void createMessagesDelayedAlarm() {
PutMetricAlarmRequest putMetricAlarmRequest = getSQSMetricAlarmRequest(MetricName.NumberOfMessagesDelayed, getSqsQueue());
putMetricAlarmRequest.setAlarmActions(getCriticalAction());
putMetricAlarmRequest.setInsufficientDataActions(getCriticalAction());
putMetricAlarmRequest.setThreshold(_configService.getConfigurationValueAsDouble("alarm.sqsNumMessagesDelayed", 1d));
_cloudWatchService.publishAlarm(putMetricAlarmRequest);
}
Aggregations