Sentinel icon indicating copy to clipboard operation
Sentinel copied to clipboard

增加了sentinel-prometheus相关依赖,但是9092端口无法被监听,配置设置csp.sentinel.prometheus.fetch.port=9093也无效

Open heqs opened this issue 7 months ago • 1 comments

按照文档,在我的spring boot项目中增加3个依赖

<dependency>
            <groupId>com.alibaba.csp</groupId>
            <artifactId>sentinel-prometheus-metric-exporter</artifactId>
            <version>1.8.7</version>
        </dependency>
        <dependency>
            <groupId>io.prometheus</groupId>
            <artifactId>simpleclient</artifactId>
            <version>0.3.0</version>
        </dependency>
        <dependency>
            <groupId>io.prometheus</groupId>
            <artifactId>simpleclient_httpserver</artifactId>
            <version>0.3.0</version>
        </dependency>

因为一个服务器下面会运行多个spring boot项目,且每个项目都需要暴露sentinel监控数据给 prometheus,于是涉及端口占用问题,需要自定义端口 bootstrap.yml增加自定义端口,这个端口不会被监听,还是会使用9092启动,于是只有第一个启动的应用可以暴露数据

csp:
  sentinel:
    prometheus:
      fetch:
        port: 9093

csp.sentinel.prometheus.fetch.port 这个配置应该如何配置呢?请教

heqs avatar Jul 20 '24 13:07 heqs