Skip to content

Commit

Permalink
Revert changes for jetty 12
Browse files Browse the repository at this point in the history
  • Loading branch information
obenkenobi committed Nov 7, 2024
1 parent 8b49ba8 commit 61fc358
Showing 1 changed file with 3 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -35,37 +33,16 @@ 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;
try {
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();
}
}

Expand Down

1 comment on commit 61fc358

@kanderson250
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verifying commit as member of Java Agent Team. This was committed to revert the previous accidental commit.

Please sign in to comment.