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

Multiple emails for single Limit Code #169

Open
2 tasks
aj-max-svg opened this issue Oct 19, 2023 · 2 comments
Open
2 tasks

Multiple emails for single Limit Code #169

aj-max-svg opened this issue Oct 19, 2023 · 2 comments
Labels
enhancement triaged Has been triaged by solutions team

Comments

@aj-max-svg
Copy link

Quota Service Monitor sends 12 emails for a single Limit Code.

Deployed the following templates in a single account:
us-west-2
(SO0005-NoOU) - quota-monitor-for-aws version:v6.2.2 - Hub Template, use it when you are not using AWS Organizations
(SO0005-SQ) - quota-monitor-for-aws version:v6.2.2 - Service Quotas Template

us-east-1
(SO0005-TA) - quota-monitor-for-aws version:v6.2.2 - Trusted Advisor Template

When the event rule fires, only one Limit Code is found, but I receive 12 emails for it. It appears there is a record logged every hour of the limit code, and each one gets sent as a notification. (see the timestamp fields in the screenshot)
Screenshot 2023-10-19 at 1 27 01 PM

To Reproduce

Deploy the solution and wait for the event rule to fire.

Expected behavior

A single email for each limit code
Please complete the following information about the solution:

  • [ 6.2.2 ] Version: [e.g. v1.0.0]

To get the version of the solution, you can look at the description of the created CloudFormation stack. For example, "(SOXXXX) - The AWS CloudFormation template for deployment of the AWS Solution. Version vx.y.z". You can also find the version from releases

  • [ us-west-2 ] Region: [e.g. us-east-1]
  • [ No ] Was the solution modified from the version published on this repository?
  • If the answer to the previous question was yes, are the changes available on GitHub?
  • Have you checked your service quotas for the services this solution uses?
  • [ No ] Were there any errors in the CloudWatch Logs? How to enable debug mode?

Screenshots
If applicable, add screenshots to help explain your problem (please DO NOT include sensitive information).

Additional context
Add any other context about the problem here.

@aj-max-svg aj-max-svg added the bug label Oct 19, 2023
@abewub
Copy link
Member

abewub commented Oct 20, 2023

Thanks for the feedback. Those emails are have timestamps which are 1 hour apart - thus 12 for the day. Quota Monitor can be configured to run every 6 or 12 hours. So you will get 6 or 12 email for the past 6 or 12 hour periods. At this point that 1 hour period is not configurable. It could be a good idea to expose that as a template parameter.

@abewub abewub added triaged Has been triaged by solutions team and removed bug labels Oct 20, 2023
@KadalurSupreeth
Copy link

KadalurSupreeth commented Jan 24, 2025

Hello,
The latest version 6.3.0 still lacks a customized solution to prevent multiple email notifications. It would be ideal to have a template parameter that allows users to set their preferred notification frequency. Could you let me know if this issue has been resolved or is it still in the backlog? It would be great to address this issue as soon as possible, as receiving numerous email notifications for the same LimitCode is quite frustrating.

Example: I have scheduled the CW Poller Lambda to run every 24 hours.

  1. CloudTrail usage metrics are generated every hour by design, resulting in 24 notifications per day.
  2. Firehose usage metrics are generated every minute.
  3. Elastic IP usage metrics are generated every 24 hours.
    Therefore, the number of emails generated per day varies depending on the AWS services.

I have made changes in the CW Lambda file to meet the immediate need but would prefer to expose this value through the CFT template.

Lambda: cwPoller
File: exports.ts

The below constant may not be used at all.

/**

  • @description period of 1hr for metric stats
    */
    export const METRIC_STATS_PERIOD = 3600;

Additionally, there is another hardcoded value in the same file, as shown below. By changing this value to 86400, I was able to limit the notifications to one email per LimitCode per day.

/**

  • @description generates CW GetMetricData queries for all quotas
  • @param quotas
    */
    export function generateCWQueriesForAllQuotas(quotas: ServiceQuota[]) {
    const sq = new ServiceQuotasHelper();
    const queries: MetricDataQuery[] = [];
    quotas.forEach((quota) => {
    try {
    queries.push(...sq.generateCWQuery(quota, 3600));
    } catch (_) {
    // quota throws error with generating query
    }
    });
    return queries;
    }

I recognize the difference between aggregating value hourly versus daily, but this approach meets my needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement triaged Has been triaged by solutions team
Projects
None yet
Development

No branches or pull requests

4 participants