AWS CloudFront¶
The core performance metrics of AWS CloudFront include total requests, data transfer volume, HTTP error rate, cache hit rate, and latency, which help users evaluate and optimize the performance of the content delivery network.
Configuration¶
Install Func¶
It is recommended to enable the TrueWatch Integration - Extensions - DataFlux Func (Automata): all prerequisites are automatically installed, please proceed with the script installation.
If you are deploying Func manually, refer to Manual Func Deployment
Install Script¶
Note: Please prepare an Amazon AK that meets the requirements in advance (for simplicity, you can directly grant global read-only permissions
ReadOnlyAccess
)
Managed Version Script¶
- Log in to the TrueWatch console
- Click on the [Integration] menu and select [Cloud Account Management]
- Click [Add Cloud Account], select [AWS], and fill in the required information on the interface. If you have already configured the cloud account information before, you can skip this step
- Click [Test], and if the test is successful, click [Save]. If the test fails, please check if the relevant configuration information is correct and retest
- Click on the [Cloud Account Management] list to see the added cloud account, click on the corresponding cloud account to enter the details page
- Click the [Integration] button on the cloud account details page, find
AWS CloudFront
under theNot Installed
list, and click the [Install] button to pop up the installation interface and proceed with the installation.
Manual Script¶
-
Log in to the Func console, click on [Script Market], enter the TrueWatch script market, and search for:
integration_aws_cloudfront
-
After clicking [Install], enter the corresponding parameters: AWS AK ID, AK Secret, and account name.
-
Click [Deploy Startup Script], the system will automatically create the
Startup
script set and configure the corresponding startup script. -
After enabling, you can see the corresponding automatic trigger configuration in "Management / Automatic Trigger Configuration". Click [Execute] to execute it immediately without waiting for the scheduled time. After a while, you can check the execution task records and corresponding logs.
Verification¶
- In "Management / Automatic Trigger Configuration", confirm whether the corresponding task has the corresponding automatic trigger configuration, and check the corresponding task records and logs for any exceptions
- In TrueWatch, check if there is asset information in "Infrastructure / Custom"
- In TrueWatch, check if there is corresponding monitoring data in "Metrics"
Metrics¶
After configuring Amazon CloudWatch, the default measurement sets are as follows. You can collect more metrics through configuration Amazon CloudWatch Metrics Details
Monitoring Metrics¶
Metric Name | Metric Chinese Name | Description |
---|---|---|
Requests | Total Requests | The total number of viewer requests received by CloudFront for all HTTP methods and HTTP and HTTPS requests. |
Bytes downloaded | Downloaded Bytes | The total number of bytes downloaded by viewers for GET, HEAD, and OPTIONS requests. |
Bytes uploaded | Uploaded Bytes | The total number of bytes uploaded by viewers to your origin via CloudFront using POST and PUT requests. |
4xx error rate | 4xx Errors | The percentage of all viewer requests with an HTTP status code of 4xx. |
5xx error rate | 5xx Errors | The percentage of all viewer requests with an HTTP status code of 5xx. |
Total error rate | Total Errors | The percentage of all viewer requests with an HTTP status code of 4xx or 5xx. |
Object¶
The reported data example is as follows:
{
"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