File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
packages/opentelemetry-sdk-trace-base/src Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -157,9 +157,11 @@ export class SpanImpl implements Span {
157157 return this ;
158158 }
159159
160+ const { attributeCountLimit } = this . _spanLimits ;
161+
160162 if (
161- Object . keys ( this . attributes ) . length >=
162- this . _spanLimits . attributeCountLimit ! &&
163+ attributeCountLimit !== undefined &&
164+ Object . keys ( this . attributes ) . length >= attributeCountLimit &&
163165 ! Object . prototype . hasOwnProperty . call ( this . attributes , key )
164166 ) {
165167 this . _droppedAttributesCount ++ ;
@@ -189,12 +191,19 @@ export class SpanImpl implements Span {
189191 timeStamp ?: TimeInput
190192 ) : this {
191193 if ( this . _isSpanEnded ( ) ) return this ;
192- if ( this . _spanLimits . eventCountLimit === 0 ) {
194+
195+ const { eventCountLimit } = this . _spanLimits ;
196+
197+ if ( eventCountLimit === 0 ) {
193198 diag . warn ( 'No events allowed.' ) ;
194199 this . _droppedEventsCount ++ ;
195200 return this ;
196201 }
197- if ( this . events . length >= this . _spanLimits . eventCountLimit ! ) {
202+
203+ if (
204+ eventCountLimit !== undefined &&
205+ this . events . length >= eventCountLimit
206+ ) {
198207 if ( this . _droppedEventsCount === 0 ) {
199208 diag . debug ( 'Dropping extra events.' ) ;
200209 }
You can’t perform that action at this time.
0 commit comments