I'm trying to use the cloudwatch agent as a sidecar container for a rabbitmq broker deployed on ECS. My goal is to export into Cloudwatch metrics scrapped py the rabbitmq prometheus plugin. However, when the cloudwatch agent starts, it crashes while translating the config with the following error :
E! failed to generate YAML configuration validation content: unable to build components in pipeline: "prometheusremotewrite/amp" missing key in JSON: "metrics::metrics_destinations::amp or metrics::metrics_destinations::amp::workspace_id"
Here's the config file I'm using :
{
"agent": {
"region": "eu-west-1"
},
"metrics": {
"namespace": "RabbitMQ",
"metrics_collected": {
"prometheus": {
"prometheus_config_path": "/etc/prometheus/config.yaml"
}
}
}
}
Here's the Dockerfile I use for the cloudwatch agent :
FROM amazon/cloudwatch-agent:latest
COPY cwagent-config.json /etc/cwagentconfig/config.json
COPY prometheus-config.yaml /etc/prometheus/config.yaml
Here's the extensive logs of the cloudwatch agent container:
"Starting config-translator, this will map back to a call to amazon-cloudwatch-agent"
Executing /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent with arguments: [config-translator -multi-config remove -input-dir /etc/cwagentconfig -output /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.toml -mode auto]D! [EC2] Found active network interface
I! imds retry client will retry 1 timesD! could not get hostname without imds v1 fallback enable thus enable fallback
E! [EC2] Fetch hostname from EC2 metadata fail: RequestError: send request failed
"caused by: Get ""http://169.254.169.254/latest/meta-data/hostname"": dial tcp 169.254.169.254:80: connect: invalid argument"
D! could not get instance document without imds v1 fallback enable thus enable fallback
E! [EC2] Fetch identity document from EC2 metadata fail: EC2MetadataRequestError: failed to get EC2 instance identity document
caused by: RequestError: send request failed
"caused by: Get ""http://169.254.169.254/latest/dynamic/instance-identity/document"": dial tcp 169.254.169.254:80: connect: invalid argument"
2026/04/15 13:24:59 I! attempt to access ECS task metadata to determine whether I'm running in ECS.
I! Detected the instance is ECS
2026/04/15 13:24:59 Reading json config file path: /opt/aws/amazon-cloudwatch-agent/bin/default_linux_config.json ...
/opt/aws/amazon-cloudwatch-agent/bin/default_linux_config.json does not exist or cannot read. Skipping it.
2026/04/15 13:24:59 Reading json config file path: /etc/cwagentconfig/config.json ...
2026/04/15 13:24:59 I! Valid Json input schema.
"2026/04/15 13:24:59 E! failed to generate YAML configuration validation content: unable to build components in pipeline: ""prometheusremotewrite/amp"" missing key in JSON: ""metrics::metrics_destinations::amp or metrics::metrics_destinations::amp::workspace_id"""
E! config-translator process exited with non-zero status: 1
2026/04/15 13:24:59 I! Return exit error: exit code=1
"2026/04/15 13:24:59 E! Cannot translate JSON, ERROR is exit status 1 "
I'm trying to use the cloudwatch agent as a sidecar container for a rabbitmq broker deployed on ECS. My goal is to export into Cloudwatch metrics scrapped py the rabbitmq prometheus plugin. However, when the cloudwatch agent starts, it crashes while translating the config with the following error :
E! failed to generate YAML configuration validation content: unable to build components in pipeline: "prometheusremotewrite/amp" missing key in JSON: "metrics::metrics_destinations::amp or metrics::metrics_destinations::amp::workspace_id"Here's the config file I'm using :
{ "agent": { "region": "eu-west-1" }, "metrics": { "namespace": "RabbitMQ", "metrics_collected": { "prometheus": { "prometheus_config_path": "/etc/prometheus/config.yaml" } } } }Here's the Dockerfile I use for the cloudwatch agent :
Here's the extensive logs of the cloudwatch agent container: