Prevent NPE
MODIFY
instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/main/java/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/internal/JettyHttpClient9TracingInterceptor.java
instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/main/java/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/internal/JettyHttpClient9TracingInterceptor.java
@@ -136,9 +136,11 @@ public class JettyHttpClient9TracingInterceptor
if (this.context != null) {
Span span = Span.fromContext(this.context);
HttpField agentField = request.getHeaders().getField(HttpHeader.USER_AGENT);
+ if (agentField != null) {
span.setAttribute(SemanticAttributes.HTTP_USER_AGENT, agentField.getValue());
}
}
+ }
@Override
public void onComplete(Result result) {

Prevent NPE (#4527)