|
30 | 30 | import com.yugabyte.yw.common.*; |
31 | 31 | import com.yugabyte.yw.common.alerts.MaintenanceService; |
32 | 32 | import com.yugabyte.yw.common.alerts.SmtpData; |
| 33 | +import com.yugabyte.yw.common.audit.otel.OtelCollectorUtil; |
33 | 34 | import com.yugabyte.yw.common.config.GlobalConfKeys; |
34 | 35 | import com.yugabyte.yw.common.config.RuntimeConfGetter; |
35 | 36 | import com.yugabyte.yw.common.config.RuntimeConfigFactory; |
@@ -849,21 +850,16 @@ public void checkSingleUniverse(CheckSingleUniverseParams params) { |
849 | 850 | GFlagsUtil.getCustomTmpDirectory(nodeDetails, params.universe)) |
850 | 851 | : nodeInfo.getYbHomeDir()); |
851 | 852 | } |
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 | + } |
867 | 863 | } |
868 | 864 | nodeInfo.setClockboundEnabled( |
869 | 865 | params.universe.getUniverseDetails().getPrimaryCluster().userIntent.isUseClockbound()); |
@@ -1342,7 +1338,7 @@ public static class NodeInfo { |
1342 | 1338 | private boolean enableYbc = false; |
1343 | 1339 | private int ybcPort = 18018; |
1344 | 1340 | private UUID universeUuid; |
1345 | | - private boolean otelCollectorEnabled; |
| 1341 | + private boolean otelCollectorEnabled = false; |
1346 | 1342 | private boolean clockSyncServiceRequired = true; |
1347 | 1343 | private boolean clockboundEnabled = false; |
1348 | 1344 |
|
|
0 commit comments