Skip to content

Commit 8c6c040

Browse files
committed
add check for loki config value in module to avoid loki initialization failure when config is not provided
1 parent 4e72138 commit 8c6c040

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

workspaces/orchestrator/app-config.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,9 @@ orchestrator:
161161
# Uncomment to set the content length limit for the requests. Defaults to 102400 bytes (100kb)
162162
# contentLengthLimit: 10mb
163163
# Uncomment and configure to use the log viewer
164-
workflowLogProvider:
165-
loki:
166-
baseUrl: http://localhost:3100
167-
token: secret-token
164+
# workflowLogProvider:
165+
# loki:
166+
# baseUrl: http://localhost:3100
168167
# Uncomment if using a custom log stream selector
169168
# logStreamSelectors:
170169
# - label: 'selector'

workspaces/orchestrator/plugins/orchestrator-backend-module-loki/src/module.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ export const orchestratorModuleLoki = createBackendModule({
3636
workflowLogs: workflowLogsExtensionEndpoint,
3737
},
3838
async init({ config, logger, workflowLogs }) {
39+
if (!config.has('orchestrator.workflowLogProvider.loki')) {
40+
logger.info(
41+
'Loki workflow log provider is not configured, skipping module initialization',
42+
);
43+
return;
44+
}
3945
logger.info('Initialize the Loki orchestrator backend module');
4046
workflowLogs.addWorkflowLogProvider(LokiProvider.fromConfig(config));
4147
},

0 commit comments

Comments
 (0)