feat: pass config overrides to managed monitor
This commit is contained in:
@@ -3,7 +3,11 @@ import { existsSync } from 'fs';
|
|||||||
|
|
||||||
export interface ManagedMonitorConfig {
|
export interface ManagedMonitorConfig {
|
||||||
managedMonitor?: string;
|
managedMonitor?: string;
|
||||||
|
backendUrl?: string;
|
||||||
|
identifier?: string;
|
||||||
|
apiKey?: string;
|
||||||
monitor_port?: number;
|
monitor_port?: number;
|
||||||
|
reportIntervalSec?: number;
|
||||||
logLevel?: string;
|
logLevel?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,7 +28,11 @@ export function startManagedMonitor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const args: string[] = [];
|
const args: string[] = [];
|
||||||
if (config.monitor_port) args.push('--port', String(config.monitor_port));
|
if (config.backendUrl) args.push('--backend-url', String(config.backendUrl));
|
||||||
|
if (config.identifier) args.push('--identifier', String(config.identifier));
|
||||||
|
if (config.apiKey) args.push('--api-key', String(config.apiKey));
|
||||||
|
if (config.monitor_port) args.push('--monitor-port', String(config.monitor_port));
|
||||||
|
if (config.reportIntervalSec) args.push('--report-interval', String(config.reportIntervalSec));
|
||||||
if (config.logLevel) args.push('--log-level', String(config.logLevel));
|
if (config.logLevel) args.push('--log-level', String(config.logLevel));
|
||||||
|
|
||||||
monitorProcess = spawn(config.managedMonitor, args, {
|
monitorProcess = spawn(config.managedMonitor, args, {
|
||||||
|
|||||||
@@ -16,7 +16,11 @@ export function registerGatewayStartHook(api: any, deps: {
|
|||||||
|
|
||||||
startManagedMonitor(logger, {
|
startManagedMonitor(logger, {
|
||||||
managedMonitor: live.managedMonitor,
|
managedMonitor: live.managedMonitor,
|
||||||
|
backendUrl: live.backendUrl,
|
||||||
|
identifier: live.identifier,
|
||||||
|
apiKey: live.apiKey,
|
||||||
monitor_port: live.monitor_port,
|
monitor_port: live.monitor_port,
|
||||||
|
reportIntervalSec: live.reportIntervalSec,
|
||||||
logLevel: live.logLevel,
|
logLevel: live.logLevel,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user