1 Answer
- Newest
- Most votes
- Most comments
0
To capture metrics only from a specific namespace in AWS Container Insights for EKS, you need to modify the cloudwatch-agent-configmap and ensure the CloudWatch agent is filtering metrics based on the namespace.
- Update the cloudwatch-agent-configmap in the amazon-cloudwatch namespace to include the namespace filter.
apiVersion: v1
kind: ConfigMap
metadata:
name: cloudwatch-agent-config
namespace: amazon-cloudwatch
data:
agent.json: |
{
"agent": {
"region": "us-east-1"
},
"logs": {
"metrics_collected": {
"kubernetes": {
"cluster_name": "your-cluster-name",
"metrics_collection_interval": 60,
"resources": [
{
"type": "Namespace",
"pattern": "your-namespace"
}
]
}
}
}
}
Apply the Updated ConfigMap Apply the updated ConfigMap using:
answered 8 months ago

I applied the following configmap and nothing has changed, it is still collecting metrics from all namespaces - {"agent":{"region":"eu-central-1"},"logs":{"metrics_collected":{"application_signals":{"hosted_in":"example"},"kubernetes":{"cluster_name":"example","enhanced_container_insights":true,"resources":[{"pattern":"example","type":"Namespace"}]}}},"traces":{"traces_collected":{"application_signals":{}}}}