wu-sheng commented on a change in pull request #5348:
URL: https://github.com/apache/skywalking/pull/5348#discussion_r473082806
##########
File path:
apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/AbstractMethodInterceptor.java
##########
@@ -208,4 +222,31 @@ private void collectHttpParam(HttpServletRequest request,
AbstractSpan span) {
Tags.HTTP.PARAMS.set(span, tagValue);
}
}
+
+ private boolean shouldCollectHeader() {
+ List<String> includeHeaders =
SpringMVCPluginConfig.Plugin.Http.INCLUDE_HTTP_HEADERS;
+ return includeHeaders != null && includeHeaders.size() > 0 ;
+ }
+
+ private void collectHttpHeaders(HttpServletRequest request, AbstractSpan
span) {
+ final Enumeration<String> headerNames = request.getHeaderNames();
+ if (headerNames == null) {
+ return;
+ }
+ final List<String> headersList = new LinkedList<>();
+ Collections.list(headerNames).stream().forEach(headerName -> {
Review comment:
The whole iteration should base on
`SpringMVCPluginConfig.Plugin.Http.INCLUDE_HTTP_HEADERS` rather than header,
because you just config a subset of all headers. An HTTP request usually
includes a lot of headers.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]