Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.
Rust agentai-agentapplecomputer-usecomputer-use-agentcontainerizationcuadesktop-automationhacktoberfestlumemacosmanusoperatorswiftvirtualizationvirtualization-frameworkwindowswindows-sandbox
fix(telemetry): suppress repeated init failure warnings (#1109)
Sarina Li20aee618fc3f
diff --git a/libs/python/core/core/telemetry/otel.py b/libs/python/core/core/telemetry/otel.pyindex 1dea1755b7..00fdd3f218 100644--- a/libs/python/core/core/telemetry/otel.py+++ b/libs/python/core/core/telemetry/otel.py@@ -28,6 +28,7 @@ DEFAULT_OTEL_ENDPOINT = "https://otel.cua.ai"# Lazy initialization state_initialized = False+_init_failed = False_init_lock = Lock()# OTEL components (lazily initialized)@@ -69,17 +70,21 @@ def _initialize_otel() -> bool:Returns True if initialization succeeded, False otherwise.Thread-safe via lock."""- global _initialized, _meter, _tracer, _meter_provider, _tracer_provider+ global _initialized, _init_failed, _meter, _tracer, _meter_provider, _tracer_providerglobal _operation_duration, _operations_total, _errors_totalglobal _concurrent_operations, _tokens_totalif _initialized:return True+ if _init_failed:+ return Falsewith _init_lock:# Double-check after acquiring lockif _initialized:return True+ if _init_failed:+ return Falseif not is_otel_enabled():logger.debug("OpenTelemetry disabled via CUA_TELEMETRY_DISABLED")@@ -173,13 +178,15 @@ def _initialize_otel() -> bool:return Trueexcept ImportError as e:- logger.warning(+ _init_failed = True+ logger.debug(f"OpenTelemetry packages not installed: {e}. ""Install with: pip install opentelemetry-api opentelemetry-sdk ""opentelemetry-exporter-otlp-proto-http")return Falseexcept Exception as e:+ _init_failed = Truelogger.warning(f"Failed to initialize OpenTelemetry: {e}")return False