优化监控配置
This commit is contained in:
parent
ee3557370f
commit
5dfdd61cf7
|
|
@ -135,6 +135,15 @@
|
|||
<groupId>com.github.loki4j</groupId>
|
||||
<artifactId>loki-logback-appender</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.redisson</groupId>
|
||||
<artifactId>redisson-spring-boot-starter</artifactId>
|
||||
<version>3.50.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
|||
|
|
@ -27,4 +27,10 @@ spring:
|
|||
max-request-size: 50MB
|
||||
logging:
|
||||
level:
|
||||
root: info
|
||||
root: info
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: '*'
|
||||
enabled-by-default: on
|
||||
|
|
@ -32,12 +32,19 @@ public class TraceFilter extends OncePerRequestFilter {
|
|||
|
||||
private static final String TRACE_ID_HEADER = "X-Trace-Id";
|
||||
|
||||
private static final List<String> URL_EXCLUDE_TEXTS = List.of("actuator");
|
||||
|
||||
// 需要跳过的二进制内容类型
|
||||
private static final List<String> BINARY_CONTENT_TYPES = Arrays.asList("image", "video", "audio", "stream", "pdf", "zip", "excel");
|
||||
|
||||
@Override
|
||||
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
|
||||
throws ServletException, IOException {
|
||||
if (URL_EXCLUDE_TEXTS.stream().anyMatch(text -> request.getRequestURI().contains(text))) {
|
||||
filterChain.doFilter(request, response);
|
||||
return;
|
||||
}
|
||||
|
||||
ContentCachingRequestWrapper requestWrapper = new ContentCachingRequestWrapper(request);
|
||||
ContentCachingResponseWrapper responseWrapper = new ContentCachingResponseWrapper(response);
|
||||
try {
|
||||
|
|
|
|||
Loading…
Reference in New Issue