prometheus采集数据时添加自定义标签

https://blog.51cto.com/u_14205795/4561310

1 增加自定义标签ident,标签值用__address__的ip

复制代码
  - job_name: 'label_test'
    static_configs:
    - targets: ['192.168.214.151:9100']    
    relabel_configs:
    - source_labels: [__address__]
      regex: '(.*):9100'
      replacement: $1
      target_label: ident
      action: replace
复制代码

新指标:

node_filesystem_avail_bytes{device="/dev/mapper/centos-root",fstype="xfs",ident="192.168.214.151",instance="192.168.214.151:9100",job="label_test",mountpoint="/"}

posted @   明天OoO你好  阅读(1699)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· .NET Core 中如何实现缓存的预热?
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
· 【译】Visual Studio 中新的强大生产力特性
点击右上角即可分享
微信分享提示