Push custom metrics using the CloudWatch agent Install the CloudWatch unified agent. Assign a role or credentials to the instance with CloudWatch permissions. Create the CloudWatch agent configuration file. Start the agent.