chen-gliu / nacos-consul-adapter

This project contains a Spring Boot Starter that registers HTTP endpoints on a Spring Cloud Nacos server to support Prometheus's service discovery mechanism for Consul (<consul_sd_config>)
MIT License
87 stars 36 forks source link

怎么自定义标签配置,没看明白 #20

Closed xiohuchi closed 11 months ago

xiohuchi commented 11 months ago
relabel_configs:
  - source_labels: [__meta_consul_service]
  - regex: _meta_consul_service_metadata(.+)
    action: labelmap

加上上面配置后,prometheus运行报错

ts=2023-11-23T09:11:02.077Z caller=main.go:437 level=error msg="Error loading config (--config.file=/etc/prometheus/prometheus.yml)" err="parsing YAML file /etc/prometheus/prometheus.yml: relabel configuration for replace action requires 'target_label' value"

xiohuchi commented 11 months ago

没看明白怎么操作,是要怎么配置

xiohuchi commented 11 months ago

可以了,我regex的正则少打了一个下划线

xiohuchi commented 11 months ago

可以了,我regex的正则少打了一个下划线