gpt4 book ai didi

amazon-web-services - CloudWatch 统一代理 : Additional property append_dimensions is not allowed

转载 作者:行者123 更新时间:2023-12-04 11:02:15 27 4
gpt4 key购买 nike

我正在尝试向发布到 cloudwatch 统一代理的 statsd 指标添加自定义维度。 CW 文档指出 append_dimensionsmetrics部分仅支持InstanceId , InstanceType , AutoScalingGroupName并无视他人。

CloudWatch 代理配置文件:指标部分:

Docs

append_dimensions – Optional. Adds Amazon EC2 metric dimensions to all metrics collected by the agent. The only supported key-value pairs are shown in the following list. Any other key-value pairs are ignored.

"ImageID":"${aws:ImageId}" sets the instance's AMI ID as the value of the ImageID dimension.

"InstanceId":"${aws:InstanceId}" sets the instance's instance ID as the value of the InstanceID >

dimension.

"InstanceType":"${aws:InstanceType}" sets the instance's instance type as the value of the > InstanceType dimension.

"AutoScalingGroupName":"${aws:AutoScalingGroupName}" sets the instance's Auto Scaling group name > as the value of the AutoScalingGroupName dimension.



文档建议添加 append_dimensions直接转到定义您希望使用自定义维度的指标的部分。

向 CloudWatch 代理收集的指标添加自定义维度 :

Docs

To add custom dimensions such as tags to metrics collected by the agent, add the append_dimensions field to the section of the agent configuration file that lists those metrics.



所以我尝试添加 append_dimensionsstatsd部分:
"statsd": {
"service_address": ":8125",
"metrics_collection_interval": 10,
"metrics_aggregation_interval": 60,
"append_dimensions": {
"Environment": "${APP_ENV}"
}
}

我得到错误:

Additional property append_dimensions is not allowed



我也尝试使用我的指标发送标签,但它们似乎被忽略了。

最佳答案

AWS 文档说“在运行 Linux 或 Windows Server 的服务器上,指标部分包括以下字段:... append_dimensions”和“如果您想将维度附加到具有任意键值对的指标,请在特定类型指标的字段。”

因此,您只能在指标部分或任何特定指标字段中添加 append_dimensions。

Retrieve Custom Metrics with StatsD说“您可以根据需要将三个可选字段添加到代理配置文件的 statsd 部分”,因此很明显 statsd 不支持 append_dimensions。

关于amazon-web-services - CloudWatch 统一代理 : Additional property append_dimensions is not allowed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58731116/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com