Skip to content
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

Add support for ALB alarms and dashboard #97

Merged
merged 25 commits into from
Oct 12, 2022
Merged

Add support for ALB alarms and dashboard #97

merged 25 commits into from
Oct 12, 2022

Conversation

direnakkoc
Copy link
Collaborator

@direnakkoc direnakkoc commented Sep 26, 2022

Description

Add support for ALB alarms and dashboard for the metrics are

  • HTTPCode_ELB_5XX_Count
  • RejectedConnectionCount
  • HTTPCode_Target_5XX_Count
  • UnHealthyHostCount
  • LambdaInternalError
  • LambdaUserError

Motivation and Context

  • HTTPCode_ELB_5XX_Count- The number of HTTP 5XX server error codes that originate from the load balancer. This count does not include any response codes generated by the targets.
  • RejectedConnectionCount- The number of connections that were rejected because the load balancer had reached its maximum number of connections.
  • HTTPCode_Target_5XX_Count- The number of HTTP response codes generated by the targets. This does not include any response codes generated by the load balancer.
  • UnHealthyHostCount- The number of targets that are considered unhealthy.
  • LambdaInternalError- The number of requests to a Lambda function that failed because of an issue internal to the load balancer or AWS Lambda. To get the error reason codes, check the error_reason field of the access log.
  • LambdaUserError- The number of requests to a Lambda function that failed because of an issue with the Lambda function. For example, the load balancer did not have permission to invoke the function, the load balancer received JSON from the function that is malformed or missing required fields, or the size of the request body or response exceeded the maximum size of 1 MB. To get the error reason codes, check the error_reason field of the access log.

How Has This Been Tested?

  • Unit tests added

Screenshots (if appropriate):

httpCodeElb5XXCount
httpCodeTarget5XXCount
lambdaUserError
unHealthyHostCount

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING.md document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@direnakkoc direnakkoc force-pushed the fix-alb-metrics branch 7 times, most recently from 23a9cd6 to f9891ce Compare September 27, 2022 15:13
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.6%) to 99.358% when pulling f9891ce on fix-alb-metrics into 4590498 on main.

@coveralls
Copy link

coveralls commented Sep 27, 2022

Coverage Status

Coverage remained the same at 100.0% when pulling c4c407d on fix-alb-metrics into 7d26f74 on main.

Copy link
Contributor

@eoinsha eoinsha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @direnakkoc . The main issue is still with the challenge of associating an ALB Target Group with the correct Load Balancer.
Going back to the original design discussion (#89), we have to find the Listener Rule, then the Listener and only then can we find the Load Balancer!

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
serverless-plugin/alarms-alb-target-group.js Outdated Show resolved Hide resolved
serverless-plugin/alarms-alb-target-group.js Outdated Show resolved Hide resolved
serverless-plugin/alarms-alb-target-group.js Outdated Show resolved Hide resolved
serverless-plugin/dashboard.js Outdated Show resolved Hide resolved
serverless-plugin/util.js Outdated Show resolved Hide resolved
serverless-test-project-alb/sls-resources.yml Show resolved Hide resolved
serverless-test-project/serverless-v2.yml Show resolved Hide resolved
for (const [listenerRuleLogicalId, listenerRule] of Object.entries(listenerRuleResources)) {
for (const action of listenerRule.Properties.Actions || []) {
const targetGroupArn = action.TargetGroupArn
if (targetGroupArn.Ref === targetGroupLogicalId) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we also check here if targetGroupArn exist? like we did above
(targetGroupArn?.Ref === targetGroupLogicalId)

README.md Outdated Show resolved Hide resolved
@eoinsha eoinsha merged commit 6ae11e7 into main Oct 12, 2022
@eoinsha eoinsha deleted the fix-alb-metrics branch October 12, 2022 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants