Spring boot 使用prometheus监控弹簧启动服务(执行器,安全启用)

Spring boot 使用prometheus监控弹簧启动服务(执行器,安全启用),spring-boot,prometheus,spring-boot-actuator,prometheus-operator,Spring Boot,Prometheus,Spring Boot Actuator,Prometheus Operator,我目前正在尝试使用PrAG堆栈来监视基于spring引导的微服务。有两个spring boot项目1.5.4(pom.xml)配置了以下依赖项以获取度量并将度量转换为prometheus服务器: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifact

我目前正在尝试使用PrAG堆栈来监视基于spring引导的微服务。有两个spring boot项目1.5.4(pom.xml)配置了以下依赖项以获取度量并将度量转换为prometheus服务器:

  <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-hateoas</artifactId>
    </dependency>

    <dependency>
        <groupId>com.moelholm</groupId>
        <artifactId>prometheus-spring-boot-starter</artifactId>
        <version>1.0.1</version>
    </dependency>
测试项目不使用spring安全性,但secondAPP使用spring安全性

第二个应用程序需要基本身份验证。普罗米修斯吊舱没有启动,它不知何故没有读取在scrape_配置中设置的凭证


有人能给我指出正确的方向吗?

您可以做的一件事是,当启用安全性时,允许
指标
端点工作。为此,可以使用此设置

endpoints.metrics.sensitive=false

endpoints.metrics.sensitive=false