安装DataDog AWS定价集成时,要监视Amazonec2服务的费率代码是什么?

发布于 2025-02-12 09:57:03 字数 3463 浏览 1 评论 0 原文

我在US-EAST-1区域创建了一个测试AWS EC2实例(Amazon-Linux),并在其中安装了DataDog代理,并安装了AWS定价集成,以获取定价指标,如此文档发生以下错误。

datadog's aws_pricing 集成是报告:•实例#AWS_PRICING:D884B5186B651429 [error] [error]:[{message“ message”:“没有定义现有AWS服务的费率代码,请定义,请修复Conf.yaml proceckback”,“ praceback”,“”:“”:“”:“”:“”:“”:“”:“”:“”:“”:“”:“”:“”:“”: Trackback(最近的最新通话):\ n文件\ \“/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/base/base/checks/base.py \”,第1120行,在运行\ n self.check(实例)\ n file \ \“/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/aws_pricing/aws_pricing/aws_pricing.py \”,第29行,在检查\ n checkexception(message)\ ndatadag_checks.base.base.errors中。 Checkexception:未定义现有AWS服务的费率代码,请修复conf.yaml \ n“}]•实例#aws_pricing:698d047c39b859c1 [error] [error]:[{“ message”:“没有定义现有AWS服务的费率代码,请修复Conf.yaml”,“ Trackback”,“ Trackback”:“ Trackback”:最近的电话):\ n文件\ \“/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/base/base/checks/base.py \”,第1120行,在运行\ n self.check(实例)\ n file \ \“/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/aws_pricing/aws_pricing/aws_pricing.py \”,第29行,在检查\ n checkexception(message)\ ndatadag_checks.base.base.errors中。 Checkexception:未定义现有AWS服务的费率代码,请修复conf.yaml \ n“}]

似乎我必须编辑位于(/etc/datadog-agent/conf.d/aws_pricing.d/conf.yaml)datadog配置中的以下conf文件。 EC2服务器。

`
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等)。通过安装此操作,我希望获得AWS.pricing.amazonec2 Metric,以显示Amazon EC2每单位的成本。我正在为此创建一个Datadog仪表板。

datadog support has shared these example resources to refer,

  1. explanation around what rate_code is
  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代码,那就太好了。

I have created a test aws ec2 instance (amazon-linux) in us-east-1 region and installed datadog-agent in it and installed aws pricing integration to get pricing metrics as in this documentation to datadog agent and the following error occurs.

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 run\n self.check(instance)\n File \"/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/aws_pricing/aws_pricing.py\", line 29, in check\n raise CheckException(message)\ndatadog_checks.base.errors.CheckException: No rate codes for existing AWS services were defined, please fix conf.yaml\n"}] • 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 run\n self.check(instance)\n File \"/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/aws_pricing/aws_pricing.py\", line 29, in check\n raise CheckException(message)\ndatadog_checks.base.errors.CheckException: No rate codes for existing AWS services were defined, please fix conf.yaml\n"}]

it seems like I have to edit the following conf file which located in ( /etc/datadog-agent/conf.d/aws_pricing.d/conf.yaml ) datadog configuration in my ec2 server.

`
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>
`

You can find this example code here.

I want to find out the specific RATE_CODES under the amazonec2 in this file. ( for RATE_CODE_1, RATE_CODE_2,RATE_CODE_3 etc).By installing this one I'm expecting to get the aws.pricing.amazonec2 metric to show the cost of amazon ec2 per unit. I'm creating a datadog dashboard regarding this.

datadog support has shared these example resources to refer,

  1. explanation around what rate_code is here
  2. example of a rate code

look for the following code snippet

`
"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", 
                 }            
`

If you find out the solution it's great if you can share the configured conf.yaml code with me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

南七夏 2025-02-19 09:57:03

您必须按照说明根据您使用的EC2实例自己获取费率代码。没有其他人能为您提供此服务;这取决于实例大小,区域,保留/按需等。 -pelong.html“ rel =“ nofollow noreferrer”>价格列表api api api 的API文档,尤其是考虑使用SDK您正在使用的语言。

You have to follow the instructions to get the rate codes yourself based on what kind of EC2 instances you are using. Nobody else will be able to provide this for you; it depends on things like instance size, region, reserved/on-demand, etc. You might also want to look at the API documentation for the price list API, and especially consider using the SDK for whatever language you are working in.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文