I'm trying to update the CloudWatch Observability add-on's configuration in Amazon EKS, to be able to collect metrics at a higher interval than the default of 1 minute.
From the AWS docs on Manually create or edit the CloudWatch agent configuration file, I'm aware that I'll need to to update agent.metrics_collection_interval
in CloudWatch agent's JSON config, but I'm not able to identify how this can be set when using the CloudWatch Observability add-on in EKS.
I'm trying to update the CloudWatch Observability add-on's configuration in Amazon EKS, to be able to collect metrics at a higher interval than the default of 1 minute.
From the AWS docs on Manually create or edit the CloudWatch agent configuration file, I'm aware that I'll need to to update agent.metrics_collection_interval
in CloudWatch agent's JSON config, but I'm not able to identify how this can be set when using the CloudWatch Observability add-on in EKS.
1 Answer
Reset to default -1After going through the AWS docs for Upgrading to Container Insights with enhanced observability for Amazon EKS in CloudWatch and doing some trial and error, I found out that the CloudWatch add-on's config can be updated by running:
kubectl edit cm cloudwatch-agent -n amazon-cloudwatch
and then updating the agent's config in the data["cwagentconfig.json"]
field.