Prometheus 修改targets端口

修改目的:打开prometheus,选择targets可以看到下面的页面,目的就是修改红框中的端口。

                                 1602326539238-697.png

修改方式:修改prometheus.yml  配置文件,增加如下配置:

                 image-20201010184138-2.png

配置详细解释

  • relabel_configs   重新标记配置
  • - source_labels 源标签
  • regex  根据此正则表达式取源标签的内容
  • target_label 目的标签
  • replacement 操作类型为替换,${1}代表regex提取出的内容,后面拼接新的端口重新给address赋值
  • __address__  targets的host:port
  • __meta_eureka_app_instance_ip_addr targets的host

参考文章如下:

https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config

https://blog.csdn.net/wtan825/article/details/93651164

https://github.com/prometheus/prometheus/blob/release-2.16/config/testdata/conf.good.yml

https://blog.csdn.net/liangkiller/article/details/105758857

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值