Springcloud--admin Monitoring use

Source: Internet
Author: User

Admin Monitoring App

The monitoring interfaces provided by Spring boot, such as/health,/info, etc., in fact, in addition to the information previously mentioned, there are other information industries that need to be monitored: the number of sessions currently active, the number of concurrent applications currently in use, the latency, and other metric information. Let's look at how to use Spring-boot-admin to monitor our system.

Admin-server-ui

pom.xmlConfiguration:

  1. <parent>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactid>spring-boot-starter-parent</artifactid>
  4. <version>1.4.3.release</version>
  5. <relativepath/>
  6. </parent>
  7. <dependencymanagement>
  8. <dependencies>
  9. <dependency>
  10. <groupId>org.springframework.cloud</groupId>
  11. <artifactid>spring-cloud-dependencies</artifactid>
  12. <version>CAMDEN.SR5</version>
  13. <type>pom</type>
  14. <scope>import</scope>
  15. </dependency>
  16. </dependencies>
  17. </dependencymanagement>
  18. <dependencies>
  19. <dependency>
  20. <groupId>org.springframework.cloud</groupId>
  21. <artifactid>spring-cloud-starter-eureka</artifactid>
  22. </dependency>
  23. <dependency>
  24. <groupId>de.codecentric</groupId>
  25. <artifactid>spring-boot-admin-server</artifactid>
  26. <version>1.4.5</version>
  27. </dependency>
  28. <dependency>
  29. <groupId>de.codecentric</groupId>
  30. <artifactid>spring-boot-admin-server-ui</artifactid>
  31. <version>1.4.5</version>
  32. </dependency>
  33. </dependencies>
    • Note Version number (1.5.2+1.5.7)

application.propertiesConfiguration:

    1. Spring. Application. Name=admin-ui
    2. Info. version=@project. Version@
    3. Server. port=8080
    4. Eureka. Clientserviceurl. Defaultzone=http://localhost:8888/eureka/

Java code:

  1. @SpringBootApplication
  2. @EnableDiscoveryClient
  3. @EnableAdminServer
  4. public class adminapplication {
  5. public static void main(string[] args) {
  6. Springapplication.run (Adminapplication.class, args);
  7. }
  8. }

logback-spring.xmlConfiguration:

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <configuration>
  3. <include resource="Org/springframework/boot/logging/logback/base.xml"/ >
  4. <jmxconfigurator/>
  5. </configuration>
Add other items to be monitored

Added to the monitored service pom.xml :

  1. <!--
  2. the spring-boot-starter-actuator contained in the spring-boot-admin-starter-client is used to collect service information
  3. <dependency>
  4. <groupId>org.springframework.boot</groupId>
  5. <artifactId>spring-boot-starter-actuator</artifactId>
  6. </dependency>
  7. -
  8. <dependency>
  9. <groupId>de.codecentric</groupId>
  10. <artifactid>spring-boot-admin-starter-client</artifactid>
  11. <version>1.4.5</version>
  12. </dependency>

application.propertiesIncrease:

    1. # Turn off secure access
    2. management.security.enabled=false
    3. # If the monitored service is not registered to the service center, you need to add the admin address
    4. # spring.boot.admin.url=http://localhost:8888

Increase logback-spring.xml :

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <configuration>
  3. <include resource="Org/springframework/boot/logging/logback/base.xml"/>
  4. <jmxconfigurator/>
  5. </configuration>

    • Main control Interface:

    • The details page of a single service, others do not repeat.

Turn from: 79708622

Springcloud--admin Monitoring use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.