-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SymDB report for any jar scanning failures (#8300)
Any bail out when resolving or scanning for jars will be reported into SymDBReport and logged as a single INFO log line at the end of SYMDB extraction process from SymDB enablement
- Loading branch information
Showing
5 changed files
with
70 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/symbol/SymDBReport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.datadog.debugger.symbol; | ||
|
||
import java.io.IOException; | ||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.HashSet; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Set; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class SymDBReport { | ||
private static final Logger LOGGER = LoggerFactory.getLogger(SymDBReport.class); | ||
|
||
private final Set<String> missingJars = new HashSet<>(); | ||
private final Set<String> directoryJars = new HashSet<>(); | ||
private final Map<String, String> ioExceptions = new HashMap<>(); | ||
private final List<String> locationErrors = new ArrayList<>(); | ||
|
||
public void addMissingJar(String jarPath) { | ||
missingJars.add(jarPath); | ||
} | ||
|
||
public void addDirectoryJar(String jarPath) { | ||
directoryJars.add(jarPath); | ||
} | ||
|
||
public void addIOException(String jarPath, IOException e) { | ||
ioExceptions.put(jarPath, e.toString()); | ||
} | ||
|
||
public void addLocationError(String locationStr) { | ||
locationErrors.add(locationStr); | ||
} | ||
|
||
public void report() { | ||
String content = | ||
"== SymDB Report == Location errors:" | ||
+ locationErrors | ||
+ " Missing jars: " | ||
+ missingJars | ||
+ " Directory jars: " | ||
+ directoryJars | ||
+ " IOExceptions: " | ||
+ ioExceptions; | ||
LOGGER.info(content); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters