File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -148,12 +148,12 @@ class LLMObsTagger {
148
148
}
149
149
150
150
tagSpanTags ( span , tags ) {
151
- // new tags will be merged with existing tags
152
151
const currentTags = registry . get ( span ) ?. [ TAGS ]
153
152
if ( currentTags ) {
154
- Object . assign ( tags , currentTags )
153
+ Object . assign ( currentTags , tags )
154
+ } else {
155
+ this . _setTag ( span , TAGS , tags )
155
156
}
156
- this . _setTag ( span , TAGS , tags )
157
157
}
158
158
159
159
changeKind ( span , newKind ) {
Original file line number Diff line number Diff line change @@ -230,12 +230,12 @@ describe('tagger', () => {
230
230
} )
231
231
} )
232
232
233
- it ( 'merges tags so they do not overwrite ' , ( ) => {
233
+ it ( 'merges tags so they update ' , ( ) => {
234
234
Tagger . tagMap . set ( span , { '_ml_obs.tags' : { a : 1 } } )
235
235
const tags = { a : 2 , b : 1 }
236
236
tagger . tagSpanTags ( span , tags )
237
237
expect ( Tagger . tagMap . get ( span ) ) . to . deep . equal ( {
238
- '_ml_obs.tags' : { a : 1 , b : 1 }
238
+ '_ml_obs.tags' : { a : 2 , b : 1 }
239
239
} )
240
240
} )
241
241
} )
You can’t perform that action at this time.
0 commit comments