文档文档

阿里云监控服务 (Aliyun) 输入插件

此插件从 阿里云/Aliyun 云监控服务收集统计信息。在下面的描述中,我们将使用 Aliyun 而不是 Alibaba,因为这是 Web 控制台和文档中的默认命名。

引入版本: Telegraf v1.19.0 标签: cloud 操作系统支持: all

阿里云认证

此插件使用 AccessKey 凭证来认证阿里云 OpenAPI 端点。插件将按以下顺序尝试进行认证。

  1. 如果指定了 access_key_id, access_key_secret, role_arn, role_session_name,则使用 Ram RoleARN 凭证
  2. 如果指定了 access_key_id, access_key_secret, access_key_sts_token,则使用 AccessKey STS token 凭证
  3. 如果指定了 access_key_id, access_key_secret,则使用 AccessKey 凭证
  4. 如果指定了 role_name,则使用 Ecs Ram Role 凭证
  5. 如果指定了 private_key, public_key_id,则使用 RSA 密钥对凭证
  6. 环境变量凭证
  7. 实例元数据凭证

全局配置选项

插件支持其他全局和插件配置设置,用于修改指标、标签和字段,创建别名以及配置插件顺序等任务。更多详情请参阅 CONFIGURATION.md

配置

# Pull Metric Statistics from Aliyun CMS
[[inputs.aliyuncms]]
  ## Aliyun Credentials
  ## Credentials are loaded in the following order
  ## 1) Ram RoleArn credential
  ## 2) AccessKey STS token credential
  ## 3) AccessKey credential
  ## 4) Ecs Ram Role credential
  ## 5) RSA keypair credential
  ## 6) Environment variables credential
  ## 7) Instance metadata credential

  # access_key_id = ""
  # access_key_secret = ""
  # access_key_sts_token = ""
  # role_arn = ""
  # role_session_name = ""
  # private_key = ""
  # public_key_id = ""
  # role_name = ""

  ## Specify ali cloud regions to be queried for metric and object discovery
  ## If not set, all supported regions (see below) would be covered, it can
  ## provide a significant load on API, so the recommendation here is to
  ## limit the list as much as possible.
  ## Allowed values: https://www.alibabacloud.com/help/zh/doc-detail/40654.htm
  ## Default supported regions are:
  ##   cn-qingdao,cn-beijing,cn-zhangjiakou,cn-huhehaote,cn-hangzhou,
  ##   cn-shanghai, cn-shenzhen, cn-heyuan,cn-chengdu,cn-hongkong,
  ##   ap-southeast-1,ap-southeast-2,ap-southeast-3,ap-southeast-5,
  ##   ap-south-1,ap-northeast-1, us-west-1,us-east-1,eu-central-1,
  ##   eu-west-1,me-east-1
  ##
  ## From discovery perspective it set the scope for object discovery,
  ## the discovered info can be used to enrich the metrics with objects
  ##  attributes/tags. Discovery is not supported for all projects.
  ## Currently, discovery supported for the following projects:
  ## - acs_ecs_dashboard
  ## - acs_rds_dashboard
  ## - acs_slb_dashboard
  ## - acs_vpc_eip
  regions = ["cn-hongkong"]

  ## Requested AliyunCMS aggregation Period (required)
  ## The period must be multiples of 60s and the minimum for AliyunCMS metrics
  ## is 1 minute (60s). However not all metrics are made available to the
  ## one minute period. Some are collected at 3 minute, 5 minute, or larger
  ## intervals.
  ## See: https://help.aliyun.com/document_detail/51936.html?spm=a2c4g.11186623.2.18.2bc1750eeOw1Pv
  ## Note that if a period is configured that is smaller than the minimum for
  ## a particular metric, that metric will not be returned by Aliyun's
  ## OpenAPI and will not be collected by Telegraf.
  period = "5m"

  ## Collection Delay (required)
  ## The delay must account for metrics availability via AliyunCMS API.
  delay = "1m"

  ## Recommended: use metric 'interval' that is a multiple of 'period'
  ## to avoid gaps or overlap in pulled data
  interval = "5m"

  ## Metric Statistic Project (required)
  project = "acs_slb_dashboard"

  ## Maximum requests per second, default value is 200
  ratelimit = 200

  ## How often the discovery API call executed (default 1m)
  #discovery_interval = "1m"

  ## NOTE: Due to the way TOML is parsed, tables must be at the END of the
  ## plugin definition, otherwise additional config options are read as part of
  ## the table

  ## Metrics to Pull
  ## At least one metrics definition required
  [[inputs.aliyuncms.metrics]]
    ## Metrics names to be requested,
    ## Description can be found here (per project):
    ## https://help.aliyun.com/document_detail/28619.html?spm=a2c4g.11186623.6.690.1938ad41wg8QSq
    names = ["InstanceActiveConnection", "InstanceNewConnection"]

    ## Dimension filters for Metric (optional)
    ## This allows to get additional metric dimension. If dimension is not
    ## specified it can be returned or the data can be aggregated - it depends
    ## on particular metric, you can find details here:
    ##   https://help.aliyun.com/document_detail/28619.html?spm=a2c4g.11186623.6.690.1938ad41wg8QSq
    ##
    ## Note, that by default dimension filter includes the list of discovered
    ## objects in scope (if discovery is enabled). Values specified here would
    ## be added into the list of discovered objects. You can specify either
    ## single dimension:
    # dimensions = '{"instanceId": "p-example"}'

    ## Or you can specify several dimensions at once:
    # dimensions = '[{"instanceId": "p-example"},{"instanceId": "q-example"}]'

    ## Tag Query Path
    ## The following tags added by default:
    ##   * regionId (if discovery enabled)
    ##   * userId
    ##   * instanceId
    ## Enrichment tags, can be added from discovery (if supported)
    ## Notation is
    ##   <measurement_tag_name>:<JMES query path (https://jmespath.org/tutorial.html)>
    ## To figure out which fields are available, consult the
    ## Describe<ObjectType> API per project. For example, for SLB see:
    ##   https://api.aliyun.com/#/?product=Slb&version=2014-05-15&api=DescribeLoadBalancers&params={}&tab=MOCK&lang=GO
    # tag_query_path = [
    #    "address:Address",
    #    "name:LoadBalancerName",
    #    "cluster_owner:Tags.Tag[?TagKey=='cs.cluster.name'].TagValue | [0]"
    #    ]

    ## Allow metrics without discovery data, if discovery is enabled.
    ## If set to true, then metric without discovery data would be emitted, otherwise dropped.
    ## This cane be of help, in case debugging dimension filters, or partial coverage of
    ## discovery scope vs monitoring scope
    # allow_dps_without_discovery = false

