Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce logging noise in CI Visibility #6825

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ private CiVisibilitySettings getCiVisibilitySettings(TracerEnvironment tracerEnv
try {
CiVisibilitySettings settings = configurationApi.getSettings(tracerEnvironment);
if (settings.isGitUploadRequired()) {
LOGGER.info("Git data upload needs to finish before remote settings can be retrieved");
LOGGER.debug("Git data upload needs to finish before remote settings can be retrieved");
gitDataUploader
.startOrObserveGitDataUpload()
.get(config.getCiVisibilityGitUploadTimeoutMillis(), TimeUnit.MILLISECONDS);
Expand Down Expand Up @@ -202,7 +202,9 @@ private Map<String, String> getPropertiesPropagatedToChildProcess(
for (Map.Entry<Object, Object> e : systemProperties.entrySet()) {
String propertyName = (String) e.getKey();
Object propertyValue = e.getValue();
if (propertyName.startsWith(Config.PREFIX) && propertyValue != null) {
if ((propertyName.startsWith(Config.PREFIX)
|| propertyName.startsWith("datadog.slf4j.simpleLogger.defaultLogLevel"))
&& propertyValue != null) {
propagatedSystemProperties.put(propertyName, propertyValue.toString());
}
}
Expand Down Expand Up @@ -247,7 +249,7 @@ private SkippableTests getSkippableTests(
.get(config.getCiVisibilityGitUploadTimeoutMillis(), TimeUnit.MILLISECONDS);

SkippableTests skippableTests = configurationApi.getSkippableTests(tracerEnvironment);
LOGGER.info(
LOGGER.debug(
"Received {} skippable tests in total for {}",
skippableTests.getIdentifiers().size(),
repositoryRoot);
Expand Down Expand Up @@ -282,7 +284,7 @@ private SkippableTests getSkippableTests(
private Collection<TestIdentifier> getFlakyTests(TracerEnvironment tracerEnvironment) {
try {
Collection<TestIdentifier> flakyTests = configurationApi.getFlakyTests(tracerEnvironment);
LOGGER.info("Received {} flaky tests in total for {}", flakyTests.size(), repositoryRoot);
LOGGER.debug("Received {} flaky tests in total for {}", flakyTests.size(), repositoryRoot);
return flakyTests;

} catch (Exception e) {
Expand All @@ -297,7 +299,7 @@ private Map<String, Collection<TestIdentifier>> getKnownTests(
try {
Map<String, Collection<TestIdentifier>> knownTestsByModuleName =
configurationApi.getKnownTestsByModuleName(tracerEnvironment);
LOGGER.info(
LOGGER.debug(
"Received known tests for {} modules for {}",
knownTestsByModuleName.size(),
repositoryRoot);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static IBundleCoverage createCoverageBundle(
public static void dumpCoverageReport(
IBundleCoverage coverageBundle, RepoIndex repoIndex, String repoRoot, File reportFolder) {
if (!reportFolder.exists() && !reportFolder.mkdirs()) {
LOGGER.info("Skipping report generation, could not create report dir: {}", reportFolder);
LOGGER.debug("Skipping report generation, could not create report dir: {}", reportFolder);
return;
}
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public Future<Void> startOrObserveGitDataUpload() {

private void uploadGitData() {
try {
LOGGER.info("Starting git data upload, {}", gitClient);
LOGGER.debug("Starting git data upload, {}", gitClient);

if (config.isCiVisibilityGitUnshallowEnabled()
&& !config.isCiVisibilityGitUnshallowDefer()
Expand All @@ -98,14 +98,14 @@ private void uploadGitData() {
String remoteUrl = gitInfo.getRepositoryURL();
List<String> latestCommits = gitClient.getLatestCommits();
if (latestCommits.isEmpty()) {
LOGGER.info("No commits in the last month, skipping git data upload");
LOGGER.debug("No commits in the last month, skipping git data upload");
callback.complete(null);
return;
}

Collection<String> commitsToSkip = gitDataApi.searchCommits(remoteUrl, latestCommits);
if (commitsToSkip.size() == latestCommits.size()) {
LOGGER.info(
LOGGER.debug(
"Backend already knows of the {} local commits, skipping git data upload",
latestCommits.size());
callback.complete(null);
Expand All @@ -130,7 +130,7 @@ private void uploadGitData() {

List<String> objectHashes = gitClient.getObjects(commitsToSkip, commitsToInclude);
if (objectHashes.isEmpty()) {
LOGGER.info("No git objects to upload");
LOGGER.debug("No git objects to upload");
callback.complete(null);
return;
}
Expand Down Expand Up @@ -160,7 +160,7 @@ private void uploadGitData() {
FileUtils.delete(packFilesDirectory);
}

LOGGER.info("Git data upload finished");
LOGGER.debug("Git data upload finished");
callback.complete(null);

} catch (Exception e) {
Expand Down Expand Up @@ -191,7 +191,7 @@ private void unshallowRepository() throws IOException, TimeoutException, Interru
e);
gitClient.unshallow(null);
}
LOGGER.info("Repository unshallowing took {} ms", System.currentTimeMillis() - unshallowStart);
LOGGER.debug("Repository unshallowing took {} ms", System.currentTimeMillis() - unshallowStart);
}

private void waitForUploadToFinish() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void run() {
LOGGER.error("Error while executing signal server polling loop", e);
}
}
LOGGER.info("Signal server stopped");
LOGGER.debug("Signal server stopped");
}

private void processSelectableKeys() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public RepoIndex getIndex() {
}

private RepoIndex doGetIndex() {
log.warn("Building index of source files in {}, repo root is {}", scanRoot, repoRoot);
log.debug("Building index of source files in {}, repo root is {}", scanRoot, repoRoot);

Path repoRootPath = toRealPath(fileSystem.getPath(repoRoot));
Path scanRootPath = toRealPath(fileSystem.getPath(scanRoot));
Expand All @@ -80,7 +80,7 @@ private RepoIndex doGetIndex() {
long duration = System.currentTimeMillis() - startTime;
RepoIndexingStats stats = repoIndexingFileVisitor.indexingStats;
RepoIndex index = repoIndexingFileVisitor.getIndex();
log.info(
log.debug(
"Indexing took {} ms. Files visited: {}, source files visited: {}, resource files visited: {}, source roots found: {}, root packages found: {}",
duration,
stats.filesVisited,
Expand Down