Skip to content

Instantly share code, notes, and snippets.

@r33drichards
Last active December 17, 2025 17:45
Show Gist options
  • Select an option

  • Save r33drichards/1ce470c375b8bf7382bafc875b7c8e03 to your computer and use it in GitHub Desktop.

Select an option

Save r33drichards/1ce470c375b8bf7382bafc875b7c8e03 to your computer and use it in GitHub Desktop.
CUA SDK Telemetry - Merge & Release Sequence

CUA SDK Telemetry - Merge & Release Sequence

Pre-Deployment Status

Component Status
Cloud PR #562 (Dashboard + Alerts) ✅ Merged & Deployed
CUA PR #661 (cua-core) ⏳ Ready to merge
CUA PR #662 (cua-agent) ⏳ Ready to merge
CUA PR #663 (cua-computer) ⏳ Ready to merge

Step-by-Step Merge & Release Sequence

Step 1: Merge cua-core (MUST BE FIRST)

# Merge PR #661
gh pr merge 661 --repo trycua/cua --merge

# Wait for CI to pass, then release to PyPI
git fetch origin main && git checkout main && git pull
git tag core-v0.1.10
git push origin core-v0.1.10

Wait for PyPI publish to complete before proceeding.

Verify: https://pypi.org/project/cua-core/


Step 2: Merge cua-agent (after core is published)

# Merge PR #662
gh pr merge 662 --repo trycua/cua --merge

# Release to PyPI
git fetch origin main && git checkout main && git pull
git tag agent-v<NEXT_VERSION>
git push origin agent-v<NEXT_VERSION>

Verify: https://pypi.org/project/cua-agent/


Step 3: Merge cua-computer (after core is published)

# Merge PR #663
gh pr merge 663 --repo trycua/cua --merge

# Release to PyPI
git fetch origin main && git checkout main && git pull
git tag computer-v<NEXT_VERSION>
git push origin computer-v<NEXT_VERSION>

Verify: https://pypi.org/project/cua-computer/


Post-Deployment Verification

# 1. Install fresh and test
pip install --upgrade cua-core[telemetry] cua-agent cua-computer

# 2. Run quick test
python3 << 'PYEOF'
import os
os.environ["CUA_OTEL_ENDPOINT"] = "https://otel.cua.ai"

from core.telemetry import is_otel_enabled, record_operation
from core.telemetry import otel

print(f"OTEL enabled: {is_otel_enabled()}")
record_operation("test.deployment", duration_seconds=0.1, status="success")
otel._meter_provider.force_flush(timeout_millis=10000)
print("Metrics sent!")
PYEOF

# 3. Check Prometheus (wait 30s for scrape)
ssh -i ~/.ssh/rw.pem root@35.92.213.109 \
  "curl -s 'http://localhost:9090/api/v1/query?query=cua_sdk_operations_total{operation=\"test.deployment\"}' | jq '.data.result'"

# 4. Check Grafana dashboard
open https://grafana.cua.ai/d/cua-sdk-metrics

Rollback Procedures

Rollback Cloud (Dashboard/Alerts)

If dashboard or alerts cause issues:

# SSH into alertmanager instance
ssh -i ~/.ssh/rw.pem root@35.92.213.109

# List available profiles
ls -la /nix/var/nix/profiles/system-*

# Rollback to previous profile
nix-env --profile /nix/var/nix/profiles/system --rollback
/nix/var/nix/profiles/system/bin/switch-to-configuration switch

# Verify rollback
curl -s http://localhost:9090/api/v1/rules | jq '.data.groups[].name'

Rollback cua-core

# Users pin to previous version
pip install cua-core==0.1.9

# Or disable telemetry entirely
export CUA_TELEMETRY_DISABLED=true

Rollback cua-agent

# Pin to previous version
pip install cua-agent==<PREVIOUS_VERSION>

Rollback cua-computer

# Pin to previous version  
pip install cua-computer==<PREVIOUS_VERSION>

Emergency: Disable All Telemetry

Users can immediately disable without downgrading:

export CUA_TELEMETRY_DISABLED=true

This disables all OTEL metrics/traces with zero code changes.


Monitoring After Deployment

What to Watch Where
Metrics flowing https://grafana.cua.ai/d/cua-sdk-metrics
Alert status https://am.cua.ai
Error spikes Sentry project
PyPI downloads https://pypistats.org/packages/cua-core

Quick Reference

MERGE ORDER:
  #661 (core) → publish → #662 (agent) → publish → #663 (computer) → publish

ROLLBACK:
  Cloud: nix-env --rollback + switch-to-configuration
  SDK: pip install package==previous_version
  Emergency: export CUA_TELEMETRY_DISABLED=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment