Remove some no longer needed muzzleCheck() methods (#1660)
* Remove some no longer needed muzzleCheck() methods And add muzzle references to log4j 2.13.2 instrumentation
This commit is contained in:
parent
a446d7ea22
commit
cea28356c6
|
@ -1,27 +1,13 @@
|
||||||
apply from: "$rootDir/gradle/instrumentation.gradle"
|
apply from: "$rootDir/gradle/instrumentation.gradle"
|
||||||
|
|
||||||
muzzle {
|
muzzle {
|
||||||
// Version 2.7.5 and 2.7.8 were not released properly and muzzle cannot test against it causing failure.
|
|
||||||
// So we have to skip them resulting in this verbose setup.
|
|
||||||
fail {
|
|
||||||
group = 'com.couchbase.client'
|
|
||||||
module = 'java-client'
|
|
||||||
versions = "[,2.6.0)"
|
|
||||||
}
|
|
||||||
pass {
|
pass {
|
||||||
group = 'com.couchbase.client'
|
group = 'com.couchbase.client'
|
||||||
module = 'java-client'
|
module = 'java-client'
|
||||||
versions = "[2.6.0,2.7.5)"
|
versions = "[2.6.0,3)"
|
||||||
}
|
// Version 2.7.5 and 2.7.8 were not released properly and muzzle cannot test against it causing failure.
|
||||||
pass {
|
skipVersions += ['2.7.5', '2.7.8']
|
||||||
group = 'com.couchbase.client'
|
assertInverse = true
|
||||||
module = 'java-client'
|
|
||||||
versions = "[2.7.6,2.7.8)"
|
|
||||||
}
|
|
||||||
pass {
|
|
||||||
group = 'com.couchbase.client'
|
|
||||||
module = 'java-client'
|
|
||||||
versions = "[2.7.9,3.0.0)"
|
|
||||||
}
|
}
|
||||||
fail {
|
fail {
|
||||||
group = 'com.couchbase.client'
|
group = 'com.couchbase.client'
|
||||||
|
|
|
@ -15,7 +15,6 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||||
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
|
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
|
||||||
|
|
||||||
import com.couchbase.client.core.message.CouchbaseRequest;
|
import com.couchbase.client.core.message.CouchbaseRequest;
|
||||||
import com.couchbase.client.java.transcoder.crypto.JsonCryptoTranscoder;
|
|
||||||
import io.opentelemetry.api.trace.Span;
|
import io.opentelemetry.api.trace.Span;
|
||||||
import io.opentelemetry.api.trace.attributes.SemanticAttributes;
|
import io.opentelemetry.api.trace.attributes.SemanticAttributes;
|
||||||
import io.opentelemetry.instrumentation.api.tracer.utils.NetPeerUtils;
|
import io.opentelemetry.instrumentation.api.tracer.utils.NetPeerUtils;
|
||||||
|
@ -84,10 +83,5 @@ final class CouchbaseNetworkInstrumentation implements TypeInstrumentation {
|
||||||
span.setAttribute("local.address", localSocket);
|
span.setAttribute("local.address", localSocket);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2.6.0 and above
|
|
||||||
public static void muzzleCheck(JsonCryptoTranscoder transcoder) {
|
|
||||||
transcoder.documentType();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ final class CriteriaInstrumentation implements TypeInstrumentation {
|
||||||
CriteriaInstrumentation.class.getName() + "$CriteriaMethodAdvice");
|
CriteriaInstrumentation.class.getName() + "$CriteriaMethodAdvice");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class CriteriaMethodAdvice extends V3Advice {
|
public static class CriteriaMethodAdvice {
|
||||||
|
|
||||||
@Advice.OnMethodEnter(suppress = Throwable.class)
|
@Advice.OnMethodEnter(suppress = Throwable.class)
|
||||||
public static SpanWithScope startMethod(
|
public static SpanWithScope startMethod(
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
package io.opentelemetry.javaagent.instrumentation.hibernate.v3_3;
|
package io.opentelemetry.javaagent.instrumentation.hibernate.v3_3;
|
||||||
|
|
||||||
|
import static io.opentelemetry.javaagent.tooling.ClassLoaderMatcher.hasClassesNamed;
|
||||||
import static java.util.Arrays.asList;
|
import static java.util.Arrays.asList;
|
||||||
|
|
||||||
import com.google.auto.service.AutoService;
|
import com.google.auto.service.AutoService;
|
||||||
|
@ -15,6 +16,7 @@ import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import net.bytebuddy.matcher.ElementMatcher;
|
||||||
|
|
||||||
@AutoService(InstrumentationModule.class)
|
@AutoService(InstrumentationModule.class)
|
||||||
public class HibernateInstrumentationModule extends InstrumentationModule {
|
public class HibernateInstrumentationModule extends InstrumentationModule {
|
||||||
|
@ -23,12 +25,20 @@ public class HibernateInstrumentationModule extends InstrumentationModule {
|
||||||
super("hibernate", "hibernate-3.3");
|
super("hibernate", "hibernate-3.3");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
|
||||||
|
return hasClassesNamed(
|
||||||
|
// Not in 4.0
|
||||||
|
"org.hibernate.classic.Validatable",
|
||||||
|
// Not before 3.3.0.GA
|
||||||
|
"org.hibernate.transaction.JBossTransactionManagerLookup");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] helperClassNames() {
|
public String[] helperClassNames() {
|
||||||
return new String[] {
|
return new String[] {
|
||||||
"io.opentelemetry.javaagent.instrumentation.hibernate.SessionMethodUtils",
|
"io.opentelemetry.javaagent.instrumentation.hibernate.SessionMethodUtils",
|
||||||
"io.opentelemetry.javaagent.instrumentation.hibernate.HibernateDecorator",
|
"io.opentelemetry.javaagent.instrumentation.hibernate.HibernateDecorator",
|
||||||
packageName + ".V3Advice",
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ final class QueryInstrumentation implements TypeInstrumentation {
|
||||||
QueryInstrumentation.class.getName() + "$QueryMethodAdvice");
|
QueryInstrumentation.class.getName() + "$QueryMethodAdvice");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class QueryMethodAdvice extends V3Advice {
|
public static class QueryMethodAdvice {
|
||||||
|
|
||||||
@Advice.OnMethodEnter(suppress = Throwable.class)
|
@Advice.OnMethodEnter(suppress = Throwable.class)
|
||||||
public static SpanWithScope startMethod(@Advice.This Query query) {
|
public static SpanWithScope startMethod(@Advice.This Query query) {
|
||||||
|
|
|
@ -57,7 +57,7 @@ final class SessionFactoryInstrumentation implements TypeInstrumentation {
|
||||||
SessionFactoryInstrumentation.class.getName() + "$SessionFactoryAdvice");
|
SessionFactoryInstrumentation.class.getName() + "$SessionFactoryAdvice");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class SessionFactoryAdvice extends V3Advice {
|
public static class SessionFactoryAdvice {
|
||||||
|
|
||||||
@Advice.OnMethodExit(suppress = Throwable.class)
|
@Advice.OnMethodExit(suppress = Throwable.class)
|
||||||
public static void openSession(@Advice.Return Object session) {
|
public static void openSession(@Advice.Return Object session) {
|
||||||
|
|
|
@ -106,7 +106,7 @@ final class SessionInstrumentation implements TypeInstrumentation {
|
||||||
return transformers;
|
return transformers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class SessionCloseAdvice extends V3Advice {
|
public static class SessionCloseAdvice {
|
||||||
|
|
||||||
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
|
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
|
||||||
public static void closeSession(
|
public static void closeSession(
|
||||||
|
@ -134,7 +134,7 @@ final class SessionInstrumentation implements TypeInstrumentation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class SessionMethodAdvice extends V3Advice {
|
public static class SessionMethodAdvice {
|
||||||
|
|
||||||
@Advice.OnMethodEnter(suppress = Throwable.class)
|
@Advice.OnMethodEnter(suppress = Throwable.class)
|
||||||
public static SpanWithScope startMethod(
|
public static SpanWithScope startMethod(
|
||||||
|
@ -168,7 +168,7 @@ final class SessionInstrumentation implements TypeInstrumentation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class GetQueryAdvice extends V3Advice {
|
public static class GetQueryAdvice {
|
||||||
|
|
||||||
@Advice.OnMethodExit(suppress = Throwable.class)
|
@Advice.OnMethodExit(suppress = Throwable.class)
|
||||||
public static void getQuery(@Advice.This Object session, @Advice.Return Query query) {
|
public static void getQuery(@Advice.This Object session, @Advice.Return Query query) {
|
||||||
|
@ -189,7 +189,7 @@ final class SessionInstrumentation implements TypeInstrumentation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class GetTransactionAdvice extends V3Advice {
|
public static class GetTransactionAdvice {
|
||||||
|
|
||||||
@Advice.OnMethodExit(suppress = Throwable.class)
|
@Advice.OnMethodExit(suppress = Throwable.class)
|
||||||
public static void getTransaction(
|
public static void getTransaction(
|
||||||
|
@ -212,7 +212,7 @@ final class SessionInstrumentation implements TypeInstrumentation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class GetCriteriaAdvice extends V3Advice {
|
public static class GetCriteriaAdvice {
|
||||||
|
|
||||||
@Advice.OnMethodExit(suppress = Throwable.class)
|
@Advice.OnMethodExit(suppress = Throwable.class)
|
||||||
public static void getCriteria(@Advice.This Object session, @Advice.Return Criteria criteria) {
|
public static void getCriteria(@Advice.This Object session, @Advice.Return Criteria criteria) {
|
||||||
|
|
|
@ -45,7 +45,7 @@ final class TransactionInstrumentation implements TypeInstrumentation {
|
||||||
TransactionInstrumentation.class.getName() + "$TransactionCommitAdvice");
|
TransactionInstrumentation.class.getName() + "$TransactionCommitAdvice");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class TransactionCommitAdvice extends V3Advice {
|
public static class TransactionCommitAdvice {
|
||||||
|
|
||||||
@Advice.OnMethodEnter(suppress = Throwable.class)
|
@Advice.OnMethodEnter(suppress = Throwable.class)
|
||||||
public static SpanWithScope startCommit(@Advice.This Transaction transaction) {
|
public static SpanWithScope startCommit(@Advice.This Transaction transaction) {
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright The OpenTelemetry Authors
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
package io.opentelemetry.javaagent.instrumentation.hibernate.v3_3;
|
|
||||||
|
|
||||||
import org.hibernate.classic.Validatable;
|
|
||||||
import org.hibernate.transaction.JBossTransactionManagerLookup;
|
|
||||||
|
|
||||||
public abstract class V3Advice {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Some cases of instrumentation will match more broadly than others, so this unused method allows
|
|
||||||
* all instrumentation to uniformly match versions of Hibernate between 3.3 and 4.
|
|
||||||
*/
|
|
||||||
public static void muzzleCheck(
|
|
||||||
// Not in 4.0
|
|
||||||
Validatable validatable,
|
|
||||||
// Not before 3.3.0.GA
|
|
||||||
JBossTransactionManagerLookup lookup) {
|
|
||||||
validatable.validate();
|
|
||||||
lookup.getUserTransactionName();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -46,7 +46,7 @@ final class CriteriaInstrumentation implements TypeInstrumentation {
|
||||||
CriteriaInstrumentation.class.getName() + "$CriteriaMethodAdvice");
|
CriteriaInstrumentation.class.getName() + "$CriteriaMethodAdvice");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class CriteriaMethodAdvice extends V4Advice {
|
public static class CriteriaMethodAdvice {
|
||||||
|
|
||||||
@Advice.OnMethodEnter(suppress = Throwable.class)
|
@Advice.OnMethodEnter(suppress = Throwable.class)
|
||||||
public static SpanWithScope startMethod(
|
public static SpanWithScope startMethod(
|
||||||
|
|
|
@ -28,7 +28,6 @@ public class HibernateInstrumentationModule extends InstrumentationModule {
|
||||||
return new String[] {
|
return new String[] {
|
||||||
"io.opentelemetry.javaagent.instrumentation.hibernate.SessionMethodUtils",
|
"io.opentelemetry.javaagent.instrumentation.hibernate.SessionMethodUtils",
|
||||||
"io.opentelemetry.javaagent.instrumentation.hibernate.HibernateDecorator",
|
"io.opentelemetry.javaagent.instrumentation.hibernate.HibernateDecorator",
|
||||||
packageName + ".V4Advice",
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ final class QueryInstrumentation implements TypeInstrumentation {
|
||||||
QueryInstrumentation.class.getName() + "$QueryMethodAdvice");
|
QueryInstrumentation.class.getName() + "$QueryMethodAdvice");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class QueryMethodAdvice extends V4Advice {
|
public static class QueryMethodAdvice {
|
||||||
|
|
||||||
@Advice.OnMethodEnter(suppress = Throwable.class)
|
@Advice.OnMethodEnter(suppress = Throwable.class)
|
||||||
public static SpanWithScope startMethod(@Advice.This Query query) {
|
public static SpanWithScope startMethod(@Advice.This Query query) {
|
||||||
|
|
|
@ -52,7 +52,7 @@ final class SessionFactoryInstrumentation implements TypeInstrumentation {
|
||||||
SessionFactoryInstrumentation.class.getName() + "$SessionFactoryAdvice");
|
SessionFactoryInstrumentation.class.getName() + "$SessionFactoryAdvice");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class SessionFactoryAdvice extends V4Advice {
|
public static class SessionFactoryAdvice {
|
||||||
|
|
||||||
@Advice.OnMethodExit(suppress = Throwable.class)
|
@Advice.OnMethodExit(suppress = Throwable.class)
|
||||||
public static void openSession(@Advice.Return SharedSessionContract session) {
|
public static void openSession(@Advice.Return SharedSessionContract session) {
|
||||||
|
|
|
@ -103,7 +103,7 @@ final class SessionInstrumentation implements TypeInstrumentation {
|
||||||
return transformers;
|
return transformers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class SessionCloseAdvice extends V4Advice {
|
public static class SessionCloseAdvice {
|
||||||
|
|
||||||
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
|
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
|
||||||
public static void closeSession(
|
public static void closeSession(
|
||||||
|
@ -123,7 +123,7 @@ final class SessionInstrumentation implements TypeInstrumentation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class SessionMethodAdvice extends V4Advice {
|
public static class SessionMethodAdvice {
|
||||||
|
|
||||||
@Advice.OnMethodEnter(suppress = Throwable.class)
|
@Advice.OnMethodEnter(suppress = Throwable.class)
|
||||||
public static SpanWithScope startMethod(
|
public static SpanWithScope startMethod(
|
||||||
|
@ -149,7 +149,7 @@ final class SessionInstrumentation implements TypeInstrumentation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class GetQueryAdvice extends V4Advice {
|
public static class GetQueryAdvice {
|
||||||
|
|
||||||
@Advice.OnMethodExit(suppress = Throwable.class)
|
@Advice.OnMethodExit(suppress = Throwable.class)
|
||||||
public static void getQuery(
|
public static void getQuery(
|
||||||
|
@ -165,7 +165,7 @@ final class SessionInstrumentation implements TypeInstrumentation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class GetTransactionAdvice extends V4Advice {
|
public static class GetTransactionAdvice {
|
||||||
|
|
||||||
@Advice.OnMethodExit(suppress = Throwable.class)
|
@Advice.OnMethodExit(suppress = Throwable.class)
|
||||||
public static void getTransaction(
|
public static void getTransaction(
|
||||||
|
@ -181,7 +181,7 @@ final class SessionInstrumentation implements TypeInstrumentation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class GetCriteriaAdvice extends V4Advice {
|
public static class GetCriteriaAdvice {
|
||||||
|
|
||||||
@Advice.OnMethodExit(suppress = Throwable.class)
|
@Advice.OnMethodExit(suppress = Throwable.class)
|
||||||
public static void getCriteria(
|
public static void getCriteria(
|
||||||
|
|
|
@ -45,7 +45,7 @@ final class TransactionInstrumentation implements TypeInstrumentation {
|
||||||
TransactionInstrumentation.class.getName() + "$TransactionCommitAdvice");
|
TransactionInstrumentation.class.getName() + "$TransactionCommitAdvice");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class TransactionCommitAdvice extends V4Advice {
|
public static class TransactionCommitAdvice {
|
||||||
|
|
||||||
@Advice.OnMethodEnter(suppress = Throwable.class)
|
@Advice.OnMethodEnter(suppress = Throwable.class)
|
||||||
public static SpanWithScope startCommit(@Advice.This Transaction transaction) {
|
public static SpanWithScope startCommit(@Advice.This Transaction transaction) {
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright The OpenTelemetry Authors
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
package io.opentelemetry.javaagent.instrumentation.hibernate.v4_0;
|
|
||||||
|
|
||||||
import org.hibernate.SharedSessionContract;
|
|
||||||
|
|
||||||
public abstract class V4Advice {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Some cases of instrumentation will match more broadly than others, so this unused method allows
|
|
||||||
* all instrumentation to uniformly match versions of Hibernate starting at 4.0.
|
|
||||||
*/
|
|
||||||
public static void muzzleCheck(SharedSessionContract contract) {
|
|
||||||
contract.createCriteria("");
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -7,14 +7,17 @@ package io.opentelemetry.javaagent.instrumentation.log4j.v2_13_2;
|
||||||
|
|
||||||
import static io.opentelemetry.javaagent.tooling.ClassLoaderMatcher.hasClassesNamed;
|
import static io.opentelemetry.javaagent.tooling.ClassLoaderMatcher.hasClassesNamed;
|
||||||
import static java.util.Collections.singletonList;
|
import static java.util.Collections.singletonList;
|
||||||
|
import static java.util.Collections.singletonMap;
|
||||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||||
|
import static net.bytebuddy.matcher.ElementMatchers.none;
|
||||||
|
|
||||||
import com.google.auto.service.AutoService;
|
import com.google.auto.service.AutoService;
|
||||||
|
import io.opentelemetry.instrumentation.log4j.v2_13_2.OpenTelemetryContextDataProvider;
|
||||||
import io.opentelemetry.javaagent.tooling.InstrumentationModule;
|
import io.opentelemetry.javaagent.tooling.InstrumentationModule;
|
||||||
import io.opentelemetry.javaagent.tooling.TypeInstrumentation;
|
import io.opentelemetry.javaagent.tooling.TypeInstrumentation;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import net.bytebuddy.asm.Advice;
|
||||||
import net.bytebuddy.description.method.MethodDescription;
|
import net.bytebuddy.description.method.MethodDescription;
|
||||||
import net.bytebuddy.description.type.TypeDescription;
|
import net.bytebuddy.description.type.TypeDescription;
|
||||||
import net.bytebuddy.matcher.ElementMatcher;
|
import net.bytebuddy.matcher.ElementMatcher;
|
||||||
|
@ -63,8 +66,18 @@ public final class Log4j2InstrumentationModule extends InstrumentationModule {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||||
// Nothing to instrument, injecting helper resource & class is enough
|
// Nothing to instrument, no methods to match
|
||||||
return Collections.emptyMap();
|
return singletonMap(none(), getClass().getName() + "$MuzzleCheckAdvice");
|
||||||
|
}
|
||||||
|
|
||||||
|
// This way muzzle will collect OpenTelemetryContextDataProvider references
|
||||||
|
public static class MuzzleCheckAdvice {
|
||||||
|
@Advice.OnMethodEnter
|
||||||
|
public static void onEnter() {}
|
||||||
|
|
||||||
|
public static void muzzleCheck(OpenTelemetryContextDataProvider contextDataProvider) {
|
||||||
|
contextDataProvider.supplyContextData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ muzzle {
|
||||||
group = "org.apache.logging.log4j"
|
group = "org.apache.logging.log4j"
|
||||||
module = "log4j-core"
|
module = "log4j-core"
|
||||||
versions = "[2.7,2.13.2)"
|
versions = "[2.7,2.13.2)"
|
||||||
|
assertInverse = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright The OpenTelemetry Authors
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
package io.opentelemetry.javaagent.instrumentation.netty.v3_8;
|
|
||||||
|
|
||||||
import org.jboss.netty.handler.codec.http.HttpHeaders;
|
|
||||||
import org.jboss.netty.handler.codec.http.HttpRequest;
|
|
||||||
|
|
||||||
public class AbstractNettyAdvice {
|
|
||||||
public static void muzzleCheck(HttpRequest httpRequest) {
|
|
||||||
HttpHeaders headers = httpRequest.headers();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -50,7 +50,7 @@ final class ChannelFutureListenerInstrumentation implements TypeInstrumentation
|
||||||
ChannelFutureListenerInstrumentation.class.getName() + "$OperationCompleteAdvice");
|
ChannelFutureListenerInstrumentation.class.getName() + "$OperationCompleteAdvice");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class OperationCompleteAdvice extends AbstractNettyAdvice {
|
public static class OperationCompleteAdvice {
|
||||||
@Advice.OnMethodEnter
|
@Advice.OnMethodEnter
|
||||||
public static Scope activateScope(@Advice.Argument(0) ChannelFuture future) {
|
public static Scope activateScope(@Advice.Argument(0) ChannelFuture future) {
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -49,7 +49,7 @@ final class NettyChannelInstrumentation implements TypeInstrumentation {
|
||||||
return transformers;
|
return transformers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class ChannelConnectAdvice extends AbstractNettyAdvice {
|
public static class ChannelConnectAdvice {
|
||||||
@Advice.OnMethodEnter
|
@Advice.OnMethodEnter
|
||||||
public static void addConnectContinuation(@Advice.This Channel channel) {
|
public static void addConnectContinuation(@Advice.This Channel channel) {
|
||||||
Context context = Java8BytecodeBridge.currentContext();
|
Context context = Java8BytecodeBridge.currentContext();
|
||||||
|
|
|
@ -110,7 +110,7 @@ final class NettyChannelPipelineInstrumentation implements TypeInstrumentation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class ChannelPipelineAdd2ArgsAdvice extends AbstractNettyAdvice {
|
public static class ChannelPipelineAdd2ArgsAdvice {
|
||||||
@Advice.OnMethodEnter
|
@Advice.OnMethodEnter
|
||||||
public static int checkDepth(
|
public static int checkDepth(
|
||||||
@Advice.This ChannelPipeline pipeline, @Advice.Argument(1) ChannelHandler handler) {
|
@Advice.This ChannelPipeline pipeline, @Advice.Argument(1) ChannelHandler handler) {
|
||||||
|
@ -139,7 +139,7 @@ final class NettyChannelPipelineInstrumentation implements TypeInstrumentation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class ChannelPipelineAdd3ArgsAdvice extends AbstractNettyAdvice {
|
public static class ChannelPipelineAdd3ArgsAdvice {
|
||||||
@Advice.OnMethodEnter
|
@Advice.OnMethodEnter
|
||||||
public static int checkDepth(
|
public static int checkDepth(
|
||||||
@Advice.This ChannelPipeline pipeline, @Advice.Argument(2) ChannelHandler handler) {
|
@Advice.This ChannelPipeline pipeline, @Advice.Argument(2) ChannelHandler handler) {
|
||||||
|
|
|
@ -40,7 +40,6 @@ public class NettyInstrumentationModule extends InstrumentationModule {
|
||||||
packageName + ".server.HttpServerRequestTracingHandler",
|
packageName + ".server.HttpServerRequestTracingHandler",
|
||||||
packageName + ".server.HttpServerResponseTracingHandler",
|
packageName + ".server.HttpServerResponseTracingHandler",
|
||||||
packageName + ".server.HttpServerTracingHandler",
|
packageName + ".server.HttpServerTracingHandler",
|
||||||
packageName + ".AbstractNettyAdvice"
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,12 +74,6 @@ public final class SpringDataInstrumentationModule extends InstrumentationModule
|
||||||
repositoryFactorySupport.addRepositoryProxyPostProcessor(
|
repositoryFactorySupport.addRepositoryProxyPostProcessor(
|
||||||
InterceptingRepositoryProxyPostProcessor.INSTANCE);
|
InterceptingRepositoryProxyPostProcessor.INSTANCE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Muzzle doesn't detect the "Override" implementation dependency, so we have to help it.
|
|
||||||
private void muzzleCheck(RepositoryProxyPostProcessor processor) {
|
|
||||||
processor.postProcess(null, null);
|
|
||||||
// (see usage in InterceptingRepositoryProxyPostProcessor below)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class InterceptingRepositoryProxyPostProcessor
|
public static final class InterceptingRepositoryProxyPostProcessor
|
||||||
|
|
Loading…
Reference in New Issue