cdklabs / cdk-monitoring-constructs

Easy-to-use CDK constructs for monitoring your AWS infrastructure
https://constructs.dev/packages/cdk-monitoring-constructs
Apache License 2.0
444 stars 56 forks source link

addHealthyTaskCountAlarm/addUnhealthyTaskCountAlarm doesnt seem to work #427

Closed dominiquearpin closed 9 months ago

dominiquearpin commented 9 months ago

Version

5.3.0 and 5.10.2

Steps and/or minimal code example to reproduce

            this.myDashboard.monitorFargateApplicationLoadBalancer({
                fargateService: myFargate.fargateService,
                applicationLoadBalancer: myFargate.applicationLoadBalancer,
                applicationTargetGroup: myFargate.targetGroup,
                addHealthyTaskCountAlarm: {
                    healthy: {
                        alarmNameOverride: `${this.MyVariable}-ECS-healthy`,
                        alarmDescriptionOverride: 'asdfasdf',
                        minHealthyTasks: 6,
                        comparisonOperatorOverride: ComparisonOperator.GREATER_THAN_OR_EQUAL_TO_THRESHOLD,
                        treatMissingDataOverride: TreatMissingData.NOT_BREACHING,
                        actionsEnabled: true,
                        actionOverride: new SnsAlarmActionStrategy({ onAlarmTopic }),
                        datapointsToAlarm: 8,
                        evaluationPeriods: 10,
                        period: Duration.seconds(60)
                    }
                }
            })

Expected behavior

Add healthy and unhealthy (dashboard + alarm)

Actual behavior

Can't get the healthy and unhealthy. Get only the CPU, memory and min/maxAutoScaling.

Other details

No problem with addCpuUsageAlarm, addMemoryUsageAlarm, minAutoScalingTaskCount and minAutoScalingTaskCount . Maybe a dont use the right method..

dominiquearpin commented 9 months ago

You can close this issue. Maybe adding some warning when some value are "null". My loadbalancer was empty, but fail without notice.