spring boot 添加监控

在application.properties中,添加

        spring.application.name=Spring Boot Admin Web
        spring.boot.admin.url=http://localhost:${server.port}
        spring.jackson.serialization.indent_output=true
        endpoints.health.sensitive=false
        management.security.enabled=false
        ribbon.ReadTimeout=60000
        ribbon.ConnectTimeout=60000

在 启动类中添加

            @EnableAdminServer

在 pom.xml中添加

                <dependency>
                                    <groupId>de.codecentric</groupId>
                                    <artifactId>spring-boot-admin-server</artifactId>
                                    <version>1.5.7</version>
            </dependency>

            <dependency>
                <groupId>de.codecentric</groupId>
                <artifactId>spring-boot-admin-server-ui</artifactId>
                <version>1.5.7</version>
            </dependency>

            <dependency>
                <groupId>de.codecentric</groupId>
                <artifactId>spring-boot-admin-starter-client</artifactId>
                <version>1.5.7</version>
            </dependency>

猜你喜欢

转载自blog.51cto.com/6612493/2286807