Go to APIGateway console and select the API Gateway called
PetAdoptionStatusUpdater that was created as part of the CDK.
Prod and select the tab
Logs/Tracing. Under this, enable the checkbox called
Log full requests/responses data. This will send detailed log data to CloudWatch which we will use in this exercise.
The above is a temporary action to get detailed log data to learn about CloudWatch Contributor Insights.
On the Contributor Insights home page, click on
Create rule. You will see a screen like the one below.
As you can see that there are numerous sample rules readily available for us to use. However, we will create our own rule.
Custom rule and click
In the next page, give the rule a name, select the Log group in which the API Gateway logs are collected. To find this, look for log groups starting with
API-Gateway-Execution-Logs in the drop down.
Leave log format as
pettype in the first textbox under
COUNT as selected for
Agggregate on and click
Create to create the custom rule.
You have just created a Contributor Insights rule which will automatically create a Top ‘N’ report based on the rule. If the traffic generator app is running, you should be able to see a graph like the one below in a few minutes time.
If you leave it long enough, you will see a report similar to the one below
Now go to the APIGateway console and select
prod and uncheck the
Log full requests/responses data checkbox under
You can also see your Contributor Insights Rules from within CloudWatch Logs console as shown below.
You can also see your Contributor Insights Rules and Graphs from within DynamoDB console as shown below.