Skip to content

Commit

Permalink
Merge pull request #1959 from newrelic/vertx-http2
Browse files Browse the repository at this point in the history
Refactor vertx-web to weave Http2ServerConnection
  • Loading branch information
jasonjkeller authored Jun 26, 2024
2 parents 7ce4777 + ab39281 commit 85e2eea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
/*
*
* * Copyright 2020 New Relic Corporation. All rights reserved.
* * Copyright 2024 New Relic Corporation. All rights reserved.
* * SPDX-License-Identifier: Apache-2.0
*
*/

package io.vertx.core.http.impl;

import com.newrelic.api.agent.weaver.MatchType;
import com.newrelic.api.agent.weaver.Weave;
import com.newrelic.api.agent.weaver.Weaver;
import com.nr.vertx.instrumentation.VertxUtil;
import io.vertx.core.Handler;
import io.vertx.core.http.HttpServerRequest;

@Weave(originalName = "io.vertx.core.http.impl.Http1xServerConnection")
public class Http1xServerConnection_Instrumentation {

// This interface has HTTP/1 and HTTP/2 implementations
@Weave(type = MatchType.Interface, originalName = "io.vertx.core.http.impl.HttpServerConnection")
public abstract class HttpServerConnection_Instrumentation {
public HttpServerConnection handler(Handler<HttpServerRequest> handler) {
if (handler != null) {
// Wrap the request handler so we can start the transaction and start tracking child threads
// Wrap the request handler, so we can start the transaction and start tracking child threads
handler = VertxUtil.wrapRequestHandler(handler);
}
return Weaver.callOriginal();
}

}
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
/*
*
* * Copyright 2020 New Relic Corporation. All rights reserved.
* * Copyright 2024 New Relic Corporation. All rights reserved.
* * SPDX-License-Identifier: Apache-2.0
*
*/

package io.vertx.core.http.impl;

import com.newrelic.api.agent.weaver.MatchType;
import com.newrelic.api.agent.weaver.Weave;
import com.newrelic.api.agent.weaver.Weaver;
import com.nr.vertx.instrumentation.VertxUtil;
import io.vertx.core.Handler;
import io.vertx.core.http.HttpServerRequest;

@Weave(originalName = "io.vertx.core.http.impl.Http1xServerConnection")
public class Http1xServerConnection_Instrumentation {

// This interface has HTTP/1 and HTTP/2 implementations
@Weave(type = MatchType.Interface, originalName = "io.vertx.core.http.impl.HttpServerConnection")
public abstract class HttpServerConnection_Instrumentation {
public HttpServerConnection handler(Handler<HttpServerRequest> handler) {
if (handler != null) {
// Wrap the request handler so we can start the transaction and start tracking child threads
// Wrap the request handler, so we can start the transaction and start tracking child threads
handler = VertxUtil.wrapRequestHandler(handler);
}
return Weaver.callOriginal();
}

}

0 comments on commit 85e2eea

Please sign in to comment.