This article does not conduct Spring Boot Admin introductory knowledge statements
In Spring Boot Actuator
providing many as in health
, metrics
real-time monitoring interface, you can easily keep track of the performance of our services. Spring Boot
The default is to open these interfaces provide called, then the question is, if these interface exposes a foreign network, can easily be exploited by criminals, this is certainly not the result we want. Here we provide a better solution.
- Monitored service configuration
Request to add the prefix http request be protected
1 |
management: |
- Request to add a prefix
Spring Boot Admin
At startup will goeureka
got me to the service information,health
andinfo
require special handling, both of which are based on the addressstatus-page-url-path
andhealth-check-url-path
value.
zuul
Gateway Configuration
zuul
Internal protection service http Interface
1 |
zuul: |
- The reason here is not
/example-context/**
due to the presence prefix Gateway project, a need to move forward, you can configure specific scenarios specific
Spring Boot Admin
Configuration
Configuration parameters monitored indicators
1 |
spring:< 大专栏 Spring Boot Admin最佳实践/span> |
- And application configuration
management.context-path
identical - Adding applications to be monitored
Service-Id
, separated by commas
Explain, by creating a request prefix, you can use the prefix at the gateway ways to exclude, which is outside the network can not access those monitoring API, at the same time, the network can still be prefixed way access for Spring Boot Admin
providing support condition. management
Also supports port and ip way, but there are limitations in two ways, if the deployment of multiple services on the same machine, it will occupy the port or other problems exist. This approach also has the benefit above configuration Once defined, all services do not require specialized treatment, it can be used directly.
Q & A:
- 问题:Full authentication is required to access this resource