Skip to content

Commit 74a45bc

Browse files
committed
feat: Add @openai/codex-sdk instrumentation
1 parent 8146b56 commit 74a45bc

26 files changed

Lines changed: 2261 additions & 0 deletions

e2e/config/pr-comment-scenarios.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
{ "variantKey": "openai-v6", "label": "v6" }
1010
]
1111
},
12+
{
13+
"scenarioDirName": "openai-codex-instrumentation",
14+
"label": "OpenAI Codex Instrumentation",
15+
"metadataScenario": "openai-codex-instrumentation",
16+
"variants": [{ "variantKey": "openai-codex-v0128", "label": "v0.128" }]
17+
},
1218
{
1319
"scenarioDirName": "anthropic-instrumentation",
1420
"label": "Anthropic Instrumentation",
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
{
2+
"root": {
3+
"has_input": false,
4+
"has_output": false,
5+
"metadata": {
6+
"scenario": "openai-codex-instrumentation"
7+
},
8+
"metric_keys": [],
9+
"name": "openai-codex-instrumentation-root",
10+
"root_span_id": "<span:1>",
11+
"span_id": "<span:1>",
12+
"span_parents": [],
13+
"type": "task"
14+
},
15+
"run": {
16+
"operation": {
17+
"has_input": false,
18+
"has_output": false,
19+
"metadata": {
20+
"operation": "run"
21+
},
22+
"metric_keys": [],
23+
"name": "openai-codex-run-operation",
24+
"root_span_id": "<span:1>",
25+
"span_id": "<span:2>",
26+
"span_parents": [
27+
"<span:1>"
28+
],
29+
"type": null
30+
},
31+
"task": {
32+
"has_input": true,
33+
"has_output": true,
34+
"metadata": {
35+
"model": "gpt-5-codex",
36+
"openai_codex.model": "gpt-5-codex",
37+
"openai_codex.operation": "Thread.run",
38+
"provider": "openai"
39+
},
40+
"metric_keys": [
41+
"completion_reasoning_tokens",
42+
"completion_tokens",
43+
"duration",
44+
"prompt_cached_tokens",
45+
"prompt_tokens",
46+
"tokens"
47+
],
48+
"name": "OpenAI Codex",
49+
"root_span_id": "<span:1>",
50+
"span_id": "<span:3>",
51+
"span_parents": [
52+
"<span:2>"
53+
],
54+
"type": "task"
55+
}
56+
},
57+
"streamed": {
58+
"operation": {
59+
"has_input": false,
60+
"has_output": false,
61+
"metadata": {
62+
"operation": "runStreamed"
63+
},
64+
"metric_keys": [],
65+
"name": "openai-codex-run-streamed-operation",
66+
"root_span_id": "<span:1>",
67+
"span_id": "<span:4>",
68+
"span_parents": [
69+
"<span:1>"
70+
],
71+
"type": null
72+
},
73+
"task": {
74+
"has_input": true,
75+
"has_output": true,
76+
"metadata": {
77+
"model": "gpt-5-codex",
78+
"openai_codex.model": "gpt-5-codex",
79+
"openai_codex.operation": "Thread.runStreamed",
80+
"openai_codex.thread_id": "<thread-id>",
81+
"provider": "openai"
82+
},
83+
"metric_keys": [
84+
"completion_reasoning_tokens",
85+
"completion_tokens",
86+
"duration",
87+
"prompt_cached_tokens",
88+
"prompt_tokens",
89+
"tokens"
90+
],
91+
"name": "OpenAI Codex",
92+
"root_span_id": "<span:1>",
93+
"span_id": "<span:5>",
94+
"span_parents": [
95+
"<span:4>"
96+
],
97+
"type": "task"
98+
}
99+
},
100+
"tools": [
101+
{
102+
"has_input": true,
103+
"has_output": true,
104+
"metadata": {
105+
"gen_ai.tool.name": "command_execution",
106+
"openai_codex.command.status": "completed",
107+
"openai_codex.item_type": "command_execution"
108+
},
109+
"metric_keys": [],
110+
"name": "tool: command_execution",
111+
"root_span_id": "<span:1>",
112+
"span_id": "<span:6>",
113+
"span_parents": [
114+
"<span:3>"
115+
],
116+
"type": "tool"
117+
},
118+
{
119+
"has_input": true,
120+
"has_output": true,
121+
"metadata": {
122+
"gen_ai.tool.name": "read_file",
123+
"openai_codex.item_type": "mcp_tool_call",
124+
"openai_codex.mcp.server": "filesystem",
125+
"openai_codex.mcp.status": "completed"
126+
},
127+
"metric_keys": [],
128+
"name": "tool: read_file",
129+
"root_span_id": "<span:1>",
130+
"span_id": "<span:7>",
131+
"span_parents": [
132+
"<span:3>"
133+
],
134+
"type": "tool"
135+
},
136+
{
137+
"has_input": true,
138+
"has_output": false,
139+
"metadata": {
140+
"gen_ai.tool.name": "web_search",
141+
"openai_codex.item_type": "web_search"
142+
},
143+
"metric_keys": [],
144+
"name": "tool: web_search",
145+
"root_span_id": "<span:1>",
146+
"span_id": "<span:8>",
147+
"span_parents": [
148+
"<span:3>"
149+
],
150+
"type": "tool"
151+
},
152+
{
153+
"has_input": true,
154+
"has_output": true,
155+
"metadata": {
156+
"gen_ai.tool.name": "command_execution",
157+
"openai_codex.command.status": "completed",
158+
"openai_codex.item_type": "command_execution"
159+
},
160+
"metric_keys": [],
161+
"name": "tool: command_execution",
162+
"root_span_id": "<span:1>",
163+
"span_id": "<span:9>",
164+
"span_parents": [
165+
"<span:5>"
166+
],
167+
"type": "tool"
168+
},
169+
{
170+
"has_input": true,
171+
"has_output": true,
172+
"metadata": {
173+
"gen_ai.tool.name": "read_file",
174+
"openai_codex.item_type": "mcp_tool_call",
175+
"openai_codex.mcp.server": "filesystem",
176+
"openai_codex.mcp.status": "completed"
177+
},
178+
"metric_keys": [],
179+
"name": "tool: read_file",
180+
"root_span_id": "<span:1>",
181+
"span_id": "<span:10>",
182+
"span_parents": [
183+
"<span:5>"
184+
],
185+
"type": "tool"
186+
},
187+
{
188+
"has_input": true,
189+
"has_output": false,
190+
"metadata": {
191+
"gen_ai.tool.name": "web_search",
192+
"openai_codex.item_type": "web_search"
193+
},
194+
"metric_keys": [],
195+
"name": "tool: web_search",
196+
"root_span_id": "<span:1>",
197+
"span_id": "<span:11>",
198+
"span_parents": [
199+
"<span:5>"
200+
],
201+
"type": "tool"
202+
}
203+
]
204+
}

0 commit comments

Comments
 (0)