Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ private static int getStackDepth() {
try {
return Integer.parseInt(value.substring(start, end));
} catch (NumberFormatException e) {
logger.debug(SEND_TELEMETRY, "Failed to parse stack depth from JFR options: " + value, e);
logger.debug(
SEND_TELEMETRY, "Failed to parse stack depth from JFR options: {}", value, e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ public DynamicType.Builder<?> transform(
"Failed to inject helper classes - instrumentation.class="
+ requestingName
+ " instrumentation.target.classloader={} instrumentation.target.class={}",
requestingName,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The requestingName was embedded in the message for telemetry purposes, but the argument wasn't removed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. This is exactly the example I had in mind as an approved exception for dynamic messages.

classLoader,
typeDescription,
e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@ private static String renderStackTrace(Throwable t) {
} else {
result.append(name);
}

if (isDataDogCode(t)) {
String msg = t.getMessage();
result.append(": ");
if (msg == null || msg.isEmpty()) {
result.append(UNKNOWN);
} else {
result.append(msg);
}
}
result.append('\n');

final StackTraceElement[] stacktrace = t.getStackTrace();
Expand Down Expand Up @@ -127,18 +117,6 @@ private static int countCommonFrames(
return count;
}

private static boolean isDataDogCode(Throwable t) {
StackTraceElement[] stackTrace = t.getStackTrace();
if (stackTrace == null || stackTrace.length == 0) {
return false;
}
String cn = stackTrace[0].getClassName();
if (cn.isEmpty()) {
return false;
}
return cn.startsWith("datadog.") || cn.startsWith("com.datadog.");
}

private static boolean shouldRedactClass(final String className) {
for (final String prefix : PACKAGE_ALLOW_LIST) {
if (className.startsWith(prefix)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class LogPeriodicActionTest extends DDSpecification {
1 * telemetryService.addLogMessage(_) >> { args -> logMessage = args[0] }
0 * _
logMessage.getMessage() == 'test'
logMessage.getStackTrace() == "${MutableException.canonicalName}: exception\n" +
logMessage.getStackTrace() == "${MutableException.canonicalName}\n" +
" at datadog.MyClass.method(file:42)\n"
}

Expand Down
Loading