Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ida613 committed Oct 30, 2024
1 parent 58d1b7f commit f898c98
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions packages/dd-trace/src/opentracing/propagation/text_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ class TextMapPropagator {
let counter = 1
for (const [key, value] of Object.entries(spanContext._baggageItems)) {
baggage += `${this._encodeOtelBaggageKey(String(key).trim())}=${encodeURIComponent(String(value).trim())},`
if (counter == this._config.baggageMaxItems || counter > this._config.baggageMaxItems) break
if (counter === this._config.baggageMaxItems || counter > this._config.baggageMaxItems) break
counter += 1
}
baggage = baggage.slice(0, baggage.length-1)
baggage = baggage.slice(0, baggage.length - 1)
let buf = Buffer.from(baggage)
if (buf.length > this._config.baggageMaxBytes) {
const originalBaggages = baggage.split(',')
Expand All @@ -147,10 +147,6 @@ class TextMapPropagator {
}
}

_chopBaggageItemNumberToBeUnder(limit) {

}

_injectTags (spanContext, carrier) {
const trace = spanContext._trace

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ describe('TextMapPropagator', () => {
it('should drop excess baggage items when the resulting baggage header contains many bytes', () => {
const carrier = {}
const baggageItems = {
raccoon: 'chunky',
raccoon: 'chunky',
foo: Buffer.alloc(config.baggageMaxBytes).toString()
}
const spanContext = createContext({ baggageItems })
Expand Down

0 comments on commit f898c98

Please sign in to comment.