在安装Datadog AWS定价集成时,要监控AmazonEC2服务的费率代码是什么?



我已经在us-east-1地区创建了一个测试aws ec2实例(amazon-linux),并在其中安装了datadog-agent,并安装了aws定价集成,以便像本文档中那样将定价指标获取到datadog agent,然后出现以下错误:

Datadog’s aws_pricing integration is reporting: • Instance #aws_pricing:d884b5186b651429[ERROR]: [{"message": "No rate codes for existing AWS services were defined, please fix conf.yaml", "traceback": "Traceback (most recent call last):n File "/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/base/checks/base.py", line 1120, in runn self.check(instance)n File "/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/aws_pricing/aws_pricing.py", line 29, in checkn raise CheckException(message)ndatadog_checks.base.errors.CheckException: No rate codes for existing AWS services were defined, please fix conf.yamln"}] • Instance #aws_pricing:698d047c39b859c1[ERROR]: [{"message": "No rate codes for existing AWS services were defined, please fix conf.yaml", "traceback": "Traceback (most recent call last):n File "/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/base/checks/base.py", line 1120, in runn self.check(instance)n File "/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/aws_pricing/aws_pricing.py", line 29, in checkn raise CheckException(message)ndatadog_checks.base.errors.CheckException: No rate codes for existing AWS services were defined, please fix conf.yamln"}]

似乎我必须编辑以下配置文件位于(/etc/datadog-agent/conf.d/aws_pricingd/conf。

在我的ec2服务器上配置Yaml) datadog。
`
init_config:
instances:
-
## @param region_name - string - optional - default: us-east-1
## AWS region to run PricingService requests in.
## As of writing, only us-east-1 and ap-south-1 are supported.
## See https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/using-pelong.html
#
# - region_name: us-east-1
## Below is an example of how you would configure monitoring for AmazonEC2 pricing.
## This same format can be used for any other AWS service.
## @param AmazonEC2 - list - optional
## Rate codes to monitor for AmazonEC2 service.
#
# - AmazonEC2:
#   - <RATE_CODE_1>
#   - <RATE_CODE_2>
#   - <RATE_CODE_3>
`

你可以在这里找到这个示例代码。

我想找出该文件中amazonec2下的特定RATE_CODES。(对于RATE_CODE_1, RATE_CODE_2,RATE_CODE_3等)。通过安装这个,我希望得到法律定价。度量,以显示每单位Amazonec2的成本。我正在创建一个datadog仪表盘。

datadog支持已经共享了这些示例资源供参考,

  1. 解释这里的rate_code是什么
  2. 速率码示例

查找以下代码片段

`
"rateCode": {     
"rateCode":"The rate code of the price", 
"description":"The description of the term", 
"unit":"The usage measurement unit for the price", 
"startingRange":"The start range for the term", 
"endingRange":"The end range for the term", 
"pricePerUnit": {       
"currencyCode":"currencyRate", 
}            
`

如果你找到了解决方案,如果你能和我分享配置的conf.yaml代码,那就太好了。

您必须根据您正在使用的EC2实例的类型按照说明获取费率代码。没有人能够为你提供这些;这取决于实例大小、区域、保留/按需等因素。您可能还需要查看API文档中的价格表API,并特别考虑为您正在使用的语言使用SDK。

最新更新