From 61fc358d95149d511812843f06329b1627fb4cfd Mon Sep 17 00:00:00 2001 From: Oren Ben-Meir Date: Thu, 7 Nov 2024 12:54:07 -0500 Subject: [PATCH] Revert changes for jetty 12 --- .../jetty/server/Server_Instrumentation.java | 29 ++----------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/instrumentation/jetty-12/src/main/java/org/eclipse/jetty/server/Server_Instrumentation.java b/instrumentation/jetty-12/src/main/java/org/eclipse/jetty/server/Server_Instrumentation.java index 66d861b182..c0f327c4b2 100644 --- a/instrumentation/jetty-12/src/main/java/org/eclipse/jetty/server/Server_Instrumentation.java +++ b/instrumentation/jetty-12/src/main/java/org/eclipse/jetty/server/Server_Instrumentation.java @@ -14,12 +14,10 @@ import com.nr.agent.instrumentation.jetty12.JettyRequest; import com.nr.agent.instrumentation.jetty12.JettyResponse; import com.nr.agent.instrumentation.jetty12.JettySampler; -import org.eclipse.jetty.http.HttpField; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.thread.ThreadPool; import java.util.concurrent.TimeUnit; -import java.util.logging.Level; @Weave(type = MatchType.ExactClass, originalName = "org.eclipse.jetty.server.Server") public abstract class Server_Instrumentation { @@ -35,28 +33,8 @@ public boolean handle(Request request, Response response, Callback callback) { boolean startTransaction = request != null && !isStarted; if (startTransaction) { -// AgentBridge.getAgent().getTransaction(true) -// .requestInitialized(new JettyRequest(request), new JettyResponse(response)); - AgentBridge.getAgent().getLogger().log(Level.FINEST, - "NR-335227 commented out attempt to get or start transaction and call to requestInitialized()"); - - // Log headers - for(HttpField field : request.getHeaders()) { - if (field.getValue() == null) { - AgentBridge.getAgent().getLogger().log(Level.FINEST, - "NR-335227 server.handle() request contains null header with name " + field.getName()); - } else if (field.getValue().isBlank()) { - AgentBridge.getAgent().getLogger().log(Level.FINEST, "NR-335227 server.handle() request contains blank header with name " - + field.getName() - + " and with length of " - + field.getValue().length()); - } else { - AgentBridge.getAgent().getLogger().log(Level.FINEST, - "NR-335227 server.handle() request contains filled header with name " + field.getName()); - - } - - } + AgentBridge.getAgent().getTransaction(true) + .requestInitialized(new JettyRequest(request), new JettyResponse(response)); } boolean result = false; @@ -64,8 +42,7 @@ public boolean handle(Request request, Response response, Callback callback) { result = Weaver.callOriginal(); } finally { if (startTransaction) { - AgentBridge.getAgent().getLogger().log(Level.FINEST, "NR-335227 request destroyed commented out"); -// AgentBridge.getAgent().getTransaction().requestDestroyed(); + AgentBridge.getAgent().getTransaction().requestDestroyed(); } }