aws / aws/amazon-cloudwatch-agent

Config schema doesn't include parse_data_dog_tags field for statsd.

Open
#329 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
550
Forks
271
Avg merge
1d 21h
Merged PRs (30d)
13

Description

When attempting to process a config file which includes the `parse_data_dog_tags` field, the config file is marked as invalid due to failing schema:

```
****** processing amazon-cloudwatch-agent ******
/opt/aws/amazon-cloudwatch-agent/bin/config-downloader --output-dir /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.d --download-source file:/tmp/amazon-cloudwatch-agent.json --mode ec2 --config /opt/aws/amazon-cloudwatch-agent/etc/common-config.toml --multi-config default
Successfully fetched the config and saved in /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.d/file_amazon-cloudwatch-agent.json.tmp
Start configuration validation...
/opt/aws/amazon-cloudwatch-agent/bin/config-translator --input /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json --input-dir /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.d --output /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.toml --mode ec2 --config /opt/aws/amazon-cloudwatch-agent/etc/common-config.toml --multi-config default
2021/12/15 14:06:40 Reading json config file path: /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.d/file_amazon-cloudwatch-agent.json.tmp ...
2021/12/15 14:06:40 Invalid Json input schema.
2021/12/15 14:06:40 Under path : /metrics/metrics_collected/statsd | Error : Additional property parse_data_dog_tags is not allowed
2021/12/15 14:06:40 Configuration validation first phase failed. Agent version: 1.0. Verify the JSON input is only using features supported by this version.
```

File in question:

```
{
"agent": {
"run_as_user": "cwagent",
"omit_hostname": true
},
"metrics": {
"metrics_collected": {
"statsd": {
"metrics_aggregation_interval": 60,
"metrics_collection_interval": 10,
"service_address": ":8125",
"parse_data_dog_tags": true
}
},
"append_dimensions": {
"InstanceType": "${aws:InstanceType}"
},
"aggregation_dimensions": [
[],
[
"InstanceType"
]
]
}
}
```
```

Contributor guide

Open the contributing guide

Research direction

Locate the JSON schema and validation path used for the statsd configuration under metrics_collected. Start by tracing the schema entry for statsd, then verify that parse_data_dog_tags is accepted and that the provided configuration passes validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
observability
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.