Skip to content

Commit 6bb2f79

Browse files
committed
Revert spring-webmvc view type null-guard change
1 parent 7c90b9a commit 6bb2f79

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

instrumentation/spring/spring-webmvc/spring-webmvc-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/webmvc/ModelAndViewAttributesExtractor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ public void onStart(
2626
if (CAPTURE_EXPERIMENTAL_SPAN_ATTRIBUTES) {
2727
attributes.put("spring-webmvc.view.name", modelAndView.getViewName());
2828
View view = modelAndView.getView();
29-
attributes.put("spring-webmvc.view.type", view == null ? null : view.getClass().getName());
29+
if (view != null) {
30+
attributes.put("spring-webmvc.view.type", view.getClass().getName());
31+
}
3032
}
3133
}
3234

0 commit comments

Comments
 (0)