From f898c98b1402e3f43742c45397d1af0d38561623 Mon Sep 17 00:00:00 2001 From: "Ida.Liu" Date: Tue, 29 Oct 2024 22:05:32 -0400 Subject: [PATCH] fix linter errors --- packages/dd-trace/src/opentracing/propagation/text_map.js | 8 ++------ .../test/opentracing/propagation/text_map.spec.js | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/dd-trace/src/opentracing/propagation/text_map.js b/packages/dd-trace/src/opentracing/propagation/text_map.js index b96779c3590..57a16325690 100644 --- a/packages/dd-trace/src/opentracing/propagation/text_map.js +++ b/packages/dd-trace/src/opentracing/propagation/text_map.js @@ -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(',') @@ -147,10 +147,6 @@ class TextMapPropagator { } } - _chopBaggageItemNumberToBeUnder(limit) { - - } - _injectTags (spanContext, carrier) { const trace = spanContext._trace diff --git a/packages/dd-trace/test/opentracing/propagation/text_map.spec.js b/packages/dd-trace/test/opentracing/propagation/text_map.spec.js index 540f3413a67..4b2c85e55e5 100644 --- a/packages/dd-trace/test/opentracing/propagation/text_map.spec.js +++ b/packages/dd-trace/test/opentracing/propagation/text_map.spec.js @@ -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 })