Skip to content

Commit

Permalink
disable telemetry for MethodHandle lookups (#8160)
Browse files Browse the repository at this point in the history
can happen frequently (every startup on jdk8)
  • Loading branch information
jpbempel authored Jan 7, 2025
1 parent 0b03104 commit 54d4a6f
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package datadog.trace.bootstrap.debugger.el;

import static datadog.trace.api.telemetry.LogCollector.EXCLUDE_TELEMETRY;
import static java.lang.invoke.MethodType.methodType;

import datadog.trace.bootstrap.debugger.CapturedContext;
Expand All @@ -22,7 +23,7 @@ public class ReflectiveFieldValueResolver {
MethodHandles.Lookup lookup = MethodHandles.lookup();
methodHandle = lookup.findVirtual(Field.class, "trySetAccessible", methodType(boolean.class));
} catch (Exception e) {
LOGGER.debug("Looking up trySetAccessible failed: ", e);
LOGGER.debug(EXCLUDE_TELEMETRY, "Looking up trySetAccessible failed: ", e);
}
TRY_SET_ACCESSIBLE = methodHandle;
}
Expand All @@ -35,7 +36,7 @@ public class ReflectiveFieldValueResolver {
try {
field = ReflectiveFieldValueResolver.class.getDeclaredField("INACCESSIBLE_FIELD");
} catch (Exception e) {
LOGGER.debug("INACCESSIBLE_FIELD failed: ", e);
LOGGER.debug(EXCLUDE_TELEMETRY, "INACCESSIBLE_FIELD failed: ", e);
}
INACCESSIBLE_FIELD = field;
}
Expand All @@ -51,7 +52,7 @@ public class ReflectiveFieldValueResolver {
MethodHandles.Lookup lookup = MethodHandles.lookup();
methodHandle = lookup.findVirtual(Class.class, "getModule", methodType(moduleClass));
} catch (Exception e) {
LOGGER.debug("Looking up getModule failed: ", e);
LOGGER.debug(EXCLUDE_TELEMETRY, "Looking up getModule failed: ", e);
}
GET_MODULE = methodHandle;
MODULE_CLASS = moduleClass;
Expand Down

0 comments on commit 54d4a6f

Please sign in to comment.