Skip to content

Conversation

@r33drichards
Copy link
Contributor

Summary

  • Adds otel.py module for OpenTelemetry metrics instrumentation (Four Golden Signals)
  • Adds sentry.py module for Sentry error tracking with PII filtering
  • Updates pyproject.toml with optional dependencies: [otel], [sentry], [telemetry]
  • Exports new functions from core.telemetry module

Metrics Exported

  • cua_sdk_operation_duration_seconds - Histogram for latency
  • cua_sdk_operations_total - Counter for traffic
  • cua_sdk_errors_total - Counter for errors
  • cua_sdk_concurrent_operations - Gauge for saturation
  • cua_sdk_tokens_total - Counter for token usage

Configuration

  • Enabled by default, disable with CUA_TELEMETRY_DISABLED=true
  • OTLP endpoint: CUA_OTLP_ENDPOINT (default: https://otel.trycua.com)
  • Sentry DSN: Hardcoded public DSN for CUA SDK

Test plan

  • Install with pip install cua-core[telemetry]
  • Verify OTEL metrics are emitted when running agent/computer
  • Verify Sentry captures exceptions
  • Verify telemetry can be disabled with env var

🤖 Generated with Claude Code

Add operational telemetry for Four Golden Signals:
- otel.py: OpenTelemetry metrics (latency, traffic, errors, saturation)
- sentry.py: Error tracking and crash reporting

Key features:
- Opt-out model via CUA_TELEMETRY_DISABLED env var
- Lazy initialization to minimize startup overhead
- Decorators for easy instrumentation (@instrument_async, @instrument_sync)
- Context managers (track_concurrent, create_span)
- PII filtering in Sentry before_send hook

New optional dependencies:
- cua-core[otel] for OpenTelemetry
- cua-core[sentry] for Sentry
- cua-core[telemetry] for both

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@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 18.15642% with 293 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
libs/python/core/core/telemetry/otel.py 17.92% 174 Missing ⚠️
libs/python/core/core/telemetry/sentry.py 17.36% 119 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