Skip to content

Commit 526075f

Browse files
authored
Error Logs Remediation (#9459)
1 parent 673fcc5 commit 526075f

File tree

4 files changed

+3
-25
lines changed

4 files changed

+3
-25
lines changed

dd-java-agent/agent-profiling/profiling-controller/src/main/java/com/datadog/profiling/controller/ProfilerSettingsSupport.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ private static int getStackDepth() {
212212
try {
213213
return Integer.parseInt(value.substring(start, end));
214214
} catch (NumberFormatException e) {
215-
logger.debug(SEND_TELEMETRY, "Failed to parse stack depth from JFR options: " + value, e);
215+
logger.debug(
216+
SEND_TELEMETRY, "Failed to parse stack depth from JFR options: {}", value, e);
216217
}
217218
}
218219
}

dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/HelperInjector.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ public DynamicType.Builder<?> transform(
158158
"Failed to inject helper classes - instrumentation.class="
159159
+ requestingName
160160
+ " instrumentation.target.classloader={} instrumentation.target.class={}",
161-
requestingName,
162161
classLoader,
163162
typeDescription,
164163
e);

telemetry/src/main/java/datadog/telemetry/log/LogPeriodicAction.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,6 @@ private static String renderStackTrace(Throwable t) {
6363
} else {
6464
result.append(name);
6565
}
66-
67-
if (isDataDogCode(t)) {
68-
String msg = t.getMessage();
69-
result.append(": ");
70-
if (msg == null || msg.isEmpty()) {
71-
result.append(UNKNOWN);
72-
} else {
73-
result.append(msg);
74-
}
75-
}
7666
result.append('\n');
7767

7868
final StackTraceElement[] stacktrace = t.getStackTrace();
@@ -127,18 +117,6 @@ private static int countCommonFrames(
127117
return count;
128118
}
129119

130-
private static boolean isDataDogCode(Throwable t) {
131-
StackTraceElement[] stackTrace = t.getStackTrace();
132-
if (stackTrace == null || stackTrace.length == 0) {
133-
return false;
134-
}
135-
String cn = stackTrace[0].getClassName();
136-
if (cn.isEmpty()) {
137-
return false;
138-
}
139-
return cn.startsWith("datadog.") || cn.startsWith("com.datadog.");
140-
}
141-
142120
private static boolean shouldRedactClass(final String className) {
143121
for (final String prefix : PACKAGE_ALLOW_LIST) {
144122
if (className.startsWith(prefix)) {

telemetry/src/test/groovy/datadog/telemetry/log/LogPeriodicActionTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class LogPeriodicActionTest extends DDSpecification {
5050
1 * telemetryService.addLogMessage(_) >> { args -> logMessage = args[0] }
5151
0 * _
5252
logMessage.getMessage() == 'test'
53-
logMessage.getStackTrace() == "${MutableException.canonicalName}: exception\n" +
53+
logMessage.getStackTrace() == "${MutableException.canonicalName}\n" +
5454
" at datadog.MyClass.method(file:42)\n"
5555
}
5656

0 commit comments

Comments
 (0)