File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed
packages/opentelemetry-tracing Expand file tree Collapse file tree 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 {
103103
104104 if (
105105 Object . keys ( this . attributes ) . length >=
106- this . _traceParams . numberOfAttributesPerSpan !
106+ this . _traceParams . numberOfAttributesPerSpan ! &&
107+ ! Object . prototype . hasOwnProperty . call ( this . attributes , key )
107108 ) {
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 ;
115110 }
116111 this . attributes [ key ] = value ;
117112 return this ;
Original file line number Diff line number Diff line change @@ -348,8 +348,9 @@ describe('Span', () => {
348348 assert . strictEqual ( span . events . length , 100 ) ;
349349 assert . strictEqual ( Object . keys ( span . attributes ) . length , 100 ) ;
350350 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 ) ;
353354 } ) ;
354355
355356 it ( 'should set an error status' , ( ) => {
You can’t perform that action at this time.
0 commit comments