Skip to content

Adding more mo telemetry events#247

Merged
Sayan- merged 6 commits into
mainfrom
sayan/kernel-1301-add-more-events
May 22, 2026
Merged

Adding more mo telemetry events#247
Sayan- merged 6 commits into
mainfrom
sayan/kernel-1301-add-more-events

Conversation

@Sayan-
Copy link
Copy Markdown
Contributor

@Sayan- Sayan- commented May 21, 2026

Note

Medium Risk
Adds new telemetry event types and wires them into HTTP and WebSocket proxy request paths, which may affect event volume and middleware behavior across all API calls and CDP connections. Main risk is incorrect enable/disable toggling or unexpected performance/metrics impact rather than data integrity or security logic.

Overview
Introduces a new telemetry category api and extends the telemetry config/handlers so it is treated as a first-class, user-togglable category (including updated all-disabled semantics and API responses).

Adds request instrumentation middleware that emits api_call events (request id, OpenAPI operationId, status, duration) and is dynamically enabled/disabled based on telemetry session state. The DevTools WebSocket proxy now publishes cdp_connect and cdp_disconnect system events (including disconnect reason, duration, and relayed message count), and main.go wires the new middleware and publisher hooks.

Updates the generated OpenAPI types/spec (oapi.go, openapi.yaml) to include the new category and event schemas, and adds/updates unit tests covering middleware emission and telemetry toggle behavior.

Reviewed by Cursor Bugbot for commit 3156ff9. Bugbot is set up for automated code reviews on this repo. Configure here.

@firetiger-agent
Copy link
Copy Markdown

Firetiger deploy monitoring skipped

This PR didn't match the auto-monitor filter configured on your GitHub connection:

Any PR that changes the kernel API. Monitor changes to API endpoints (packages/api/cmd/api/) and Temporal workflows (packages/api/lib/temporal) in the kernel repo

Reason: PR title and empty body suggest telemetry event additions rather than kernel API or Temporal workflow changes; please confirm if this affects packages/api/cmd/api/ or packages/api/lib/temporal to opt into deploy monitoring.

To monitor this PR anyway, reply with @firetiger monitor this.

Comment thread server/openapi.yaml
Schemas:
- New event types: api_call (HTTP middleware), cdp_connect / cdp_disconnect
  (CDP proxy), live_view_connect / live_view_disconnect (Neko, producer
  in a follow-up).
- captcha_solve_result enum trimmed to the producer-normalized vendor set
  (hcaptcha, recaptcha_v2, recaptcha_v3, turnstile, geetest, other).
- New `api` user-toggleable category for api_call events.

Producers:
- chi middleware emits api_call with operationId / status / request_id /
  duration_ms. Disabled by default; the telemetry handler flips the
  package-level toggle on/off when the api category is enabled.
- WebSocketProxyHandler emits cdp_connect on accept and cdp_disconnect on
  teardown with message_count and reason (client_close / upstream_changed
  / upstream_error / context_cancelled).

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread server/cmd/api/api/middleware.go
Comment thread server/lib/devtoolsproxy/proxy.go Outdated
Comment thread server/openapi.yaml
- client_close
- upstream_changed
- upstream_error
- context_cancelled
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

Comment thread server/cmd/api/api/middleware.go
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3df164c. Configure here.

Comment thread server/cmd/api/api/telemetry.go Outdated
@Sayan- Sayan- changed the title [wip] adding more mo telemetry events Adding more mo telemetry events May 22, 2026
@Sayan- Sayan- merged commit 5ca3cf3 into main May 22, 2026
14 of 16 checks passed
@Sayan- Sayan- deleted the sayan/kernel-1301-add-more-events branch May 22, 2026 19:30
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