From 7e37126a15dfb96f5728bad10ff3f7f425102056 Mon Sep 17 00:00:00 2001 From: Mateusz Rzeszutek Date: Fri, 11 Jun 2021 21:16:14 +0200 Subject: [PATCH] Internal instrumentations should always be enabled by default (#3257) --- .../classloader/ClassLoaderInstrumentationModule.java | 6 ++++++ .../internal/osgi/EclipseOsgiInstrumentationModule.java | 6 ++++++ .../internal/proxy/ProxyInstrumentationModule.java | 6 ++++++ .../urlclassloader/UrlClassLoaderInstrumentationModule.java | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/instrumentation/internal/internal-class-loader/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/internal/classloader/ClassLoaderInstrumentationModule.java b/instrumentation/internal/internal-class-loader/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/internal/classloader/ClassLoaderInstrumentationModule.java index 24c2103cfc30..b544abcef43e 100644 --- a/instrumentation/internal/internal-class-loader/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/internal/classloader/ClassLoaderInstrumentationModule.java +++ b/instrumentation/internal/internal-class-loader/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/internal/classloader/ClassLoaderInstrumentationModule.java @@ -18,6 +18,12 @@ public ClassLoaderInstrumentationModule() { super("internal-class-loader"); } + @Override + public boolean defaultEnabled() { + // internal instrumentations are always enabled by default + return true; + } + @Override public boolean isHelperClass(String className) { return className.equals("io.opentelemetry.javaagent.tooling.Constants"); diff --git a/instrumentation/internal/internal-eclipse-osgi-3.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/internal/osgi/EclipseOsgiInstrumentationModule.java b/instrumentation/internal/internal-eclipse-osgi-3.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/internal/osgi/EclipseOsgiInstrumentationModule.java index 806653591bda..f5d7e8cd2291 100644 --- a/instrumentation/internal/internal-eclipse-osgi-3.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/internal/osgi/EclipseOsgiInstrumentationModule.java +++ b/instrumentation/internal/internal-eclipse-osgi-3.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/internal/osgi/EclipseOsgiInstrumentationModule.java @@ -18,6 +18,12 @@ public EclipseOsgiInstrumentationModule() { super("internal-eclipse-osgi"); } + @Override + public boolean defaultEnabled() { + // internal instrumentations are always enabled by default + return true; + } + @Override public List typeInstrumentations() { return singletonList(new EclipseOsgiInstrumentation()); diff --git a/instrumentation/internal/internal-proxy/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/internal/proxy/ProxyInstrumentationModule.java b/instrumentation/internal/internal-proxy/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/internal/proxy/ProxyInstrumentationModule.java index 6cb26cae0c3d..347496a0a64b 100644 --- a/instrumentation/internal/internal-proxy/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/internal/proxy/ProxyInstrumentationModule.java +++ b/instrumentation/internal/internal-proxy/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/internal/proxy/ProxyInstrumentationModule.java @@ -18,6 +18,12 @@ public ProxyInstrumentationModule() { super("internal-proxy"); } + @Override + public boolean defaultEnabled() { + // internal instrumentations are always enabled by default + return true; + } + @Override public List typeInstrumentations() { return singletonList(new ProxyInstrumentation()); diff --git a/instrumentation/internal/internal-url-class-loader/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/internal/urlclassloader/UrlClassLoaderInstrumentationModule.java b/instrumentation/internal/internal-url-class-loader/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/internal/urlclassloader/UrlClassLoaderInstrumentationModule.java index ee300e582c0c..03f92be72deb 100644 --- a/instrumentation/internal/internal-url-class-loader/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/internal/urlclassloader/UrlClassLoaderInstrumentationModule.java +++ b/instrumentation/internal/internal-url-class-loader/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/internal/urlclassloader/UrlClassLoaderInstrumentationModule.java @@ -18,6 +18,12 @@ public UrlClassLoaderInstrumentationModule() { super("internal-url-class-loader"); } + @Override + public boolean defaultEnabled() { + // internal instrumentations are always enabled by default + return true; + } + @Override public List typeInstrumentations() { return singletonList(new UrlClassLoaderInstrumentation());