要求和术语

插件配置使用了 预设指标项参考

  • discovery_region 必须是有效的阿里云 区域
  • period 必须是有效的持续时间值
  • project 必须是预设的项目值
  • names 必须是预设的指标名称
  • dimensions 必须是预设的维度值

Metrics

每个监控的阿里云 CMS 项目都记录了一个度量,其中包含每个可用指标统计项目(Metric Statistic Project)的字段。项目和指标以 snake case(下划线命名法)表示

  • aliyuncms_{project}
    • {metric}_average (指标平均值)
    • {metric}_minimum (指标最小值)
    • {metric}_maximum (指标最大值)
    • {metric}_value (指标值)

示例输出

aliyuncms_acs_slb_dashboard,instanceId=p-example,regionId=cn-hangzhou,userId=1234567890 latency_average=0.004810798017284538,latency_maximum=0.1100282669067383,latency_minimum=0.0006084442138671875

此页面是否有帮助?

感谢您的反馈!


InfluxDB 3.8 新特性

InfluxDB 3.8 和 InfluxDB 3 Explorer 1.6 的主要增强功能。

查看博客文章

InfluxDB 3.8 现已适用于 Core 和 Enterprise 版本,同时发布了 InfluxDB 3 Explorer UI 的 1.6 版本。本次发布着重于操作成熟度,以及如何更轻松地部署、管理和可靠地运行 InfluxDB。

更多信息,请查看

InfluxDB Docker 的 latest 标签将指向 InfluxDB 3 Core

在 **2026 年 2 月 3 日**,InfluxDB Docker 镜像的 latest 标签将指向 InfluxDB 3 Core。为避免意外升级,请在您的 Docker 部署中使用特定的版本标签。

如果使用 Docker 来安装和运行 InfluxDB,latest 标签将指向 InfluxDB 3 Core。为避免意外升级,请在您的 Docker 部署中使用特定的版本标签。例如,如果使用 Docker 运行 InfluxDB v2,请将 latest 版本标签替换为 Docker pull 命令中的特定版本标签 — 例如

docker pull influxdb:2