Hystrix不显示仪表板

时间:2020-06-12 00:23:05

标签: spring-boot spring-boot-actuator spring-cloud-netflix hystrix hystrix-dashboard

这就是我的pom.xml的样子

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>SalaryBox</artifactId>
        <groupId>org.example</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.salary.box</groupId>
    <artifactId>greeting-service</artifactId>
    <packaging>war</packaging>

    <properties>
        <spring-cloud.version>Hoxton.SR5</spring-cloud.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-openfeign</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <repositories>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
        </repository>
    </repositories>

</project>

这是我的主要班级样子

@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@EnableCircuitBreaker
@EnableHystrixDashboard
公共类申请{
公共静态void main(String [] args){
SpringApplication.run(Application.class,args);
}
}

这是我的应用程序属性的样子

spring.application.name =问候服务
service.message-service.id = messages-service
management.endpoints.web.exposure.include = *

这是我的控制器的外观

@RestController 公共类GreetingController {

@Autowired
public GreetingsService greetingsService;

@HystrixCommand(fallbackMethod = "defaultMessage")
@RequestMapping("/greeting/{id}")
public Greeting findMyGreetingMessage(@PathVariable Long id) {
    Greeting greeting = new Greeting();
    greeting.setMessage(greetingsService.getMessage(id));
    return greeting;
}

public Greeting defaultMessage(Long id){
    Greeting greeting = new Greeting();
    greeting.setMessage("Message service seems to be broken");
    return greeting;
}

}

当我检查URL http://localhost:8082/actuator/hystrix.stream时,流似乎是按以下方式生成的

数据:{“ type”:“ HystrixCommand”,“ name”:“ findMyGreetingMessage”,“ group”:“ GreetingController”,“ currentTime”:1591920892870,“ isCircuitBreakerOpen”:false,“ errorPercentage”:0,“ errorCount “:0,” requestCount“:0,” rollingCountBadRequests“:0,” rollingCountCollapsedRequests“:0,” rollingCountEmit“:0,” rollingCountExceptionsThrown“:0,” rollingCountFailure“:0,” rollingCountFallbackEmit“:0,” rollingCountFallbackFailure“: 0,“ rollingCountFallbackMissing”:0,“ rollingCountFallbackRejection”:0,“ rollingCountFallbackSuccess”:0,“ rollingCountResponsesFromCache”:0,“ rollingCountSemaphoreRejected”:0,“ rollingCountShortCircuited”:0,“ rollingCountSuccess”:0:0,“ rollingCountThreadPool “ rollingCountTimeout”:0,“ currentConcurrentExecutionCount”:0,“ rollingMaxConcurrentExecutionCount”:0,“ latencyExecute_mean”:0,“ latencyExecute”:{“ 0”:0,“ 25”:0,“ 50”:0,“ 75” :0,“ 90”:0,“ 95”:0,“ 99”:0,“ 99.5”:0,“ 100”:0},“ latencyTotal_mean”:0,“ latencyTotal”:{“ 0”:0 ,“ 25”:0,“ 50”:0,“ 75”:0,“ 90”:0,“ 95”:0,“ 99”:0,“ 99.5”:0,“ 100”:0}, “ propertyValue_circuitBreake rRequestVolumeThreshold “:20,” propertyValue_circuitBreakerSleepWindowInMilliseconds “:5000,” propertyValue_circuitBreakerErrorThresholdPercentage “:50,” propertyValue_circuitBreakerForceOpen “:假的,” propertyValue_circuitBreakerForceClosed “:假的,” propertyValue_circuitBreakerEnabled “:真实的,” propertyValue_executionIsolationStrategy “:” 线程 “ ”propertyValue_executionIsolationThreadTimeoutInMilliseconds“:1000” propertyValue_executionTimeoutInMilliseconds “:1000,” propertyValue_executionIsolationThreadInterruptOnTimeout “:真实的,” propertyValue_executionIsolationThreadPoolKeyOverride “:空,” propertyValue_executionIsolationSemaphoreMaxConcurrentRequests “:10,” propertyValue_fallbackIsolationSemaphoreMaxConcurrentRequests “:10,” propertyValue_metricsRollingStatisticalWindowInMilliseconds “:10000,” propertyValue_requestCacheEnabled “:真实的,” propertyValue_requestLogEnabled “:真实的,” reportingHosts” :1,“ threadPool”:“ GreetingController”}

