Skip to content

Commit

Permalink
ISPN-14766 Disable Insight integration by default
Browse files Browse the repository at this point in the history
  • Loading branch information
fax4ever committed May 26, 2023
1 parent d60a72a commit 805b86c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,17 @@
public class InsightsModule implements ModuleLifecycle {

private static final Log log = LogFactory.getLog(InsightsModule.class, Log.class);
private static final String REDHAT_INSIGHTS_ENABLED = System.getProperty("infinispan.insights.enabled");

private InsightsReportController insightsReportController;

@Override
public void cacheManagerStarted(GlobalComponentRegistry gcr) {
if (REDHAT_INSIGHTS_ENABLED == null || !"true".equalsIgnoreCase(REDHAT_INSIGHTS_ENABLED.trim())) {
log.insightsDisabled();
return;
}

BlockingManager blockingManager = gcr.getComponent(BlockingManager.class);

InsightsConfiguration insightsConfiguration = new InfinispanInsightsConfiguration();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package org.infinispan.server.insights.logging;

import static org.jboss.logging.Logger.Level.INFO;

import org.infinispan.commons.CacheConfigurationException;
import org.infinispan.commons.CacheException;
import org.jboss.logging.BasicLogger;
import org.jboss.logging.annotations.Cause;
import org.jboss.logging.annotations.LogMessage;
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;

Expand All @@ -29,4 +32,8 @@ public interface Log extends BasicLogger {
@Message(value = "Red Hat Insight client shut down, it is not possible to schedule other tasks on it", id = 32004)
CacheConfigurationException clientSchedulerShutDown();

@LogMessage(level = INFO)
@Message(value = "RedHat Insights integration is disabled", id = 32005)
void insightsDisabled();

}

0 comments on commit 805b86c

Please sign in to comment.