docs(js): clarify OpenAI instrumentation for Cloudflare and tools - #18932
Conversation
Add a Cloudflare Workers example for instrumentOpenAiClient, document that tool execution spans are not created by the OpenAI client wrap, and note streaming usage behavior for OpenAI-compatible providers. Refs TET-2706
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0b245a1a58
ℹ️ 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".
Explain that responses.create uses gen_ai.chat spans, add Durable Object trace propagation and Conversations links for Cloudflare.
Remove permissive dataCollection from the Cloudflare example and gate agent-tracing / Vercel AI links so browser guides point at agent-tracing-browser instead of missing server pages.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 179b2bb71e
ℹ️ 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".
Require enableRpcTracePropagation on both Worker and DO, and gate tool-execution guidance to platforms that actually host the linked pages. Refs TET-2706 Co-Authored-By: opencode <noreply@opencode.ai>
OpenAI page should not steer readers to a different integration; point at manual agent instrumentation only. Refs TET-2706 Co-Authored-By: opencode <noreply@opencode.ai>
Call the wrapper path "Instrument the Client" instead of "Manual Instrumentation" — it is the primary setup on non-Node runtimes, not hand-written spans. Refs TET-2706 Co-Authored-By: opencode <noreply@opencode.ai>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d73395f394
ℹ️ 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".
|
|
||
| Both APIs produce the same span type in Sentry: op `gen_ai.chat`, name like `chat <model>`. There is no separate `gen_ai.responses` span — `responses.create()` is still a model chat request under the hood, so it uses the standard chat operation. | ||
|
|
||
| ### What is captured |
There was a problem hiding this comment.
I don't think we need this headline here, we could leave it out since this is just continued from the previous part
shellmayr
left a comment
There was a problem hiding this comment.
Looks good and understandable to me 👍
Keep the captured data paragraph as a continuation of the supported operations section. Co-Authored-By: OpenCode <noreply@openai.com>
From the TET-2706 OpenAI-on-Cloudflare audit:
instrumentOpenAiClient); tracing alone is not enough.gen_ai.execute_toolfrom this integration — onlygen_ai.chat(including forresponses.create) plus tool attributes on that span.stream_options.include_usageon OpenAI; OpenAI-compatible providers may differ.