diff --git a/instrumentation-security/resteasy-4/src/main/java/org/jboss/resteasy/core/MethodExpression_Instrumentation.java b/instrumentation-security/resteasy-4/src/main/java/org/jboss/resteasy/core/MethodExpression_Instrumentation.java new file mode 100644 index 000000000..35522e047 --- /dev/null +++ b/instrumentation-security/resteasy-4/src/main/java/org/jboss/resteasy/core/MethodExpression_Instrumentation.java @@ -0,0 +1,22 @@ +package org.jboss.resteasy.core; + +import com.newrelic.api.agent.security.NewRelicSecurity; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import org.jboss.resteasy.spi.HttpRequest; + +import java.util.regex.Matcher; + +@Weave(originalName = "org.jboss.resteasy.core.registry.MethodExpression") +public abstract class MethodExpression_Instrumentation { + public abstract String getPathExpression(); + public void populatePathParams(HttpRequest request, Matcher matcher, String path){ + Weaver.callOriginal(); + try { + if (NewRelicSecurity.isHookProcessingActive()) { + NewRelicSecurity.getAgent().getSecurityMetaData().getMetaData().setEndpointRoute(getPathExpression()); + } + } catch (Exception e) { + } + } +}