From d4fe95814bb837445fbb47999a64c29f549d3863 Mon Sep 17 00:00:00 2001 From: Trent Mick Date: Thu, 7 Sep 2023 09:56:45 -0700 Subject: [PATCH] chore: upgrade lru-cache; replace use of async-cache (#3610) lru-cache@7 added support for async fetching, and async-cache was deprecated See https://github.com/isaacs/node-lru-cache#fetchmethod-read-only for the best docs for using lru-cache for async caching. Refs: https://github.com/elastic/apm-agent-nodejs/issues/2760 --- .../ElasticApmMetricExporter.js | 6 +- lib/stacktraces.js | 375 +++++++++--------- package-lock.json | 171 ++++---- package.json | 3 +- 4 files changed, 267 insertions(+), 288 deletions(-) diff --git a/lib/opentelemetry-metrics/ElasticApmMetricExporter.js b/lib/opentelemetry-metrics/ElasticApmMetricExporter.js index f9828d0c36..0aad0813ca 100644 --- a/lib/opentelemetry-metrics/ElasticApmMetricExporter.js +++ b/lib/opentelemetry-metrics/ElasticApmMetricExporter.js @@ -14,7 +14,7 @@ const { DropAggregation, DataPointType, } = require('@opentelemetry/sdk-metrics'); -const LRU = require('lru-cache'); +const { LRUCache } = require('lru-cache'); /** * The `timestamp` in a metricset for APM Server intake is "UTC based and @@ -102,8 +102,8 @@ class ElasticApmMetricExporter { this._sumAggregation = new SumAggregation(); this._lastValueAggregation = new LastValueAggregation(); this._dropAggregation = new DropAggregation(); - this._attrDropWarnCache = new LRU({ max: 1000 }); - this._dataPointTypeDropWarnCache = new LRU({ max: 1000 }); + this._attrDropWarnCache = new LRUCache({ max: 1000 }); + this._dataPointTypeDropWarnCache = new LRUCache({ max: 1000 }); } /** diff --git a/lib/stacktraces.js b/lib/stacktraces.js index 6f9d693d31..3bb510c613 100644 --- a/lib/stacktraces.js +++ b/lib/stacktraces.js @@ -13,11 +13,9 @@ // A lot of this derived from https://github.com/watson/stackman but was // moved internal to allow breaking compat for perf work. -var fs = require('fs'); +var fsPromises = require('fs/promises'); var path = require('path'); - -const asyncCache = require('async-cache'); -const afterAllResults = require('after-all-results'); +var { promisify } = require('util'); // avoid loading error-callsites until needed to avoid // Error.prepareStackTrace side-effects @@ -28,43 +26,44 @@ function initStackTraceCollection() { } const errorStackParser = require('error-stack-parser'); const loadSourceMap = require('./load-source-map'); -const LRU = require('lru-cache'); +const { LRUCache } = require('lru-cache'); -const fileCache = asyncCache({ +const fileCache = new LRUCache({ max: 500, // fileCacheMax - load: function (file, cb) { - fs.readFile(file, { encoding: 'utf8' }, function (err, data) { - if (err) { - cb(err); - return; - } - cb(null, data.split(/\r?\n/)); - }); + fetchMethod: async (file, _staleValue, { signal }) => { + // Note: We *could* pass `signal` to fsPromies.readFile options. + const data = await fsPromises.readFile(file, { encoding: 'utf8' }); + if (signal.aborted) { + return; + } + return data.split(/\r?\n/); }, }); -const sourceMapCache = asyncCache({ +const sourceMapCache = new LRUCache({ max: 500, // sourceMapCacheMax - load: function (filename, cb) { + fetchMethod: async (filename, _staleValue, { signal }) => { if (!filename) { - cb(null, null); + return null; + } + + const sourcemap = await promisify(loadSourceMap)(filename); + if (signal.aborted) { return; } - loadSourceMap(filename, function onSourceMap(err, sourcemap) { - // Translate sourcemap===undefined to null, because 'async-cache' - // treats `undefined` as a cache miss. Without this there is no - // caching for files that have no sourcemap (the common case). - cb(err, sourcemap || null); - }); + // Translate sourcemap===undefined to null, because lru-cache + // treats `undefined` as a cache miss. Without this there is no + // caching for files that have no sourcemap (the common case). + return sourcemap || null; }, - dispose: function (_filename, sourcemap) { + dispose: function (sourcemap, _filename, _reason) { if (sourcemap) { sourcemap.destroy(); } }, }); -const frameCache = new LRU({ max: 1000 }); +const frameCache = new LRUCache({ max: 1000 }); const frameCacheStats = { hits: 0, misses: 0, @@ -241,15 +240,15 @@ function getRelativeFileName(filename, relTo) { } } -function getSourceMapConsumer(callsite, cb) { +async function getSourceMapConsumer(callsite) { if (isCallSiteNode(callsite)) { - process.nextTick(cb, null, null); + return null; } else { var filename = callsite.getFileName(); if (!filename) { - process.nextTick(cb, null, null); + return null; } else { - sourceMapCache.get(filename, cb); + return sourceMapCache.fetch(filename); } } } @@ -268,14 +267,14 @@ function getSourceMapConsumer(callsite, cb) { // from a v8 CallSite object // (https://v8.dev/docs/stack-trace-api#customizing-stack-traces). // -// This calls back with `cb(null, frame)` -- the first err arg is always null. -function frameFromCallSite( +// This asynchronously returns the call frame object. Getting source context +// is best-effort, so the returned Promise never rejects. +async function frameFromCallSite( log, callsite, cwd, sourceLinesAppFrames, sourceLinesLibraryFrames, - cb, ) { // getFileName can return null, e.g. with a `at Generator.next ()` frame. const filename = callsite.getFileName() || ''; @@ -305,139 +304,136 @@ function frameFromCallSite( clonedFrame.post_context = clonedFrame.post_context.slice(); } - setImmediate(cb, null, clonedFrame); - return; + return clonedFrame; } - function cacheAndCb(frame) { + + function cacheIt(frame) { frameCacheStats.misses++; frameCache.set(cacheKey, frame); - cb(null, frame); } - // If the file has a sourcemap we use that for: filename, lineno, source + let mappedFilename = null; + let absMappedFilename = null; + let mappedLineno = null; + + // If the file has a sourcemap, we use that for: filename, lineno, source // context. - getSourceMapConsumer( - callsite, - function onSourceMapConsumer(sourceMapErr, sourceMapConsumer) { - let mappedFilename = null; - let absMappedFilename = null; - let mappedLineno = null; - - if (sourceMapErr) { - log.debug( - { filename, err: sourceMapErr }, - 'could not process file source map', - ); - } else if (sourceMapConsumer) { - let pos; - try { - pos = sourceMapConsumer.originalPositionFor({ - line: lineno, - column: callsite.getColumnNumber(), - }); - } catch (posErr) { - log.debug( - { filename, line: lineno, err: sourceMapErr }, - 'could not get position from sourcemap', - ); - pos = { - source: null, - line: null, - column: null, - name: null, - }; - } - if (pos.source !== null) { - mappedFilename = pos.source; - absMappedFilename = path.resolve( - path.dirname(filename), - mappedFilename, - ); - } - if (pos.line !== null) { - mappedLineno = pos.line; - } - // TODO: Is `pos.name` relevant for `frame.function` if minifying? - } - - const isApp = isCallSiteApp(callsite); - const frame = { - filename: getRelativeFileName(absMappedFilename || filename, cwd), - lineno: mappedLineno || lineno, - function: getCallSiteFunctionNameSanitized(callsite), - library_frame: !isApp, - }; - if (!Number.isFinite(frame.lineno)) { - // An early comment in stackman suggested this is "sometimes not" an int. - frame.lineno = 0; - } - if (filename) { - frame.abs_path = absMappedFilename || filename; - } - - // Finish early if we do not need to collect source lines of context. - var linesOfContext = isApp - ? sourceLinesAppFrames - : sourceLinesLibraryFrames; - if (linesOfContext === 0 || !filename || isCallSiteNode(callsite)) { - cacheAndCb(frame); - return; - } - - // Attempt to use "sourcesContent" in a sourcemap, if available. - if (sourceMapConsumer && mappedFilename && mappedLineno) { - // To use `sourceMapConsumer.sourceContentFor` we need the filename as - // it is in the "sources" field of the source map. `mappedFilename`, - // from `sourceMapConsume.originalPositionFor` above, was made relative - // to "sourceRoot" -- sourceFilename undoes that. - const sourceFilename = sourceMapConsumer.sourceRoot - ? path.relative(sourceMapConsumer.sourceRoot, mappedFilename) - : mappedFilename; - var source = sourceMapConsumer.sourceContentFor(sourceFilename, true); - log.trace( - { - sourceRoot: sourceMapConsumer.sourceRoot, - mappedFilename, - sourceFilename, - haveSourceContent: !!source, - }, - 'sourcemap sourceContent lookup', - ); - if (source) { - addSourceContextToFrame( - frame, - source.split(/\r?\n/g), - mappedLineno, - linesOfContext, - ); - cacheAndCb(frame); - return; - } - } - - // If the file looks like it minimized (as we didn't have a source-map in - // the processing above), then skip adding source context because it - // is mostly useless and the typically 500-char lines result in over-large - // APM error objects. - if (filename.endsWith('.min.js')) { - cacheAndCb(frame); - return; - } - - // Otherwise load the file from disk, if available. - fileCache.get(frame.abs_path, function onFileCacheGet(fileErr, lines) { - if (fileErr) { - log.debug( - { filename: frame.abs_path, err: fileErr }, - 'could not read file for source context', - ); - } else { - addSourceContextToFrame(frame, lines, frame.lineno, linesOfContext); - } - cacheAndCb(frame); + let sourceMapConsumer = null; + try { + sourceMapConsumer = await getSourceMapConsumer(callsite); + } catch (sourceMapErr) { + log.debug( + { filename, err: sourceMapErr }, + 'could not process file source map', + ); + } + if (sourceMapConsumer) { + let pos; + try { + pos = sourceMapConsumer.originalPositionFor({ + line: lineno, + column: colno, }); - }, - ); + } catch (posErr) { + log.debug( + { filename, line: lineno, err: posErr }, + 'could not get position from sourcemap', + ); + pos = { + source: null, + line: null, + column: null, + name: null, + }; + } + if (pos.source !== null) { + mappedFilename = pos.source; + absMappedFilename = path.resolve(path.dirname(filename), mappedFilename); + } + if (pos.line !== null) { + mappedLineno = pos.line; + } + // TODO: Is `pos.name` relevant for `frame.function` if minifying? + } + + const isApp = isCallSiteApp(callsite); + const frame = { + filename: getRelativeFileName(absMappedFilename || filename, cwd), + lineno: mappedLineno || lineno, + function: getCallSiteFunctionNameSanitized(callsite), + library_frame: !isApp, + }; + if (!Number.isFinite(frame.lineno)) { + // An early comment in stackman suggested this is "sometimes not" an int. + frame.lineno = 0; + } + if (filename) { + frame.abs_path = absMappedFilename || filename; + } + + // Finish early if we do not need to collect source lines of context. + var linesOfContext = isApp ? sourceLinesAppFrames : sourceLinesLibraryFrames; + if (linesOfContext === 0 || !filename || isCallSiteNode(callsite)) { + cacheIt(frame); + return frame; + } + + // Attempt to use "sourcesContent" in a sourcemap, if available. + if (sourceMapConsumer && mappedFilename && mappedLineno) { + // To use `sourceMapConsumer.sourceContentFor` we need the filename as + // it is in the "sources" field of the source map. `mappedFilename`, + // from `sourceMapConsume.originalPositionFor` above, was made relative + // to "sourceRoot" -- sourceFilename undoes that. + const sourceFilename = sourceMapConsumer.sourceRoot + ? path.relative(sourceMapConsumer.sourceRoot, mappedFilename) + : mappedFilename; + var source = sourceMapConsumer.sourceContentFor(sourceFilename, true); + log.trace( + { + sourceRoot: sourceMapConsumer.sourceRoot, + mappedFilename, + sourceFilename, + haveSourceContent: !!source, + }, + 'sourcemap sourceContent lookup', + ); + if (source) { + addSourceContextToFrame( + frame, + source.split(/\r?\n/g), + mappedLineno, + linesOfContext, + ); + cacheIt(frame); + return frame; + } + } + + // If the file looks like it minimized (as we didn't have a source-map in + // the processing above), then skip adding source context because it + // is mostly useless and the typically 500-char lines result in over-large + // APM error objects. + if (filename.endsWith('.min.js')) { + cacheIt(frame); + return frame; + } + + // Otherwise load the file from disk, if available. + let lines; + try { + lines = await fileCache.fetch(frame.abs_path); + } catch (fileErr) { + log.debug( + { filename: frame.abs_path, err: fileErr }, + 'could not read file for source context', + ); + } + if (lines) { + addSourceContextToFrame(frame, lines, frame.lineno, linesOfContext); + } + + cacheIt(frame); + return frame; } // ---- exports @@ -471,38 +467,49 @@ function gatherStackTrace( // https://v8.dev/docs/stack-trace-api#customizing-stack-traces let callsites = errorCallsites ? errorCallsites(err) : null; - const next = afterAllResults(function finish(_err, stacktrace) { - // _err is always null from frameFromCallSite. - - // If we are not able to extract callsite information from err, then - // fallback to parsing the err.stack string. - if (stacktrace.length === 0) { - stacktrace = stackTraceFromErrStackString(log, err); - } - - cb(null, stacktrace); - }); - if (!isValidCallsites(callsites)) { // When can this happen? Another competing Error.prepareStackTrace breaking // error-callsites? Also initStackTraceCollection not having been called. log.debug('could not get valid callsites from error "%s"', err); - } else if (callsites) { - if (filterCallSite) { - callsites = callsites.filter(filterCallSite); - } - const cwd = getCwd(log); - for (let i = 0; i < callsites.length; i++) { - frameFromCallSite( - log, - callsites[i], - cwd, - sourceLinesAppFrames, - sourceLinesLibraryFrames, - next(), - ); + // Fallback to parsing the err.stack string. + setImmediate(cb, null, stackTraceFromErrStackString(log, err)); + return; + } + + if (filterCallSite) { + callsites = callsites.filter(filterCallSite); + if (callsites.length === 0) { + // Note: I'm not sure using the fallback here is the intended behaviour, + // because it defeats the purpose of a `filterCallSite` that filters out + // all callsites. In an earlier implementation this fallback handling was + // lumped in with the `!isValidCallsites(...)` case. `filterCallSite` is + // only used for *span* stacktraces (off by default), so the priority here + // is low. + setImmediate(cb, null, stackTraceFromErrStackString(log, err)); + return; } } + + const cwd = getCwd(log); + const promises = callsites.map((callsite) => + frameFromCallSite( + log, + callsite, + cwd, + sourceLinesAppFrames, + sourceLinesLibraryFrames, + ), + ); + + Promise.all(promises) + .then((stacktrace) => cb(null, stacktrace)) + .catch((frameErr) => { + log.debug( + { err, frameErr }, + 'error getting a stack frame from one or more callsites', + ); + cb(null, stackTraceFromErrStackString(log, err)); // fallback + }); } module.exports = { diff --git a/package-lock.json b/package-lock.json index 0fbf89c963..2385ec1c03 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,6 @@ "@opentelemetry/sdk-metrics": "^1.12.0", "after-all-results": "^2.0.0", "agentkeepalive": "^4.2.1", - "async-cache": "^1.1.0", "async-value-promise": "^1.1.1", "basic-auth": "^2.0.1", "breadth-filter": "^2.0.0", @@ -29,7 +28,7 @@ "fast-stream-to-buffer": "^1.0.0", "http-headers": "^3.0.2", "import-in-the-middle": "1.4.2", - "lru-cache": "^6.0.0", + "lru-cache": "^10.0.1", "measured-reporting": "^1.51.1", "module-details-from-path": "^1.0.3", "monitor-event-loop-delay": "^1.0.0", @@ -6384,6 +6383,18 @@ "graphql": "^15.3.0 || ^16.0.0" } }, + "node_modules/apollo-server-core/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/apollo-server-core/node_modules/uuid": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", @@ -6393,6 +6404,12 @@ "uuid": "dist/bin/uuid" } }, + "node_modules/apollo-server-core/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/apollo-server-env": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/apollo-server-env/-/apollo-server-env-4.2.1.tgz", @@ -6677,24 +6694,6 @@ "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==", "dev": true }, - "node_modules/async-cache": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/async-cache/-/async-cache-1.1.0.tgz", - "integrity": "sha1-SppaidBl7F2OUlS9nulrp2xTK1o=", - "deprecated": "No longer maintained. Use [lru-cache](http://npm.im/lru-cache) version 7.6 or higher, and provide an asynchronous `fetchMethod` option.", - "dependencies": { - "lru-cache": "^4.0.0" - } - }, - "node_modules/async-cache/node_modules/lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dependencies": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, "node_modules/async-retry": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", @@ -12959,21 +12958,13 @@ } }, "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", "engines": { - "node": ">=10" + "node": "14 || >=16.14" } }, - "node_modules/lru-cache/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "node_modules/make-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", @@ -14434,15 +14425,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", - "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", - "dev": true, - "engines": { - "node": "14 || >=16.14" - } - }, "node_modules/path-scurry/node_modules/minipass": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.3.tgz", @@ -14950,11 +14932,6 @@ "node": ">= 0.10" } }, - "node_modules/pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" - }, "node_modules/psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", @@ -16045,6 +16022,22 @@ "node": ">=10" } }, + "node_modules/semver/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, "node_modules/send": { "version": "0.18.0", "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", @@ -18248,11 +18241,6 @@ "node": ">=10" } }, - "node_modules/yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" - }, "node_modules/yaml": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", @@ -23336,11 +23324,26 @@ "whatwg-mimetype": "^3.0.0" }, "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, "uuid": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true } } }, @@ -23552,25 +23555,6 @@ "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==", "dev": true }, - "async-cache": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/async-cache/-/async-cache-1.1.0.tgz", - "integrity": "sha1-SppaidBl7F2OUlS9nulrp2xTK1o=", - "requires": { - "lru-cache": "^4.0.0" - }, - "dependencies": { - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - } - } - }, "async-retry": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", @@ -28320,19 +28304,9 @@ "dev": true }, "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - }, - "dependencies": { - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - } - } + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==" }, "make-dir": { "version": "2.1.0", @@ -29453,12 +29427,6 @@ "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "dependencies": { - "lru-cache": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", - "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", - "dev": true - }, "minipass": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.3.tgz", @@ -29827,11 +29795,6 @@ "ipaddr.js": "1.9.1" } }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" - }, "psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", @@ -30686,6 +30649,21 @@ "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "requires": { "lru-cache": "^6.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } } }, "send": { @@ -32413,11 +32391,6 @@ "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" - }, "yaml": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", diff --git a/package.json b/package.json index 7d4f62e574..5e11e75d6d 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,6 @@ "@opentelemetry/sdk-metrics": "^1.12.0", "after-all-results": "^2.0.0", "agentkeepalive": "^4.2.1", - "async-cache": "^1.1.0", "async-value-promise": "^1.1.1", "basic-auth": "^2.0.1", "breadth-filter": "^2.0.0", @@ -107,7 +106,7 @@ "fast-stream-to-buffer": "^1.0.0", "http-headers": "^3.0.2", "import-in-the-middle": "1.4.2", - "lru-cache": "^6.0.0", + "lru-cache": "^10.0.1", "measured-reporting": "^1.51.1", "module-details-from-path": "^1.0.3", "monitor-event-loop-delay": "^1.0.0",