@@ -227,11 +227,13 @@ func extractResourceAttributes(resource *resourcev1.Resource) *model.AICodeOtelR
227227 // Standard resource attributes
228228 case "session.id" :
229229 attrs .SessionID = value .GetStringValue ()
230+ case "conversation.id" :
231+ attrs .ConversationID = value .GetStringValue ()
230232 case "app.version" :
231233 attrs .AppVersion = value .GetStringValue ()
232234 case "organization.id" :
233235 attrs .OrganizationID = value .GetStringValue ()
234- case "user.account_uuid" :
236+ case "user.account_uuid" , "user.account_id" :
235237 attrs .UserAccountUUID = value .GetStringValue ()
236238 case "terminal.type" :
237239 attrs .TerminalType = value .GetStringValue ()
@@ -269,6 +271,7 @@ func extractResourceAttributes(resource *resourcev1.Resource) *model.AICodeOtelR
269271func applyResourceAttributesToMetric (metric * model.AICodeOtelMetric , attrs * model.AICodeOtelResourceAttributes ) {
270272 // Standard resource attributes
271273 metric .SessionID = attrs .SessionID
274+ metric .ConversationID = attrs .ConversationID
272275 metric .UserAccountUUID = attrs .UserAccountUUID
273276 metric .OrganizationID = attrs .OrganizationID
274277 metric .TerminalType = attrs .TerminalType
@@ -292,6 +295,7 @@ func applyResourceAttributesToMetric(metric *model.AICodeOtelMetric, attrs *mode
292295func applyResourceAttributesToEvent (event * model.AICodeOtelEvent , attrs * model.AICodeOtelResourceAttributes ) {
293296 // Standard resource attributes
294297 event .SessionID = attrs .SessionID
298+ event .ConversationID = attrs .ConversationID
295299 event .UserAccountUUID = attrs .UserAccountUUID
296300 event .OrganizationID = attrs .OrganizationID
297301 event .TerminalType = attrs .TerminalType
@@ -455,17 +459,61 @@ func (p *AICodeOtelProcessor) parseLogRecord(lr *logsv1.LogRecord, resourceAttrs
455459 slog .Debug ("AICodeOtel: Failed to parse tool_parameters" , "error" , err )
456460 }
457461 }
458- case "status_code" :
462+ case "status_code" , "http.response.status_code" :
459463 event .StatusCode = getIntFromValue (value )
460464 case "attempt" :
461465 event .Attempt = getIntFromValue (value )
466+ case "error.message" :
467+ event .Error = value .GetStringValue ()
462468 case "language" :
463469 event .Language = value .GetStringValue ()
464470 // Codex-specific fields
465471 case "reasoning_tokens" :
466472 event .ReasoningTokens = getIntFromValue (value )
467473 case "provider" :
468474 event .Provider = value .GetStringValue ()
475+ // Codex-specific fields for tool_decision
476+ case "call_id" , "callId" :
477+ event .CallID = value .GetStringValue ()
478+ // Codex-specific fields for sse_event
479+ case "event_kind" , "eventKind" :
480+ event .EventKind = value .GetStringValue ()
481+ case "tool_tokens" , "toolTokens" :
482+ event .ToolTokens = getIntFromValue (value )
483+ // Codex-specific fields for conversation_starts
484+ case "auth_mode" , "authMode" :
485+ event .AuthMode = value .GetStringValue ()
486+ case "slug" :
487+ event .Slug = value .GetStringValue ()
488+ case "context_window" , "contextWindow" :
489+ event .ContextWindow = getIntFromValue (value )
490+ case "approval_policy" , "approvalPolicy" :
491+ event .ApprovalPolicy = value .GetStringValue ()
492+ case "sandbox_policy" , "sandboxPolicy" :
493+ event .SandboxPolicy = value .GetStringValue ()
494+ case "mcp_servers" , "mcpServers" :
495+ event .MCPServers = getStringArrayFromValue (value )
496+ case "profile" :
497+ event .Profile = value .GetStringValue ()
498+ case "reasoning_enabled" , "reasoningEnabled" :
499+ event .ReasoningEnabled = getBoolFromValue (value )
500+ // Codex-specific fields for tool_result
501+ case "tool_arguments" , "toolArguments" :
502+ if jsonStr := value .GetStringValue (); jsonStr != "" {
503+ var args map [string ]interface {}
504+ if err := json .Unmarshal ([]byte (jsonStr ), & args ); err == nil {
505+ event .ToolArguments = args
506+ } else {
507+ slog .Debug ("AICodeOtel: Failed to parse tool_arguments" , "error" , err )
508+ }
509+ }
510+ case "tool_output" , "toolOutput" :
511+ event .ToolOutput = value .GetStringValue ()
512+ case "prompt_encrypted" , "promptEncrypted" :
513+ event .PromptEncrypted = getBoolFromValue (value )
514+ // Codex uses conversation.id instead of session.id
515+ case "conversation.id" , "conversationId" :
516+ event .ConversationID = value .GetStringValue ()
469517 // Log record level attributes that override resource attrs
470518 case "user.id" :
471519 event .UserID = value .GetStringValue ()
@@ -477,7 +525,7 @@ func (p *AICodeOtelProcessor) parseLogRecord(lr *logsv1.LogRecord, resourceAttrs
477525 event .AppVersion = value .GetStringValue ()
478526 case "organization.id" :
479527 event .OrganizationID = value .GetStringValue ()
480- case "user.account_uuid" :
528+ case "user.account_uuid" , "user.account_id" :
481529 event .UserAccountUUID = value .GetStringValue ()
482530 case "terminal.type" :
483531 event .TerminalType = value .GetStringValue ()
@@ -559,6 +607,10 @@ func mapEventName(name string, source string) string {
559607 return model .AICodeEventApiError
560608 case "codex.exec_command" :
561609 return model .AICodeEventExecCommand
610+ case "codex.conversation_starts" :
611+ return model .AICodeEventConversationStarts
612+ case "codex.sse_event" :
613+ return model .AICodeEventSSEEvent
562614 default :
563615 return name // Return as-is if not in our map
564616 }
@@ -620,6 +672,20 @@ func getFloatFromValue(value *commonv1.AnyValue) float64 {
620672 return 0
621673}
622674
675+ // getStringArrayFromValue extracts a string array from an OTEL value
676+ func getStringArrayFromValue (value * commonv1.AnyValue ) []string {
677+ if arr := value .GetArrayValue (); arr != nil {
678+ var result []string
679+ for _ , v := range arr .GetValues () {
680+ if s := v .GetStringValue (); s != "" {
681+ result = append (result , s )
682+ }
683+ }
684+ return result
685+ }
686+ return nil
687+ }
688+
623689// applyMetricAttribute applies an attribute to a metric
624690func applyMetricAttribute (metric * model.AICodeOtelMetric , attr * commonv1.KeyValue , metricType string ) {
625691 key := attr .GetKey ()
0 commit comments