Skip to content

Conversation

@r33drichards
Copy link
Contributor

Summary

  • Adds OtelInterfaceWrapper class that instruments all computer interface methods
  • Records latency, traffic, and errors for each action type
  • Integrates with Computer class to track session metrics

Dependencies

  • Requires feat/otel-sentry-core branch to be merged first

Instrumented Actions

  • Mouse: left_click, right_click, double_click, move_cursor, scroll, drag
  • Keyboard: type_text, press_key, hotkey
  • Screen: screenshot, get_screen_size, get_cursor_position
  • Clipboard: get_clipboard, set_clipboard
  • Shell: run_shell_command, run_command, open_url, open_file
  • File: file_exists, directory_exists, list_directory, read_file, write_file

Test plan

  • Merge feat/otel-sentry-core first
  • Install with pip install cua-computer[telemetry]
  • Run computer operations and verify metrics are emitted
  • Verify errors are captured with action context

🤖 Generated with Claude Code

Add OTEL instrumentation for computer operations:

- OtelInterfaceWrapper: Wraps interface methods to record metrics
  - Latency for all computer actions (click, type, screenshot, etc.)
  - Traffic counts by action type
  - Error tracking with Sentry integration

- Session metrics in Computer class:
  - computer.session.start with duration and status
  - computer.session.stop with duration

The OTEL wrapper is automatically applied when:
- telemetry_enabled=True on Computer instance
- CUA_TELEMETRY_DISABLED is not set
- cua-core[telemetry] is installed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Dec 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
docs Ready Ready Preview, Comment Dec 17, 2025 5:20pm

@sentry
Copy link

sentry bot commented Dec 17, 2025

Codecov Report

❌ Patch coverage is 26.31579% with 56 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
libs/python/computer/computer/otel_wrapper.py 28.00% 36 Missing ⚠️
libs/python/computer/computer/computer.py 23.07% 20 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants