Merge pull request #2968 from Wadenschwinger/fix/watcher-otel-disabled-env-passthrough

Fix: skip opentelemetry-instrument when OTEL is disabled
This commit is contained in:
Georges-Antoine Assi
2026-01-30 19:04:48 -05:00
committed by GitHub

View File

@@ -219,10 +219,19 @@ start_bin_rq_worker() {
start_bin_watcher() {
info_log "Starting watcher"
watchfiles \
--target-type command \
"opentelemetry-instrument --service_name '${OTEL_SERVICE_NAME_PREFIX-}watcher' python3 watcher.py" \
/romm/library &
if [[ ${OTEL_SDK_DISABLED:-false} == "true" ]]; then
# Skip opentelemetry-instrument when OTEL is disabled to ensure
# WATCHFILES_CHANGES env var is properly passed to watcher.py
watchfiles \
--target-type command \
"python3 watcher.py" \
/romm/library &
else
watchfiles \
--target-type command \
"opentelemetry-instrument --service_name '${OTEL_SERVICE_NAME_PREFIX-}watcher' python3 watcher.py" \
/romm/library &
fi
WATCHER_PID=$!
echo "${WATCHER_PID}" >/tmp/watcher.pid
}