11import { instrumentAgentCallableRpc } from './instrumentAgentCallableRpc' ;
2+ import { instrumentAgentRequestConversation } from './instrumentAgentRequestConversation' ;
23import { instrumentChatAgentConversation } from './instrumentChatAgentConversation' ;
34import type { AgentInternals } from './types' ;
45
@@ -8,9 +9,9 @@ import type { AgentInternals } from './types';
89 *
910 * - **Callable RPC spans** — a span (op `rpc`) for each `@callable()` method invoked over WebSocket.
1011 * - **Conversation correlation** — sets the conversation id on the scope for each unit of agent
11- * work — chat turn or callable RPC call — so `gen_ai` spans created within it are correlated, for
12- * chat and plain agents alike. Defaults to the instance `name` and is rotated when the chat is
13- * cleared (the `message:clear` observability event).
12+ * work — chat turn, callable RPC call, or HTTP request — so `gen_ai` spans created within it are
13+ * correlated, for chat and plain agents alike. Defaults to the instance `name` and is rotated
14+ * when the chat is cleared (the `message:clear` observability event).
1415 *
1516 * It only hooks the `agents` package internals and uses Sentry's tracing primitives. On Cloudflare
1617 * Workers, prefer `instrumentAgentWithSentry`, which additionally instruments the Durable Object
@@ -29,6 +30,7 @@ export function instrumentCloudflareAgent<T extends object>(agent: T): T {
2930
3031 instrumentAgentCallableRpc ( internals ) ;
3132 instrumentChatAgentConversation ( internals ) ;
33+ instrumentAgentRequestConversation ( internals ) ;
3234
3335 return agent ;
3436}
0 commit comments