Commit 28537fa
authored
fix(adk): separate FailoverChatModel trace span from inner model span (#1040)
* fix(adk): separate FailoverChatModel trace span from inner model span
When ModelFailoverConfig is enabled, the failover proxy model was creating
a trace span with the same identity as the inner model, causing duplicate
"ChatModel" entries in the trace view even without actual failover retries.
Fix: Use callbacks.ReuseHandlers to give the failover proxy its own distinct
RunInfo (Type="FailoverChatModel") as the outer span, and create a proper
child RunInfo for the target model. This produces a clear trace hierarchy:
FailoverChatModel (wrapper span)
└── ChatModel [ep-xxx] (actual model span)
* fix(adk): separate FailoverChatModel trace span from inner model span
When ModelFailoverConfig is enabled, the failover proxy model was creating
a trace span with the same identity as the inner model, causing duplicate
"ChatModel" entries in the trace view even without actual failover retries.
Fix: Use callbacks.ReuseHandlers to give the failover proxy its own distinct
RunInfo (Type="FailoverChatModel") as the outer span, and create a proper
child RunInfo for the target model. This produces a clear trace hierarchy:
FailoverChatModel (wrapper span)
└── ChatModel [ep-xxx] (actual model span)1 parent a19b7e4 commit 28537fa
1 file changed
Lines changed: 28 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
| 68 | + | |
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
73 | 72 | | |
74 | 73 | | |
75 | | - | |
| 74 | + | |
76 | 75 | | |
77 | 76 | | |
78 | 77 | | |
79 | | - | |
| 78 | + | |
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
83 | 82 | | |
84 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
85 | 89 | | |
86 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
87 | 97 | | |
88 | 98 | | |
89 | 99 | | |
| |||
96 | 106 | | |
97 | 107 | | |
98 | 108 | | |
99 | | - | |
| 109 | + | |
100 | 110 | | |
101 | 111 | | |
102 | 112 | | |
103 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
104 | 119 | | |
105 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
106 | 127 | | |
107 | 128 | | |
108 | 129 | | |
| |||
0 commit comments