Skip to content

Commit dda564a

Browse files
committed
[PLAT-18928] Otel health checks are failing if DBME is disabled
Summary: Otel health checks are failing if DBME is disabled. The previous logic was wrong and would always result in checking for otel health when DBME is enabled then disabled. Test Plan: Manually tested: Created a universe Enabled DBME - ensure health check runs for the otel process Disabled DBME - ensure health check doesn't run for the otel process (would fail before this change) Also: Run UTs. Run itests. Reviewers: amalyshev, dkumar Reviewed By: dkumar Subscribers: yugaware Differential Revision: https://phorge.dev.yugabyte.com/D48141
1 parent de11e8e commit dda564a

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

managed/src/main/java/com/yugabyte/yw/commissioner/HealthChecker.java

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import com.yugabyte.yw.common.*;
3131
import com.yugabyte.yw.common.alerts.MaintenanceService;
3232
import com.yugabyte.yw.common.alerts.SmtpData;
33+
import com.yugabyte.yw.common.audit.otel.OtelCollectorUtil;
3334
import com.yugabyte.yw.common.config.GlobalConfKeys;
3435
import com.yugabyte.yw.common.config.RuntimeConfGetter;
3536
import com.yugabyte.yw.common.config.RuntimeConfigFactory;
@@ -849,21 +850,16 @@ public void checkSingleUniverse(CheckSingleUniverseParams params) {
849850
GFlagsUtil.getCustomTmpDirectory(nodeDetails, params.universe))
850851
: nodeInfo.getYbHomeDir());
851852
}
852-
nodeInfo.setOtelCollectorEnabled(params.universe.getUniverseDetails().otelCollectorEnabled);
853-
// Check if audit log export was ever enabled and disabled.
854-
AuditLogConfig auditLogConfig = cluster.userIntent.auditLogConfig;
855-
if (auditLogConfig != null) {
856-
nodeInfo.setOtelCollectorEnabled(auditLogConfig.isExportActive());
857-
}
858-
// Check if query log export was ever enabled and disabled.
859-
QueryLogConfig queryLogConfig = cluster.userIntent.queryLogConfig;
860-
if (queryLogConfig != null && !nodeInfo.isOtelCollectorEnabled()) {
861-
nodeInfo.setOtelCollectorEnabled(queryLogConfig.isExportActive());
862-
}
863-
// Check if metrics export was ever enabled and disabled.
864-
MetricsExportConfig metricsExportConfig = cluster.userIntent.metricsExportConfig;
865-
if (metricsExportConfig != null && !nodeInfo.isOtelCollectorEnabled()) {
866-
nodeInfo.setOtelCollectorEnabled(metricsExportConfig.isExportActive());
853+
// Check if any export is currently enabled in the universe.
854+
if (params.universe.getUniverseDetails().otelCollectorEnabled) {
855+
AuditLogConfig auditLogConfig = cluster.userIntent.auditLogConfig;
856+
QueryLogConfig queryLogConfig = cluster.userIntent.queryLogConfig;
857+
MetricsExportConfig metricsExportConfig = cluster.userIntent.metricsExportConfig;
858+
if (OtelCollectorUtil.isAuditLogExportEnabledInUniverse(auditLogConfig)
859+
|| OtelCollectorUtil.isQueryLogExportEnabledInUniverse(queryLogConfig)
860+
|| OtelCollectorUtil.isMetricsExportEnabledInUniverse(metricsExportConfig)) {
861+
nodeInfo.setOtelCollectorEnabled(true);
862+
}
867863
}
868864
nodeInfo.setClockboundEnabled(
869865
params.universe.getUniverseDetails().getPrimaryCluster().userIntent.isUseClockbound());
@@ -1342,7 +1338,7 @@ public static class NodeInfo {
13421338
private boolean enableYbc = false;
13431339
private int ybcPort = 18018;
13441340
private UUID universeUuid;
1345-
private boolean otelCollectorEnabled;
1341+
private boolean otelCollectorEnabled = false;
13461342
private boolean clockSyncServiceRequired = true;
13471343
private boolean clockboundEnabled = false;
13481344

0 commit comments

Comments
 (0)