数据:{“ type”:“ HystrixThreadPool”,“ name”:“ GreetingController”,“ currentTime”:1591920892870,“ currentActiveCount”:0,“ currentCompletedTaskCount”:2,“ currentCorePoolSize”:10,“ currentLargestPoolSize”: 2,“ currentMaximumPoolSize”:10,“ currentPoolSize”:2,“ currentQueueSize”:0,“ currentTaskCount”:2,“ rollingCountThreadsExecuted”:0,“ rollingMaxActiveThreads”:0,“ rollingCountCommandRejections”:0,“ propertyValue_queueSizeRejectionThreshold”:5, “ propertyValue_metricsRollingStatisticalWindowInMilliseconds”:10000,“ reportingHosts”:1}

ping:

data:{“ type”:“ HystrixCommand”,“ name”:“ findMyGreetingMessage”,“ group”:“ GreetingController”,“ currentTime”:1591920893373,“ isCircuitBreakerOpen”:false,“ errorPercentage”:0,“ errorCount “:0,” requestCount“:0,” rollingCountBadRequests“:0,” rollingCountCollapsedRequests“:0,” rollingCountEmit“:0,” rollingCountExceptionsThrown“:0,” rollingCountFailure“:0,” rollingCountFallbackEmit“:0,” rollingCountFallbackFailure“: 0,“ rollingCountFallbackMissing”:0,“ rollingCountFallbackRejection”:0,“ rollingCountFallbackSuccess”:0,“ rollingCountResponsesFromCache”:0,“ rollingCountSemaphoreRejected”:0,“ rollingCountShortCircuited”:0,“ rollingCountSuccess”:0:0,“ rollingCountThreadPool “ rollingCountTimeout”:0,“ currentConcurrentExecutionCount”:0,“ rollingMaxConcurrentExecutionCount”:0,“ latencyExecute_mean”:0,“ latencyExecute”:{“ 0”:0,“ 25”:0,“ 50”:0,“ 75” :0,“ 90”:0,“ 95”:0,“ 99”:0,“ 99.5”:0,“ 100”:0},“ latencyTotal_mean”:0,“ latencyTotal”:{“ 0”:0 ,“ 25”:0,“ 50”:0,“ 75”:0,“ 90”:0,“ 95”:0,“ 99”:0,“ 99.5”:0,“ 100”:0}, “ propertyValue_circuitBreake rRequestVolumeThreshold “:20,” propertyValue_circuitBreakerSleepWindowInMilliseconds “:5000,” propertyValue_circuitBreakerErrorThresholdPercentage “:50,” propertyValue_circuitBreakerForceOpen “:假的,” propertyValue_circuitBreakerForceClosed “:假的,” propertyValue_circuitBreakerEnabled “:真实的,” propertyValue_executionIsolationStrategy “:” 线程 “ ”propertyValue_executionIsolationThreadTimeoutInMilliseconds“:1000” propertyValue_executionTimeoutInMilliseconds “:1000,” propertyValue_executionIsolationThreadInterruptOnTimeout “:真实的,” propertyValue_executionIsolationThreadPoolKeyOverride “:空,” propertyValue_executionIsolationSemaphoreMaxConcurrentRequests “:10,” propertyValue_fallbackIsolationSemaphoreMaxConcurrentRequests “:10,” propertyValue_metricsRollingStatisticalWindowInMilliseconds “:10000,” propertyValue_requestCacheEnabled “:真实的,” propertyValue_requestLogEnabled “:真实的,” reportingHosts” :1,“ threadPool”:“ GreetingController”}

数据:{“ type”:“ HystrixThreadPool”,“ name”:“ GreetingController”,“ currentTime”:1591920893373,“ currentActiveCount”:0,“ currentCompletedTaskCount”:2,“ currentCorePoolSize”:10,“ currentLargestPoolSize”: 2,“ currentMaximumPoolSize”:10,“ currentPoolSize”:2,“ currentQueueSize”:0,“ currentTaskCount”:2,“ rollingCountThreadsExecuted”:0,“ rollingMaxActiveThreads”:0,“ rollingCountCommandRejections”:0,“ propertyValue_queueSizeRejectionThreshold”:5, “ propertyValue_metricsRollingStatisticalWindowInMilliseconds”:10000,“ reportingHosts”:1}

ping:

但是,即使多次刷新仪表板并尝试多次访问该网址,仪表板仍停留在此位置。

enter image description here

我在这里想念什么?

0 个答案:

没有答案