Skip to content

Commit

Permalink
chore: remove ordered attribute dropping
Browse files Browse the repository at this point in the history
  • Loading branch information
dyladan committed Nov 18, 2020
1 parent 7242c76 commit 75672cb
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/opentelemetry-tracing/src/Span.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,10 @@ export class Span implements api.Span, ReadableSpan {

if (
Object.keys(this.attributes).length >=
this._traceParams.numberOfAttributesPerSpan!
this._traceParams.numberOfAttributesPerSpan! &&
!Object.prototype.hasOwnProperty.call(this.attributes, key)
) {
const attributeKeyToDelete = Object.keys(this.attributes).shift();
if (attributeKeyToDelete) {
this._logger.warn(
`Dropping extra attributes : ${attributeKeyToDelete}`
);
delete this.attributes[attributeKeyToDelete];
}
return this;
}
this.attributes[key] = value;
return this;
Expand Down

0 comments on commit 75672cb

Please sign in to comment.