Skip to content

Add more trace logging when installing monitor watches and #68752

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

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 @@ -429,9 +429,20 @@ private void setupClusterAlertsTasks(ClusterState clusterState, boolean clusterS
if (watches != null && watches.allPrimaryShardsActive() == false) {
logger.trace("cannot manage cluster alerts because [.watches] index is not allocated");
} else if ((watches == null || indexExists) && watcherSetup.compareAndSet(false, true)) {
logger.trace("installing monitoring watches");
getClusterAlertsInstallationAsyncActions(indexExists, asyncActions, pendingResponses);
} else {
logger.trace("skipping installing monitoring watches, watches=[{}], indexExists=[{}], watcherSetup=[{}]",
watches, indexExists, watcherSetup.get());
}
} else {
logger.trace("watches shouldn't be setup, because state=[{}] and clusterStateChange=[{}]", state.get(), clusterStateChange);
}
} else {
logger.trace("watches can't be used, because xpack.watcher.enabled=[{}] and " +
"xpack.monitoring.exporters._local.cluster_alerts.management.enabled=[{}]",
XPackSettings.WATCHER_ENABLED.get(config.settings()),
CLUSTER_ALERTS_MANAGEMENT_SETTING.getConcreteSettingForNamespace(config.name()).get(config.settings()));
}
}

Expand Down Expand Up @@ -577,6 +588,7 @@ private void getClusterAlertsInstallationAsyncActions(final boolean indexExists,
new ResponseActionListener<>("watch", uniqueWatchId, pendingResponses)));
}
} else if (addWatch) {
logger.trace("adding monitoring watch [{}]", uniqueWatchId);
asyncActions.add(() -> putWatch(client, watchId, uniqueWatchId, pendingResponses));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ private void stopMonitoring() {
));
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/66586")
@TestLogging(
value = "org.elasticsearch.xpack.monitoring.exporter.local:trace",
reason = "to ensure we log local exporter on trace level")
Expand Down Expand Up @@ -147,7 +146,6 @@ public void testLocalAlertsRemoval() throws Exception {
}
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/66586")
@TestLogging(
value = "org.elasticsearch.xpack.monitoring.exporter.local:trace",
reason = "to ensure we log local exporter on trace level")
Expand Down