File tree Expand file tree Collapse file tree
instrumentation/jaxws/jaxws-metro-2.2
javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/metro Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717import java .util .LinkedHashMap ;
1818import java .util .Map ;
1919import java .util .logging .Logger ;
20+ import javax .annotation .Nullable ;
2021import javax .xml .namespace .QName ;
2122
2223final class MetroServerSpanNameUpdater {
@@ -73,9 +74,6 @@ private void registerHttpServletRequestAdapter(
7374
7475 public void updateServerSpanName (Context context , MetroRequest metroRequest ) {
7576 String spanName = metroRequest .spanName ();
76- if (spanName == null ) {
77- return ;
78- }
7977
8078 Span serverSpan = LocalRootSpan .fromContextOrNull (context );
8179 if (serverSpan == null ) {
@@ -141,14 +139,17 @@ boolean canHandle(Object httpServletRequest) {
141139 return httpServletRequestClass .isInstance (httpServletRequest );
142140 }
143141
142+ @ Nullable
144143 String getServletPath (Object httpServletRequest ) {
145144 return invokeSafely (getServletPathMethodHandle , httpServletRequest );
146145 }
147146
147+ @ Nullable
148148 String getPathInfo (Object httpServletRequest ) {
149149 return invokeSafely (getPathInfoMethodHandle , httpServletRequest );
150150 }
151151
152+ @ Nullable
152153 private static String invokeSafely (MethodHandle methodHandle , Object httpServletRequest ) {
153154 try {
154155 return (String ) methodHandle .invoke (httpServletRequest );
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ features:
88 - CONTROLLER_SPANS
99configurations :
1010 - name : otel.instrumentation.common.experimental.controller-telemetry.enabled
11+ declarative_name : java.common.controller_telemetry/development.enabled
1112 description : Enables the creation of experimental controller spans.
1213 type : boolean
1314 default : false
You can’t perform that action at this time.
0 commit comments