Skip to content

feat(app-server): add tracing to all app-server APIs#13285

Merged
owenlin0 merged 1 commit intomainfrom
owen/app_server_tracing_pt1
Mar 3, 2026
Merged

feat(app-server): add tracing to all app-server APIs#13285
owenlin0 merged 1 commit intomainfrom
owen/app_server_tracing_pt1

Conversation

@owenlin0
Copy link
Copy Markdown
Collaborator

@owenlin0 owenlin0 commented Mar 2, 2026

Overview

This PR adds the first piece of tracing for app-server JSON-RPC requests.

There are two main changes:

  • JSON-RPC requests can now take an optional W3C trace context at the top level via a trace field (traceparent / tracestate).
  • app-server now creates a dedicated request span for every inbound JSON-RPC request in MessageProcessor, and uses the request-level trace context as the parent when present.

For compatibility with existing flows, app-server still falls back to the TRACEPARENT env var when there is no request-level traceparent.

This PR is intentionally scoped to the app-server boundary. In a followup, we'll actually propagate trace context through the async handoff into core execution spans like run_turn, which will make app-server traces much more useful.

Spans

A few details on the app-server span shape:

  • each inbound request gets its own server span
  • span/resource names are based on the JSON-RPC method (initialize, thread/start, turn/start, etc.)
  • spans record transport (stdio vs websocket), request id, connection id, and client name/version when available
  • initialize stores client metadata in session state so later requests on the same connection can reuse it
@owenlin0 owenlin0 changed the title feat(app-server): tracing pt. 1 Mar 2, 2026
@owenlin0 owenlin0 force-pushed the owen/app_server_tracing_pt1 branch from 9a1db7f to 5951e01 Compare March 2, 2026 23:14
@owenlin0 owenlin0 marked this pull request as ready for review March 2, 2026 23:19
@owenlin0
Copy link
Copy Markdown
Collaborator Author

owenlin0 commented Mar 2, 2026

@codex review

@owenlin0 owenlin0 force-pushed the owen/app_server_tracing_pt1 branch from 5951e01 to a23de0e Compare March 2, 2026 23:22
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5951e019d4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@owenlin0 owenlin0 force-pushed the owen/app_server_tracing_pt1 branch from a23de0e to f65da5a Compare March 2, 2026 23:41
@owenlin0
Copy link
Copy Markdown
Collaborator Author

owenlin0 commented Mar 2, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Keep them coming!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@owenlin0 owenlin0 merged commit d473e8d into main Mar 3, 2026
31 checks passed
@owenlin0 owenlin0 deleted the owen/app_server_tracing_pt1 branch March 3, 2026 00:01
@github-actions github-actions bot locked and limited conversation to collaborators Mar 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants