To find out if this integration is available in your organization, see your Datadog Integrations page or ask your organization administrator.
To initiate an exception request to enable this integration for your organization, email support@ddog-gov.com.
Overview
AWS service quotas cap how much of a service an account can use in a region. Service quota monitoring reports how much of each quota an account is consuming, so you can alert before a quota is reached instead of after a request is throttled or rejected.
Datadog collects the applied quota limits for the account, reads the matching AWS usage metrics from CloudWatch, and reports usage as a percentage of the limit in the metric aws.servicequota.percentage_used. The limits come from resource collection, so resource collection must be enabled for the account.
Setup
In Datadog, go to the AWS integration page, click the General tab, and select an AWS account.
Verify that resource collection is enabled for the account. The Enable service quota tracking toggle is only available if resource collection is enabled.
Turn on Enable service quota tracking.
Service quota monitoring calls the CloudWatch GetMetricData API every 30 minutes in each enabled region. AWS bills these calls to your account.
Data collected
Datadog collects quota limits for every AWS service that reports quotas for your account. It reports usage percentages for a smaller set of services, identified by the service_code tag:
Service
service_code
Amazon EC2
ec2
Amazon VPC
vpc
AWS Lambda
lambda
Elastic Load Balancing
elasticloadbalancing
Amazon RDS
rds
Amazon DynamoDB
dynamodb
AWS IAM
iam
Amazon CloudWatch Logs
logs
AWS KMS
kms
aws.servicequota.percentage_used is tagged with service_code, quota_code, quota_name, region, and adjustable, along with your account tags. Use it in dashboards and monitors like any other metric.
The out-of-the-box AWS Service Quota Usage dashboard shows this data for your accounts, filterable by service, region, account, and whether the quota can be raised. Clone it to add your own widgets.
Note: AWS does not publish a usage metric for every quota, so Datadog reports a percentage only for quotas that have one. Quotas without a usage metric, and quotas for services outside this list, still have their limits collected.
Query quota limits
aws.servicequota.percentage_used reports how close an account is to a quota, but not the limit value itself. It also covers only the services listed in the Data collected section. To see the applied limits for every quota collected for your account, query them in the DDSQL Editor, and optionally save the results to a dashboard.
Go to the DDSQL Editor and enter the following query. Replace <ACCOUNT_ID> with your AWS account ID and <SERVICE_CODE> with a service, such as ec2:
SELECTCASEWHENq.global_quotaORsplit_part(q.quota_arn,':',4)=''THEN'GLOBAL'ELSEsplit_part(q.quota_arn,':',4)ENDASregion,q.account_id,q.service_code,q.quota_code,q.quota_name,q.valueASlimit_value,u.valueASpercent_used,q.adjustableFROMaws.service_quotas_service_quotaqLEFTJOINdd.metrics_scalar('reduce(max:aws.servicequota.percentage_used{*} by {aws_account,service_code,quota_code,region}, max)')uONu.tags->'aws_account'=q.account_idANDu.tags->'service_code'=q.service_codeANDu.tags->'quota_code'=lower(q.quota_code)ANDu.tags->'region'=split_part(q.quota_arn,':',4)WHEREq.account_id='<ACCOUNT_ID>'ANDq.service_code='<SERVICE_CODE>'ORDERBYpercent_usedDESCNULLSLAST,region,q.quota_nameLIMIT100
Click Run to check the results, then click Save to save the query.
Click Save to dashboard and choose the dashboard to add it to.
Select the columns to display in the widget.
Each row is one quota in one region, with the limit Datadog collected, the percentage of that limit in use, and whether the quota can be raised. The quotas closest to their limit are listed first.
Note: The query returns one row per quota per region, and most accounts have more quotas than the 100-row LIMIT. Keep the default sort by percent_used, or add a region to the WHERE clause. Sorting by region alone returns quotas from only the first region.
To see every service for the account, remove the AND q.service_code = '<SERVICE_CODE>' line from the WHERE clause. To look up a single quota across all regions, replace that line with a quota code filter, such as AND q.quota_code = 'L-1216C47A'. These comparisons are case-sensitive, and quota_code values are uppercase. The query lowercases the code when joining to the metric, because Datadog converts metric tag values to lowercase.
Note the following about the results:
region is derived from the quota ARN. Quotas that apply to the whole account, such as most IAM quotas, are reported as GLOBAL.
percent_used is empty when AWS publishes no usage metric for that quota. The limit is still accurate; only the percentage is unavailable.
limit_value is in the unit AWS reports for that quota, which is a plain count for most quotas and a size or a rate for the rest. Units are not comparable between quotas, so avoid ranking unrelated quotas by this value alone.
Further reading
Additional helpful documentation, links, and articles: