Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

Remove set_dimension

James Murdzac96e8c57d7c3
diff --git a/libs/python/agent/agent/__init__.py b/libs/python/agent/agent/__init__.py
index 08d782d336..717b76afdd 100644
--- a/libs/python/agent/agent/__init__.py
+++ b/libs/python/agent/agent/__init__.py
@@ -32,9 +32,6 @@ try:
record_event,
)
- # Import set_dimension from our own telemetry module
- from .telemetry import set_dimension
-
# Check if telemetry is enabled
if is_telemetry_enabled():
logger.info("Telemetry is enabled")
@@ -49,9 +46,6 @@ try:
},
)
- # Set the package version as a dimension
- set_dimension("agent_version", __version__)
-
# Flush events to ensure they're sent
flush()
else:
diff --git a/libs/python/agent/agent/callbacks/telemetry.py b/libs/python/agent/agent/callbacks/telemetry.py
index ac8855a200..00e49a05d6 100644
--- a/libs/python/agent/agent/callbacks/telemetry.py
+++ b/libs/python/agent/agent/callbacks/telemetry.py
@@ -10,7 +10,6 @@ from .base import AsyncCallbackHandler
from ..telemetry import (
record_event,
is_telemetry_enabled,
- set_dimension,
SYSTEM_INFO,
)
@@ -65,11 +64,6 @@ class TelemetryCallback(AsyncCallbackHandler):
**SYSTEM_INFO
}
- # Set session-level dimensions
- set_dimension("session_id", self.session_id)
- set_dimension("agent_type", agent_info["agent_type"])
- set_dimension("model", agent_info["model"])
-
record_event("agent_session_start", agent_info)
async def on_run_start(self, kwargs: Dict[str, Any], old_items: List[Dict[str, Any]]) -> None:
@@ -98,7 +92,6 @@ class TelemetryCallback(AsyncCallbackHandler):
if trajectory:
run_data["uploaded_trajectory"] = trajectory
- set_dimension("run_id", self.run_id)
record_event("agent_run_start", run_data)
async def on_run_end(self, kwargs: Dict[str, Any], old_items: List[Dict[str, Any]], new_items: List[Dict[str, Any]]) -> None:
diff --git a/libs/python/agent/agent/telemetry.py b/libs/python/agent/agent/telemetry.py
index d3e33a253d..ec8428d352 100644
--- a/libs/python/agent/agent/telemetry.py
+++ b/libs/python/agent/agent/telemetry.py
@@ -19,7 +19,6 @@ def _noop(*args: Any, **kwargs: Any) -> None:
# Define default functions with unique names to avoid shadowing
_default_record_event = _noop
_default_increment_counter = _noop
-_default_set_dimension = _noop
_default_get_telemetry_client = lambda: None
_default_flush = _noop
_default_is_telemetry_enabled = lambda: False
@@ -28,7 +27,6 @@ _default_is_telemetry_globally_disabled = lambda: True
# Set the actual functions to the defaults initially
record_event = _default_record_event
increment_counter = _default_increment_counter
-set_dimension = _default_set_dimension
get_telemetry_client = _default_get_telemetry_client
flush = _default_flush
is_telemetry_enabled = _default_is_telemetry_enabled
@@ -59,10 +57,6 @@ try:
if is_telemetry_enabled():
core_increment(counter_name, value)
- def set_dimension(name: str, value: Any) -> None:
- """Set a dimension that will be attached to all events."""
- logger.debug(f"Setting dimension {name}={value}")
-
TELEMETRY_AVAILABLE = True
logger.info("Successfully imported telemetry")
except ImportError as e:
diff --git a/libs/python/computer/computer/telemetry.py b/libs/python/computer/computer/telemetry.py
index 69d064f866..d431cedc62 100644
--- a/libs/python/computer/computer/telemetry.py
+++ b/libs/python/computer/computer/telemetry.py
@@ -20,11 +20,6 @@ try:
if is_telemetry_enabled():
increment(counter_name, value)
- def set_dimension(name: str, value: Any) -> None:
- """Set a dimension that will be attached to all events."""
- logger = logging.getLogger("computer.telemetry")
- logger.debug(f"Setting dimension {name}={value}")
-
TELEMETRY_AVAILABLE = True
logger = logging.getLogger("computer.telemetry")
logger.info("Successfully imported telemetry")
@@ -47,7 +42,6 @@ if not TELEMETRY_AVAILABLE:
logger.debug("Telemetry not available, using no-op functions")
record_event = _noop # type: ignore
increment_counter = _noop # type: ignore
- set_dimension = _noop # type: ignore
get_telemetry_client = lambda: None # type: ignore
flush = _noop # type: ignore
is_telemetry_enabled = lambda: False # type: ignore
@@ -108,9 +102,4 @@ def is_telemetry_enabled() -> bool:
def record_computer_initialization() -> None:
"""Record when a computer instance is initialized."""
if TELEMETRY_AVAILABLE and is_telemetry_enabled():
- record_event("computer_initialized", SYSTEM_INFO)
-
- # Set dimensions that will be attached to all events
- set_dimension("os", SYSTEM_INFO["os"])
- set_dimension("os_version", SYSTEM_INFO["os_version"])
- set_dimension("python_version", SYSTEM_INFO["python_version"])
+ record_event("computer_initialized", SYSTEM_INFO)
\ No newline at end of file