Git Product home page Git Product logo

Comments (1)

heqs avatar heqs commented on August 26, 2024

按照文档,在我的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 这个配置应该如何配置呢?请教

已解决,看了源代码https://github.com/alibaba/Sentinel/blob/1.8/sentinel-core/src/main/java/com/alibaba/csp/sentinel/config/SentinelConfigLoader.java#L82,原来需要单独写在下面这个配置文件当中:
private static final String DEFAULT_SENTINEL_CONFIG_FILE = "classpath:sentinel.properties";

from sentinel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.