diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index ebb8a5084e4..dac7579959f 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -59,7 +59,6 @@ dev,get-port,MIT,Copyright Sindre Sorhus dev,glob,ISC,Copyright Isaac Z. Schlueter and Contributors dev,globals,MIT,Copyright (c) Sindre Sorhus (https://sindresorhus.com) dev,graphql,MIT,Copyright 2015 Facebook Inc. -dev,int64-buffer,MIT,Copyright 2015-2016 Yusuke Kawasaki dev,jszip,MIT,Copyright 2015-2016 Stuart Knightley and contributors dev,knex,MIT,Copyright (c) 2013-present Tim Griesser dev,mkdirp,MIT,Copyright 2010 James Halliday diff --git a/package.json b/package.json index e2596fccfc0..23bac9fdfc5 100644 --- a/package.json +++ b/package.json @@ -143,7 +143,6 @@ "glob": "^7.1.6", "globals": "^15.10.0", "graphql": "0.13.2", - "int64-buffer": "^0.1.9", "jszip": "^3.5.0", "knex": "^2.4.2", "mkdirp": "^3.0.1", diff --git a/packages/datadog-plugin-net/test/index.spec.js b/packages/datadog-plugin-net/test/index.spec.js index adcf175e405..b3fc60ece3c 100644 --- a/packages/datadog-plugin-net/test/index.spec.js +++ b/packages/datadog-plugin-net/test/index.spec.js @@ -3,7 +3,6 @@ const dns = require('dns') const agent = require('../../dd-trace/test/plugins/agent') const { expectSomeSpan } = require('../../dd-trace/test/plugins/helpers') -const { Int64BE } = require('int64-buffer') // TODO remove dependency const { ERROR_MESSAGE, ERROR_TYPE, ERROR_STACK } = require('../../dd-trace/src/constants') describe('Plugin', () => { @@ -66,7 +65,7 @@ describe('Plugin', () => { 'span.kind': 'client', 'ipc.path': '/tmp/dd-trace.sock' }, - parent_id: new Int64BE(parent.context()._spanId._buffer) + parent_id: BigInt(parent.context()._spanId.toString(10)) }).then(done).catch(done) tracer.scope().activate(parent, () => { @@ -121,7 +120,7 @@ describe('Plugin', () => { 'tcp.remote.port': port, 'tcp.local.port': socket.localPort }, - parent_id: new Int64BE(parent.context()._spanId._buffer) + parent_id: BigInt(parent.context()._spanId.toString(10)) }, 2000).then(done).catch(done) }) }) @@ -152,7 +151,7 @@ describe('Plugin', () => { 'tcp.remote.port': port, 'tcp.local.port': socket.localPort }, - parent_id: new Int64BE(parent.context()._spanId._buffer) + parent_id: BigInt(parent.context()._spanId.toString(10)) }).then(done).catch(done) }) }) @@ -168,7 +167,7 @@ describe('Plugin', () => { 'span.kind': 'client', 'ipc.path': '/tmp/dd-trace.sock' }, - parent_id: new Int64BE(parent.context()._spanId._buffer) + parent_id: BigInt(parent.context()._spanId.toString(10)) }).then(done).catch(done) tracer.scope().activate(parent, () => { diff --git a/packages/dd-trace/test/datastreams/processor.spec.js b/packages/dd-trace/test/datastreams/processor.spec.js index 110d9ff6c35..1ae669b15c8 100644 --- a/packages/dd-trace/test/datastreams/processor.spec.js +++ b/packages/dd-trace/test/datastreams/processor.spec.js @@ -3,7 +3,6 @@ require('../setup/tap') const { hostname } = require('os') -const Uint64 = require('int64-buffer').Uint64BE const { LogCollapsingLowestDenseDDSketch } = require('@datadog/sketches-js') @@ -66,8 +65,8 @@ describe('StatsPoint', () => { payloadSize.accept(100) const encoded = aggStats.encode() - expect(encoded.Hash.toString()).to.equal(new Uint64(DEFAULT_CURRENT_HASH).toString()) - expect(encoded.ParentHash.toString()).to.equal(new Uint64(DEFAULT_PARENT_HASH).toString()) + expect(encoded.Hash.toString(16)).to.equal(DEFAULT_CURRENT_HASH.toString('hex')) + expect(encoded.ParentHash.toString(16)).to.equal(DEFAULT_PARENT_HASH.toString('hex')) expect(encoded.EdgeTags).to.deep.equal(aggStats.edgeTags) expect(encoded.EdgeLatency).to.deep.equal(edgeLatency.toProto()) expect(encoded.PathwayLatency).to.deep.equal(pathwayLatency.toProto()) @@ -278,8 +277,8 @@ describe('DataStreamsProcessor', () => { payloadSize.accept(mockCheckpoint.payloadSize) const encoded = checkpointBucket.encode() - expect(encoded.Hash.toString()).to.equal(new Uint64(DEFAULT_CURRENT_HASH).toString()) - expect(encoded.ParentHash.toString()).to.equal(new Uint64(DEFAULT_PARENT_HASH).toString()) + expect(encoded.Hash.toString(16)).to.equal(DEFAULT_CURRENT_HASH.toString('hex')) + expect(encoded.ParentHash.toString(16)).to.equal(DEFAULT_PARENT_HASH.toString('hex')) expect(encoded.EdgeTags).to.deep.equal(mockCheckpoint.edgeTags) expect(encoded.EdgeLatency).to.deep.equal(edgeLatency.toProto()) expect(encoded.PathwayLatency).to.deep.equal(pathwayLatency.toProto()) diff --git a/packages/dd-trace/test/dd-trace.spec.js b/packages/dd-trace/test/dd-trace.spec.js index 8604d96540b..4e365014ea8 100644 --- a/packages/dd-trace/test/dd-trace.spec.js +++ b/packages/dd-trace/test/dd-trace.spec.js @@ -2,7 +2,6 @@ require('./setup/tap') -const Uint64BE = require('int64-buffer').Uint64BE const agent = require('./plugins/agent') const { SAMPLING_PRIORITY_KEY, DECISION_MAKER_KEY } = require('../src/constants') @@ -34,8 +33,8 @@ describe('dd-trace', () => { expect(payload[0][0].service).to.equal('test') expect(payload[0][0].name).to.equal('hello') expect(payload[0][0].resource).to.equal('/hello/:name') - expect(payload[0][0].start).to.be.instanceof(Uint64BE) - expect(payload[0][0].duration).to.be.instanceof(Uint64BE) + expect(typeof payload[0][0].start).to.equal('bigint') + expect(typeof payload[0][0].duration).to.equal('bigint') expect(payload[0][0].metrics).to.have.property(SAMPLING_PRIORITY_KEY) expect(payload[0][0].meta).to.have.property(DECISION_MAKER_KEY) }) diff --git a/packages/dd-trace/test/plugins/helpers.js b/packages/dd-trace/test/plugins/helpers.js index add1361e167..a320d02681a 100644 --- a/packages/dd-trace/test/plugins/helpers.js +++ b/packages/dd-trace/test/plugins/helpers.js @@ -1,7 +1,5 @@ 'use strict' -const { Int64BE } = require('int64-buffer') // TODO remove dependency - const { AssertionError } = require('assert') const { AsyncResource } = require('../../../datadog-instrumentations/src/helpers/instrument') @@ -47,7 +45,7 @@ function deepInclude (expected, actual, path = []) { for (const propName in expected) { path.push(propName.includes('.') ? `['${propName}']` : propName) if (isObject(expected[propName]) && isObject(actual[propName])) { - if (expected[propName] instanceof Int64BE) { + if (typeof expected[propName] === 'bigint') { deepInclude(expected[propName].toString(), actual[propName].toString(), path) } else { deepInclude(expected[propName], actual[propName], path) diff --git a/yarn.lock b/yarn.lock index ef7d776cf44..218f5ef47af 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2973,11 +2973,6 @@ ink@^3.2.0: ws "^7.5.5" yoga-layout-prebuilt "^1.9.6" -int64-buffer@^0.1.9: - version "0.1.10" - resolved "https://registry.npmjs.org/int64-buffer/-/int64-buffer-0.1.10.tgz" - integrity sha512-v7cSY1J8ydZ0GyjUHqF+1bshJ6cnEVLo9EnjB8p+4HDRPZc9N5jjmvUV7NvEsqQOKyH0pmIBFWXVQbiS0+OBbA== - internal-slot@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.7.tgz#c06dcca3ed874249881007b0a5523b172a190802"