Remove charged language
MODIFY
benchmark/benchmark.gradle
benchmark/benchmark.gradle
@@ -55,6 +55,6 @@ tasks.jmh.dependsOn(':javaagent:shadowJar')
If using libasyncProfiler, use the following to generate nice svg flamegraphs.
sed '/unknown/d' benchmark/build/reports/jmh/profiler.txt | sed '/^thread_start/d' | sed '/not_walkable/d' > benchmark/build/reports/jmh/profiler-cleaned.txt
(using https://github.com/brendangregg/FlameGraph)
-./flamegraph.pl --color=java benchmark/build/reports/jmh/profiler-cleaned.txt > benchmark/build/reports/jmh/jmh-master.svg
+./flamegraph.pl --color=java benchmark/build/reports/jmh/profiler-cleaned.txt > benchmark/build/reports/jmh/jmh-main.svg
*/

MODIFY
instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/AbstractExecutorInstrumentation.java
instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/AbstractExecutorInstrumentation.java
@@ -42,27 +42,27 @@ public abstract class AbstractExecutorInstrumentation extends Instrumenter.Defau
private final boolean TRACE_ALL_EXECUTORS = Config.get().isTraceExecutorsAll();
/**
- * Only apply executor instrumentation to whitelisted executors. To apply to all executors, use
+ * Only apply executor instrumentation to allowed executors. To apply to all executors, use
* override setting above.
*/
- private final Collection<String> WHITELISTED_EXECUTORS;
+ private final Collection<String> ALLOWED_EXECUTORS;
/**
* Some frameworks have their executors defined as anon classes inside other classes. Referencing
* anon classes by name would be fragile, so instead we will use list of class prefix names. Since
* checking this list is more expensive (O(n)) we should try to keep it short.
*/
- private final Collection<String> WHITELISTED_EXECUTORS_PREFIXES;
+ private final Collection<String> ALLOWED_EXECUTORS_PREFIXES;
public AbstractExecutorInstrumentation(String... additionalNames) {
super(EXEC_NAME, additionalNames);
if (TRACE_ALL_EXECUTORS) {
log.info("Tracing all executors enabled.");
- WHITELISTED_EXECUTORS = Collections.emptyList();
- WHITELISTED_EXECUTORS_PREFIXES = Collections.emptyList();
+ ALLOWED_EXECUTORS = Collections.emptyList();
+ ALLOWED_EXECUTORS_PREFIXES = Collections.emptyList();
} else {
- String[] whitelist = {
+ String[] allowed = {
"akka.actor.ActorSystemImpl$$anon$1",
"akka.dispatch.BalancingDispatcher",
"akka.dispatch.Dispatcher",
@@ -107,13 +107,13 @@ public abstract class AbstractExecutorInstrumentation extends Instrumenter.Defau
};
Set<String> executors = new HashSet<>(Config.get().getTraceExecutors());
- executors.addAll(Arrays.asList(whitelist));
+ executors.addAll(Arrays.asList(allowed));
- WHITELISTED_EXECUTORS = Collections.unmodifiableSet(executors);
+ ALLOWED_EXECUTORS = Collections.unmodifiableSet(executors);
- String[] whitelistPrefixes = {"slick.util.AsyncExecutor$"};
- WHITELISTED_EXECUTORS_PREFIXES =
- Collections.unmodifiableCollection(Arrays.asList(whitelistPrefixes));
+ String[] allowedPrefixes = {"slick.util.AsyncExecutor$"};
+ ALLOWED_EXECUTORS_PREFIXES =
+ Collections.unmodifiableCollection(Arrays.asList(allowedPrefixes));
}
}
@@ -128,24 +128,24 @@ public abstract class AbstractExecutorInstrumentation extends Instrumenter.Defau
new ElementMatcher<TypeDescription>() {
@Override
public boolean matches(TypeDescription target) {
- boolean whitelisted = WHITELISTED_EXECUTORS.contains(target.getName());
+ boolean allowed = ALLOWED_EXECUTORS.contains(target.getName());
- // Check for possible prefixes match only if not whitelisted already
- if (!whitelisted) {
- for (String name : WHITELISTED_EXECUTORS_PREFIXES) {
+ // Check for possible prefixes match only if not allowed already
+ if (!allowed) {
+ for (String name : ALLOWED_EXECUTORS_PREFIXES) {
if (target.getName().startsWith(name)) {
- whitelisted = true;
+ allowed = true;
break;
}
}
}
- if (!whitelisted
+ if (!allowed
&& log.isDebugEnabled()
&& hasExecutorInterfaceMatcher.matches(target)) {
log.debug("Skipping executor instrumentation for {}", target.getName());
}
- return whitelisted;
+ return allowed;
}
});
}

MODIFY
instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/FutureInstrumentation.java
instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/FutureInstrumentation.java
@@ -45,13 +45,13 @@ public final class FutureInstrumentation extends Instrumenter.Default {
private static final Logger log = LoggerFactory.getLogger(FutureInstrumentation.class);
/**
- * Only apply executor instrumentation to whitelisted executors. In the future, this restriction
- * may be lifted to include all executors.
+ * Only apply executor instrumentation to allowed executors. In the future, this restriction may
+ * be lifted to include all executors.
*/
- private static final Collection<String> WHITELISTED_FUTURES;
+ private static final Collection<String> ALLOWED_FUTURES;
static {
- String[] whitelist = {
+ String[] allowed = {
"akka.dispatch.forkjoin.ForkJoinTask",
"akka.dispatch.forkjoin.ForkJoinTask$AdaptedCallable",
"akka.dispatch.forkjoin.ForkJoinTask$AdaptedRunnable",
@@ -84,7 +84,7 @@ public final class FutureInstrumentation extends Instrumenter.Default {
"scala.concurrent.forkjoin.ForkJoinTask$AdaptedRunnableAction",
"scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask",
};
- WHITELISTED_FUTURES = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(whitelist)));
+ ALLOWED_FUTURES = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(allowed)));
}
public FutureInstrumentation() {
@@ -98,11 +98,11 @@ public final class FutureInstrumentation extends Instrumenter.Default {
return new ElementMatcher.Junction.AbstractBase<TypeDescription>() {
@Override
public boolean matches(TypeDescription target) {
- boolean whitelisted = WHITELISTED_FUTURES.contains(target.getName());
- if (!whitelisted && log.isDebugEnabled() && hasFutureInterfaceMatcher.matches(target)) {
+ boolean allowed = ALLOWED_FUTURES.contains(target.getName());
+ if (!allowed && log.isDebugEnabled() && hasFutureInterfaceMatcher.matches(target)) {
log.debug("Skipping future instrumentation for {}", target.getName());
}
- return whitelisted;
+ return allowed;
}
}.and(hasFutureInterfaceMatcher); // Apply expensive matcher last.
}

Remove charged language (#1159)