You need to enable JavaScript to run this app.
文档中心
日志服务

日志服务

复制全文
下载 pdf
LogCollector 采集
采集指标主题数据
复制全文
下载 pdf
采集指标主题数据
LogCollector v2.3.2 及以后版本支持根据采集配置采集服务器上的指标数据,采集 Prometheus 格式的各类指标数据。本文介绍创建指标采集配置的操作步骤。​
说明​
指标主题为邀测功能,若有相关业务需求,可联系客户经理开通白名单。​
前提条件​
  • 已创建日志项目和指标主题,详情可参考指标主题。​
  • 安装 LogCollector 的服务器需具备访问远端服务器 80 端口和 443 端口的能力。​
  • 已在服务器上安装 v2.3.2 或以后版本的 LogCollector。详细步骤请参考安装 LogCollector。​
操作步骤​
步骤一 选择日志空间​
  1. 在顶部导航栏中,选择日志服务所在的地域。​
  1. 在左侧导航栏中,选择常用功能 > 日志接入。​
  1. 在日志接入页面,单击指标采集,单击指标主题采集。​
  1. 选择日志项目和指标主题,单击下一步:选择机器组。​
  • 采集到的指标数据将被存储到该指标主题中。​
步骤二 选择机器组​
  1. 在全部机器组区域中,选择需要采集指标的机器组。​
  1. 在已选机器组区域中确认机器组无误后,单击下一步:采集规则。​
步骤三 配置采集规则​
  1. 填写规则名称。​
  • 长度范围为3~64个字符。​
  • 只能包含中文、字母、数字、下划线(_)和连字符(-)。​
  • 不能以连字符(-)开头/结尾。 ​
  1. 填写插件配置。​
  • ​
    global:​
    scrape_interval: 30s # Default is every 30s.​
    scrape_timeout: 10s #is set to the global default (10s).​
    # A scrape configuration containing exactly one endpoint to scrape:​
    # Here it's Prometheus itself.​
    scrape_configs:​
    # The job name is added as a label 'job=<job_name>' to any timeseries scraped from this config.​
    - job_name: 'prometheus'​
    # metrics_path defaults to '/metrics'​
    # metrics_path: '/metrics'​
    # scheme defaults to 'http'.​
    # scheme: 'http'​
    static_configs:​
    - targets: ['localhost:9090']​
    ​
说明​
支持在/usr/local/logcollector/etc/logcollector.yml配置文件中开启分片采集,提高采集性能,详情可参考设置 LogCollector 启动参数。​
  • metric.prom_cfg.input.prom_ins_num: 2 #总的指标采集实例数(安装的 LogCollector 总个数)metric.prom_cfg.input.prom_ins_id: 0 # 当前指标采集实例编号,从0开始(需手动给 LogCollector 设置编号)​
  1. 单击提交。​
后续操作​
创建采集配置之后,LogCollector 将采集指标数据并保存至指定的指标主题中,您可以在指标主题中执行检索分析操作。具体操作,请参考检索分析指标主题。​
最近更新时间:2026.08.26 16:10:37
这个页面对您有帮助吗?
有用
有用
无用
无用