其他分享
首页 > 其他分享> > actuator 去掉 按照url 统计数据

actuator 去掉 按照url 统计数据

作者:互联网

 

actuator 去掉 按照url查询数据

    @Bean
    @ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE)
    public SgWebFluxTagsProvider webFluxRequestProvider() {
        return new SgWebFluxTagsProvider();
    }

    @Bean
    @ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
    public SgWebMvcTagsProvider WebMvcTagsProvider() {
        return new SgWebMvcTagsProvider();
    }

    static class SgWebFluxTagsProvider implements WebFluxTagsProvider {
        @Override
        public Iterable<Tag> httpRequestTags(ServerWebExchange exchange, Throwable ex) {
            return new ArrayList<>();
        }
    }

    static class SgWebMvcTagsProvider implements WebMvcTagsProvider {
        @Override
        public Iterable<Tag> getTags(final HttpServletRequest request,
                                     final HttpServletResponse response,
                                     final Object handler,
                                     final Throwable exception) {
            return new ArrayList<>();
        }

        @Override
        public Iterable<Tag> getLongRequestTags(final HttpServletRequest request, final Object handler) {
            return new ArrayList<>();
        }
    }

 

标签:return,url,final,ConditionalOnWebApplication,new,Override,actuator,去掉,public
来源: https://www.cnblogs.com/snow-man/p/15770936.html