File tree 2 files changed +6
-10
lines changed
packages/opentelemetry-tracing
2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -103,15 +103,10 @@ export class Span implements api.Span, ReadableSpan {
103
103
104
104
if (
105
105
Object . keys ( this . attributes ) . length >=
106
- this . _traceParams . numberOfAttributesPerSpan !
106
+ this . _traceParams . numberOfAttributesPerSpan ! &&
107
+ ! Object . prototype . hasOwnProperty . call ( this . attributes , key )
107
108
) {
108
- const attributeKeyToDelete = Object . keys ( this . attributes ) . shift ( ) ;
109
- if ( attributeKeyToDelete ) {
110
- this . _logger . warn (
111
- `Dropping extra attributes : ${ attributeKeyToDelete } `
112
- ) ;
113
- delete this . attributes [ attributeKeyToDelete ] ;
114
- }
109
+ return this ;
115
110
}
116
111
this . attributes [ key ] = value ;
117
112
return this ;
Original file line number Diff line number Diff line change @@ -348,8 +348,9 @@ describe('Span', () => {
348
348
assert . strictEqual ( span . events . length , 100 ) ;
349
349
assert . strictEqual ( Object . keys ( span . attributes ) . length , 100 ) ;
350
350
assert . strictEqual ( span . events [ span . events . length - 1 ] . name , 'sent149' ) ;
351
- assert . strictEqual ( span . attributes [ 'foo0' ] , undefined ) ;
352
- assert . strictEqual ( span . attributes [ 'foo149' ] , 'bar149' ) ;
351
+ assert . strictEqual ( span . attributes [ 'foo0' ] , 'bar0' ) ;
352
+ assert . strictEqual ( span . attributes [ 'foo99' ] , 'bar99' ) ;
353
+ assert . strictEqual ( span . attributes [ 'sent100' ] , undefined ) ;
353
354
} ) ;
354
355
355
356
it ( 'should set an error status' , ( ) => {
You can’t perform that action at this time.
0 commit comments