AWS CloudFront¶
The core performance Metrics of AWS CloudFront include total requests, data transfer volume, HTTP error rate, cache hit rate, and latency. These can help users evaluate and optimize the performance of the content delivery network.
Configuration¶
Install Func¶
It is recommended to enable Guance integration - extension - hosted Func: all prerequisites are automatically installed. Please continue with the script installation.
If you deploy Func manually, refer to Self-deployed Func
Installation Script¶
Note: Please prepare the required Amazon AK in advance (for simplicity, you can directly grant global read-only permission
ReadOnlyAccess
)
Hosted Enablement Script¶
- Log in to the Guance console.
- Click on the 【Integration】 menu, select 【Cloud Account Management】.
- Click 【Add Cloud Account】, choose 【AWS】, and fill in the required information. If cloud account information has been configured before, skip this step.
- Click 【Test】, after a successful test click 【Save】. If the test fails, check if the relevant configuration information is correct and retest.
- In the 【Cloud Account Management】 list, you can see the added cloud accounts. Click on the corresponding cloud account to enter the details page.
- Click the 【Integration】 button on the cloud account details page. Under the
Not Installed
list, findAWS CloudFront
, click the 【Install】 button, and follow the prompts to install.
Manual Enablement Script¶
-
Log in to the Func console, click 【Script Market】, enter the official script market, search for
guance_aws_cloudfront
. -
After clicking 【Install】, input the corresponding parameters: AWS AK ID, AK Secret, and account name.
-
Click 【Deploy Startup Script】, the system will automatically create a
Startup
script set and automatically configure the corresponding startup script. -
After enabling, you can see the corresponding automatic trigger configuration in 「Management / Automatic Trigger Configuration」. Click 【Execute】, to immediately execute once without waiting for the scheduled time. Wait a moment, and you can view the execution task records and corresponding logs.
Verification¶
- In 「Management / Automatic Trigger Configuration」, confirm that the corresponding tasks have the appropriate automatic trigger configurations. You can also view the task records and logs to check for any anomalies.
- In Guance, under 「Infrastructure / Custom」, check if there is any asset information.
- In Guance, under 「Metrics」, check if there are any corresponding monitoring data.
Metrics¶
After configuring Amazon-CloudWatch, the default Measurement set is as follows. More Metrics can be collected through configuration. Amazon CloudWatch Metrics Details
Monitoring Metrics¶
Metric English Name | Metric Chinese Name | Meaning |
---|---|---|
Requests | Requests | The total number of viewer requests received by CloudFront for all HTTP methods and both HTTP and HTTPS requests. |
Bytes downloaded | Bytes Downloaded | The total number of bytes downloaded by viewers for GET, HEAD, and OPTIONS requests. |
Bytes uploaded | Bytes Uploaded | The total number of bytes uploaded by viewers using POST and PUT requests through CloudFront to your origin location. |
4xx error rate | 4xx Errors | The percentage of all viewer requests that result in an HTTP status code of 4xx. |
5xx error rate | 5xx Errors | The percentage of all viewer requests that result in an HTTP status code of 5xx. |
Total error rate | Total Errors | The percentage of all viewer requests that result in an HTTP status code of 4xx or 5xx. |
Objects¶
Example of reported data:
{
"measurement": "aws_cloudfront",
"tags": {
"ARN": "arn:aws-cn:cloudfront::F",
"DomainName": "d3q33pv83.cloudfront.cn",
"Id": "E183FMUG1QDCZF",
"Status": "Deployed",
"name": "E183FMUG1ZF"
},
"fields": {
"CreatedDate" : "2022-03-09T06:13:31Z",
"ApiKeySelectionExpression": "$request.header.",
"DisableSchemaValidation" : "xxxxx",
"Description" : "Created by AWS Lambda"
}
}
Note: The fields in
tags
andfields
may change with subsequent updates.