From d3f7acad59955904c3d11cee182e8595f1d71fd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Th=C3=A9riault?= Date: Fri, 18 Oct 2024 15:34:16 -0400 Subject: [PATCH 01/15] the big cleanup --- .github/dependabot.yml | 6 - CONTRIBUTING.md | 8 +- examples/express-mysql/index.js | 6 + examples/fastify-postgres/index.js | 6 + .../fastify-postgres/solarwinds.apm.config.js | 1 + examples/next-prisma/next-env.d.ts | 2 +- examples/next-prisma/package.json | 2 +- packages/bindings/.gitignore | 1 - packages/bindings/build.js | 82 +--- packages/bindings/eslint.config.js | 2 +- packages/bindings/index.js | 19 +- .../linux-arm64-gnu-serverless/package.json | 33 -- .../bindings/npm/linux-arm64-gnu/package.json | 3 +- .../npm/linux-arm64-musl/package.json | 3 +- .../npm/linux-x64-gnu-serverless/package.json | 33 -- .../bindings/npm/linux-x64-gnu/package.json | 3 +- .../bindings/npm/linux-x64-musl/package.json | 3 +- packages/bindings/package.json | 9 +- packages/bindings/src/metrics/event_loop.hh | 185 ------- packages/bindings/src/metrics/metrics.cc | 16 - packages/bindings/test/oboe.test.ts | 4 +- packages/bindings/types/index.d.ts | 1 - packages/compat/eslint.config.js | 4 +- packages/compat/package.json | 17 +- packages/compat/test/index.test.ts | 18 +- packages/compat/tsconfig.json | 3 +- packages/dependencies/eslint.config.js | 2 +- packages/dependencies/package.json | 12 +- packages/dependencies/rollup.config.js | 19 - packages/dependencies/src/node-modules.ts | 4 +- packages/dependencies/tsconfig.json | 3 +- packages/eslint-config/eslint.config.js | 2 +- packages/histogram/eslint.config.js | 2 +- packages/histogram/package.json | 12 +- packages/histogram/rollup.config.js | 19 - packages/histogram/tsconfig.json | 3 +- packages/instrumentations/eslint.config.js | 2 +- packages/instrumentations/package.json | 10 +- packages/instrumentations/rollup.config.js | 19 - .../{compatibility.es.ts => compatibility.ts} | 0 packages/instrumentations/src/index.ts | 2 +- packages/instrumentations/tsconfig.json | 3 +- packages/lazy/.gitignore | 1 - packages/lazy/README.md | 3 - packages/lazy/eslint.config.js | 19 - packages/lazy/package.json | 49 -- packages/lazy/rollup.config.js | 19 - packages/lazy/src/index.ts | 102 ---- packages/lazy/tsconfig.json | 9 - packages/module/eslint.config.js | 4 +- packages/module/package.json | 18 +- packages/module/rollup.config.js | 19 - packages/module/src/index.ts | 32 +- packages/module/src/load.cjs.ts | 31 -- packages/module/src/load.es.ts | 29 -- packages/module/tsconfig.json | 3 +- packages/proto/build.js | 59 +-- packages/proto/cjs.wrapper | 10 - packages/proto/eslint.config.js | 2 +- packages/proto/package.json | 6 +- packages/proto/{es.wrapper => wrapper} | 0 packages/rollup-config/README.md | 3 - packages/rollup-config/eslint.config.js | 19 - packages/rollup-config/index.js | 92 ---- packages/rollup-config/package.json | 59 --- packages/sampling/eslint.config.js | 2 +- packages/sampling/package.json | 12 +- packages/sampling/rollup.config.js | 19 - packages/sampling/src/token-bucket.ts | 2 +- packages/sampling/tsconfig.json | 3 +- packages/sdk/.gitignore | 1 - packages/sdk/README.md | 3 - packages/sdk/eslint.config.js | 19 - packages/sdk/lib.d.ts | 25 - packages/sdk/package.json | 86 ---- packages/sdk/src/cache.ts | 69 --- packages/sdk/src/compound-processor.ts | 66 --- packages/sdk/src/config.ts | 43 -- packages/sdk/src/context.ts | 115 ----- packages/sdk/src/diag-logger.ts | 68 --- packages/sdk/src/error.ts | 36 -- packages/sdk/src/exporter.ts | 225 --------- packages/sdk/src/inbound-metrics-processor.ts | 125 ----- packages/sdk/src/index.ts | 68 --- packages/sdk/src/metric-exporter.ts | 279 ----------- packages/sdk/src/metrics/cpu.ts | 58 --- packages/sdk/src/metrics/event-loop.ts | 45 -- packages/sdk/src/metrics/gc.ts | 67 --- packages/sdk/src/metrics/index.ts | 44 -- packages/sdk/src/metrics/memory.ts | 166 ------- packages/sdk/src/metrics/serverless.ts | 119 ----- packages/sdk/src/otlp-exporter.ts | 49 -- packages/sdk/src/otlp-metrics-exporter.ts | 51 -- packages/sdk/src/parent-info-processor.ts | 43 -- packages/sdk/src/patches/aws-lambda.ts | 26 - packages/sdk/src/patches/aws-sdk.ts | 25 - packages/sdk/src/patches/bunyan.ts | 29 -- packages/sdk/src/patches/fs.ts | 24 - packages/sdk/src/patches/http.ts | 37 -- packages/sdk/src/patches/index.ts | 84 ---- packages/sdk/src/patches/mysql2.ts | 26 - packages/sdk/src/patches/pg.ts | 26 - packages/sdk/src/patches/pino.ts | 29 -- packages/sdk/src/patches/winston.ts | 32 -- packages/sdk/src/reporter.ts | 133 ----- packages/sdk/src/response-time-processor.ts | 38 -- packages/sdk/src/sampler.ts | 388 --------------- .../src/trace-context-options-propagator.ts | 199 -------- .../src/trace-options-response-propagator.ts | 84 ---- .../sdk/src/transaction-name-processor.ts | 43 -- packages/sdk/src/util.ts | 23 - packages/sdk/test/cache.test.ts | 53 -- .../sdk/test/compound-span-processor.test.ts | 99 ---- packages/sdk/test/context.test.ts | 141 ------ packages/sdk/test/mock.ts | 214 -------- packages/sdk/test/reporter.test.ts | 101 ---- packages/sdk/test/sampler.test.ts | 433 ---------------- .../trace-context-options-propagator.test.ts | 255 ---------- .../test/transaction-name-processor.test.ts | 78 --- packages/sdk/test/tsconfig.json | 4 - packages/sdk/tsconfig.json | 9 - packages/solarwinds-apm/package.json | 8 +- .../src/commonjs/flags.d.ts} | 3 +- .../src/commonjs/flags.js} | 6 +- packages/solarwinds-apm/src/commonjs/index.js | 2 +- packages/solarwinds-apm/src/config.ts | 2 +- packages/solarwinds-apm/src/index.ts | 19 +- .../src/processing/response-time.ts | 18 +- .../test/processing/response-time.test.ts | 8 +- .../test/processing/transaction-name.test.ts | 28 +- .../solarwinds-apm/test/sampling/grpc.test.ts | 38 +- .../test/sampling/sampler.test.ts | 10 +- packages/solarwinds-apm/tsconfig.json | 3 +- packages/test/eslint.config.js | 4 +- packages/test/package.json | 24 +- packages/test/rollup.config.js | 19 - packages/test/src/bin.ts | 8 +- .../src/ts-node/{import.es.ts => import.mts} | 2 +- .../src/ts-node/{loader.es.ts => loader.mts} | 0 packages/test/tsconfig.json | 3 +- packages/tsconfig.json | 4 - tsconfig.base.json | 1 - turbo.json | 5 +- yarn.lock | 464 +----------------- 144 files changed, 232 insertions(+), 6160 deletions(-) delete mode 100644 packages/bindings/npm/linux-arm64-gnu-serverless/package.json delete mode 100644 packages/bindings/npm/linux-x64-gnu-serverless/package.json delete mode 100644 packages/bindings/src/metrics/event_loop.hh delete mode 100644 packages/bindings/src/metrics/metrics.cc delete mode 100644 packages/dependencies/rollup.config.js delete mode 100644 packages/histogram/rollup.config.js delete mode 100644 packages/instrumentations/rollup.config.js rename packages/instrumentations/src/{compatibility.es.ts => compatibility.ts} (100%) delete mode 100644 packages/lazy/.gitignore delete mode 100644 packages/lazy/README.md delete mode 100644 packages/lazy/eslint.config.js delete mode 100644 packages/lazy/package.json delete mode 100644 packages/lazy/rollup.config.js delete mode 100644 packages/lazy/src/index.ts delete mode 100644 packages/lazy/tsconfig.json delete mode 100644 packages/module/rollup.config.js delete mode 100644 packages/module/src/load.cjs.ts delete mode 100644 packages/module/src/load.es.ts delete mode 100644 packages/proto/cjs.wrapper rename packages/proto/{es.wrapper => wrapper} (100%) delete mode 100644 packages/rollup-config/README.md delete mode 100644 packages/rollup-config/eslint.config.js delete mode 100644 packages/rollup-config/index.js delete mode 100644 packages/rollup-config/package.json delete mode 100644 packages/sampling/rollup.config.js delete mode 100644 packages/sdk/.gitignore delete mode 100644 packages/sdk/README.md delete mode 100644 packages/sdk/eslint.config.js delete mode 100644 packages/sdk/lib.d.ts delete mode 100644 packages/sdk/package.json delete mode 100644 packages/sdk/src/cache.ts delete mode 100644 packages/sdk/src/compound-processor.ts delete mode 100644 packages/sdk/src/config.ts delete mode 100644 packages/sdk/src/context.ts delete mode 100644 packages/sdk/src/diag-logger.ts delete mode 100644 packages/sdk/src/error.ts delete mode 100644 packages/sdk/src/exporter.ts delete mode 100644 packages/sdk/src/inbound-metrics-processor.ts delete mode 100644 packages/sdk/src/index.ts delete mode 100644 packages/sdk/src/metric-exporter.ts delete mode 100644 packages/sdk/src/metrics/cpu.ts delete mode 100644 packages/sdk/src/metrics/event-loop.ts delete mode 100644 packages/sdk/src/metrics/gc.ts delete mode 100644 packages/sdk/src/metrics/index.ts delete mode 100644 packages/sdk/src/metrics/memory.ts delete mode 100644 packages/sdk/src/metrics/serverless.ts delete mode 100644 packages/sdk/src/otlp-exporter.ts delete mode 100644 packages/sdk/src/otlp-metrics-exporter.ts delete mode 100644 packages/sdk/src/parent-info-processor.ts delete mode 100644 packages/sdk/src/patches/aws-lambda.ts delete mode 100644 packages/sdk/src/patches/aws-sdk.ts delete mode 100644 packages/sdk/src/patches/bunyan.ts delete mode 100644 packages/sdk/src/patches/fs.ts delete mode 100644 packages/sdk/src/patches/http.ts delete mode 100644 packages/sdk/src/patches/index.ts delete mode 100644 packages/sdk/src/patches/mysql2.ts delete mode 100644 packages/sdk/src/patches/pg.ts delete mode 100644 packages/sdk/src/patches/pino.ts delete mode 100644 packages/sdk/src/patches/winston.ts delete mode 100644 packages/sdk/src/reporter.ts delete mode 100644 packages/sdk/src/response-time-processor.ts delete mode 100644 packages/sdk/src/sampler.ts delete mode 100644 packages/sdk/src/trace-context-options-propagator.ts delete mode 100644 packages/sdk/src/trace-options-response-propagator.ts delete mode 100644 packages/sdk/src/transaction-name-processor.ts delete mode 100644 packages/sdk/src/util.ts delete mode 100644 packages/sdk/test/cache.test.ts delete mode 100644 packages/sdk/test/compound-span-processor.test.ts delete mode 100644 packages/sdk/test/context.test.ts delete mode 100644 packages/sdk/test/mock.ts delete mode 100644 packages/sdk/test/reporter.test.ts delete mode 100644 packages/sdk/test/sampler.test.ts delete mode 100644 packages/sdk/test/trace-context-options-propagator.test.ts delete mode 100644 packages/sdk/test/transaction-name-processor.test.ts delete mode 100644 packages/sdk/test/tsconfig.json delete mode 100644 packages/sdk/tsconfig.json rename packages/{sdk/test/test.d.ts => solarwinds-apm/src/commonjs/flags.d.ts} (93%) rename packages/{compat/rollup.config.js => solarwinds-apm/src/commonjs/flags.js} (88%) delete mode 100644 packages/test/rollup.config.js rename packages/test/src/ts-node/{import.es.ts => import.mts} (93%) rename packages/test/src/ts-node/{loader.es.ts => loader.mts} (100%) delete mode 100644 packages/tsconfig.json diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6adffff2..bd9f7d31 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -35,11 +35,7 @@ updates: patterns: - "turbo" - "typescript" - - "tslib" - "zig-build" - - "rollup" - - "@rollup/*" - - "rollup-*" update-types: - minor - patch @@ -51,8 +47,6 @@ updates: - "typescript-eslint" - "@eslint/*" - "eslint-*" - - "@typescript-eslint/*" - - "globals" update-types: - minor - patch diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f6472393..77a1ec0d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -61,7 +61,7 @@ This project aims to support all currently maintained and future LTS Node versio When a new future LTS is released (any even-numbered Node versions) the project should be updated to support it so that by the time it becomes an LTS it has already been well-tested. In most cases this doesn't require any change apart from updating the Docker images. It is however possible, although unlikely, that a future release may break native code or a dependency, which should be kept in mind. -When a current LTS goes out of maintenance, support for it should be removed. This project should not support its dependents in using unsupported, potentially insecure Node versions. The version of `@types/node` depended on by all packages should be updated to the next LTS version, for instance going from `^14.0.0` to `^16.0.0`. The `target` in the [base tsconfig](./tsconfig.base.json) should be updated to the highest standard supported by the next LTS version (check [`node.green`](https://node.green) for this) and the same should be done for the `languageOptions` in the ESLint configuration package. The Docker images for the old LTS should be removed, and the distro versions used by the Docker images for the next LTS should be changed to the lowest supported versions if necessary, for instance removing `14-alpine3.12` and moving from `16-alpine` to `16-alpine:3.12`. All `package.json` `engines` fields should also be updated to the next LTS version. +When a version has been EOL for over a year, support for it should be removed. This project should not encourage customers to use unsupported, potentially insecure Node versions. The version of `@types/node` depended on by all packages should be updated to the next LTS version, for instance going from `^14.0.0` to `^16.0.0`. The `target` in the [base tsconfig](./tsconfig.base.json) should be updated to the highest standard supported by the next LTS version (check [`node.green`](https://node.green) for this). The Docker images for the old LTS should be removed, and the distro versions used by the Docker images for the next LTS should be changed to the lowest supported versions if necessary, for instance removing `14-alpine3.12` and moving from `16-alpine` to `16-alpine:3.12`. All `package.json` `engines` fields should also be updated to the next LTS version. ## Upgrading dependencies @@ -99,11 +99,7 @@ This is especially important given this repo uses Turborepo to run commands in a ## ES Modules vs CommonJS -We explicitly aim to support ESM - -Packages should optimally target both ESM and CJS unless they have a good reason not to, in which case they should target CJS only for compatibility. At the moment the two CJS-only packages are the SDK because it's internal and has a lot of stateful components, and the bindings because they are internal and `.node` files can't be imported from ESM. - -Dual targeting is made simple by the project's [Rollup configuration](./packages/rollup-config/), which should work without being extended pretty much all the time. Files ending in `.es.{ts, js}` will only be included for ESM `.cjs.{ts, js}` only for CJS. We don't use `.m{ts, js}` and `.c{ts, js}` because they have poor TypeScript support (and I, the original author, think they are Ugly and Bad). Projects should always specify `"type": "module"` when dual targeting (or an explicit `"commonjs"`) in their `package.json`. +We target ESM wherever possible, but all public facing API functions must be callable from either ESM or CommonJS. Internal code (like scripts and examples) should attempt to use ESM as much as possible unless they are meant to demonstrate usage of the library from CJS. diff --git a/examples/express-mysql/index.js b/examples/express-mysql/index.js index 3634d716..23f1f958 100644 --- a/examples/express-mysql/index.js +++ b/examples/express-mysql/index.js @@ -18,6 +18,7 @@ const process = require("node:process") const express = require("express") const mysql = require("mysql2") +const apm = require("solarwinds-apm") const winston = require("winston") const logger = winston.createLogger({ @@ -85,6 +86,11 @@ app.post("/", (req, res) => { ) }) +app.get("/error", () => { + apm.setTransactionName("woops") + throw new Error("woops") +}) + app.get("/:id", (req, res) => { const id = Number.parseInt(req.params.id) if (!id || id < 0) { diff --git a/examples/fastify-postgres/index.js b/examples/fastify-postgres/index.js index 81bb0a94..a206790e 100644 --- a/examples/fastify-postgres/index.js +++ b/examples/fastify-postgres/index.js @@ -18,6 +18,7 @@ import { env } from "node:process" import pg from "@fastify/postgres" import fastify from "fastify" +import { setTransactionName } from "solarwinds-apm" const schema = ` CREATE TABLE IF NOT EXISTS items ( @@ -61,6 +62,11 @@ app.post( }, ) +app.get("/error", () => { + setTransactionName("woops") + throw new Error("woops") +}) + app.get( "/:id", { diff --git a/examples/fastify-postgres/solarwinds.apm.config.js b/examples/fastify-postgres/solarwinds.apm.config.js index 59997db7..18b0f9bc 100644 --- a/examples/fastify-postgres/solarwinds.apm.config.js +++ b/examples/fastify-postgres/solarwinds.apm.config.js @@ -18,4 +18,5 @@ limitations under the License. export default { insertTraceContextIntoQueries: true, insertTraceContextIntoLogs: true, + exportLogsEnabled: true, } diff --git a/examples/next-prisma/next-env.d.ts b/examples/next-prisma/next-env.d.ts index 4f11a03d..40c3d680 100644 --- a/examples/next-prisma/next-env.d.ts +++ b/examples/next-prisma/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. +// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. diff --git a/examples/next-prisma/package.json b/examples/next-prisma/package.json index f2116748..53b6027a 100644 --- a/examples/next-prisma/package.json +++ b/examples/next-prisma/package.json @@ -16,7 +16,7 @@ "solarwinds-apm": "workspace:^" }, "devDependencies": { - "@types/node": "^16.13.0", + "@types/node": "^18.19.0", "@types/react": "^18.2.25", "eslint": "^8.57.0", "eslint-config-next": "^14.0.3", diff --git a/packages/bindings/.gitignore b/packages/bindings/.gitignore index 5f4c1a7b..2b1d47eb 100644 --- a/packages/bindings/.gitignore +++ b/packages/bindings/.gitignore @@ -1,5 +1,4 @@ npm/*/oboe.node -npm/*/metrics.node npm/*/liboboe.so .cache/ diff --git a/packages/bindings/build.js b/packages/bindings/build.js index d25acb62..0ee23262 100644 --- a/packages/bindings/build.js +++ b/packages/bindings/build.js @@ -25,13 +25,6 @@ const targets = [ cpu: "generic", glibc: "2.27", }, - { - name: "linux-arm64-gnu-serverless", - oboe: "liboboe-1.0-lambda-aarch64.so", - target: "aarch64-linux-gnu", - cpu: "generic", - glibc: "2.27", - }, { name: "linux-arm64-musl", oboe: "liboboe-1.0-alpine-aarch64.so", @@ -45,13 +38,6 @@ const targets = [ cpu: "x86_64_v3", glibc: "2.27", }, - { - name: "linux-x64-gnu-serverless", - oboe: "liboboe-1.0-lambda-x86_64.so", - target: "x86_64-linux-gnu", - cpu: "x86_64_v3", - glibc: "2.27", - }, { name: "linux-x64-musl", oboe: "liboboe-1.0-alpine-x86_64.so", @@ -59,41 +45,31 @@ const targets = [ cpu: "x86_64_v3", }, ] -const configs = targets.flatMap(({ name, oboe, target, cpu, glibc }) => { - fs.copyFileSync(`oboe/${oboe}`, `npm/${name}/liboboe.so`) - // only build serverless api for serverless - const oboeSources = name.includes("serverless") - ? [ - "src/oboe/oboe.serverless.cc", - "src/oboe/oboe_api.cc", - "oboe/include/oboe_api.cpp", - ] - : [ - "src/oboe/oboe.cc", - "src/oboe/config.cc", - "src/oboe/context.cc", - "src/oboe/custom_metrics.cc", - "src/oboe/event.cc", - "src/oboe/metadata.cc", - "src/oboe/metric_tags.cc", - "src/oboe/reporter.cc", - "src/oboe/span.cc", - "oboe/include/oboe_api.cpp", - ] - // optimize for size for serverless - const oboeMode = name.includes("serverless") ? "small" : "fast" +const configs = targets.map(({ name, oboe, target, cpu, glibc }) => { + fs.copyFileSync(`oboe/${oboe}`, `npm/${name}/liboboe.so`) - const oboeConfig = { + const config = { target, cpu, glibc, output: `npm/${name}/oboe.node`, type: "shared", - mode: oboeMode, + mode: "fast", - sources: oboeSources, - napiVersion: 8, + sources: [ + "src/oboe/oboe.cc", + "src/oboe/config.cc", + "src/oboe/context.cc", + "src/oboe/custom_metrics.cc", + "src/oboe/event.cc", + "src/oboe/metadata.cc", + "src/oboe/metric_tags.cc", + "src/oboe/reporter.cc", + "src/oboe/span.cc", + "oboe/include/oboe_api.cpp", + ], + napiVersion: 9, std: "c++17", exceptions: true, @@ -104,29 +80,7 @@ const configs = targets.flatMap(({ name, oboe, target, cpu, glibc }) => { rpath: "$ORIGIN", } - - const metricsConfig = { - target, - cpu, - glibc, - output: `npm/${name}/metrics.node`, - type: "shared", - - sources: ["src/metrics/metrics.cc"], - napiVersion: 8, - std: "c++17", - exceptions: true, - - cflags: ["-Wall", "-Wextra", "-Werror"], - } - - // don't build metrics for serverless - return name.includes("serverless") - ? [[`${name}:oboe`, oboeConfig]] - : [ - [`${name}:oboe`, oboeConfig], - [`${name}:metrics`, metricsConfig], - ] + return [name, config] }) build(Object.fromEntries(configs), __dirname, true) diff --git a/packages/bindings/eslint.config.js b/packages/bindings/eslint.config.js index 96eb58f0..7f47cc16 100644 --- a/packages/bindings/eslint.config.js +++ b/packages/bindings/eslint.config.js @@ -16,4 +16,4 @@ limitations under the License. const base = require("@solarwinds-apm/eslint-config") -module.exports = [...base({ allowDefaultProject: [] })] +module.exports = base({ allowDefaultProject: [] }) diff --git a/packages/bindings/index.js b/packages/bindings/index.js index 1e9f9daf..fa9c2a80 100644 --- a/packages/bindings/index.js +++ b/packages/bindings/index.js @@ -14,8 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -const { IS_SERVERLESS } = require("@solarwinds-apm/module") - function triple() { const platform = process.platform const arch = process.arch @@ -29,25 +27,10 @@ function triple() { return `${platform}-${arch}` } } - -function serverless() { - if (IS_SERVERLESS) { - return "-serverless" - } else { - return "" - } -} - -const t = `${triple()}${serverless()}` +const t = triple() try { module.exports.oboe = require(`@solarwinds-apm/bindings-${t}/oboe.node`) } catch (cause) { module.exports.oboe = new Error(`unsupported platform ${t}`, { cause }) } - -try { - module.exports.metrics = require(`@solarwinds-apm/bindings-${t}/metrics.node`) -} catch (cause) { - module.exports.metrics = new Error(`unsupported platform ${t}`, { cause }) -} diff --git a/packages/bindings/npm/linux-arm64-gnu-serverless/package.json b/packages/bindings/npm/linux-arm64-gnu-serverless/package.json deleted file mode 100644 index 13d9286d..00000000 --- a/packages/bindings/npm/linux-arm64-gnu-serverless/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "@solarwinds-apm/bindings-linux-arm64-gnu-serverless", - "version": "1.0.2", - "license": "Apache-2.0", - "repository": { - "type": "git", - "url": "git+https://github.com/solarwinds/apm-js.git", - "directory": "packages/bindings/npm/linux-arm64-gnu-serverless" - }, - "scripts": { - "release": "node ../../../../scripts/publish.js" - }, - "os": [ - "linux" - ], - "cpu": [ - "arm64" - ], - "libc": [ - "glibc" - ], - "files": [ - "oboe.node", - "liboboe.so" - ], - "publishConfig": { - "access": "public", - "provenance": true - }, - "engines": { - "node": ">=16.13.0" - } -} diff --git a/packages/bindings/npm/linux-arm64-gnu/package.json b/packages/bindings/npm/linux-arm64-gnu/package.json index fd808076..339b0aec 100644 --- a/packages/bindings/npm/linux-arm64-gnu/package.json +++ b/packages/bindings/npm/linux-arm64-gnu/package.json @@ -21,7 +21,6 @@ ], "files": [ "oboe.node", - "metrics.node", "liboboe.so" ], "publishConfig": { @@ -29,6 +28,6 @@ "provenance": true }, "engines": { - "node": ">=16.13.0" + "node": "^18.19.0 || ^20.8.0 || >=22.0.0" } } diff --git a/packages/bindings/npm/linux-arm64-musl/package.json b/packages/bindings/npm/linux-arm64-musl/package.json index 4c35f805..c6659955 100644 --- a/packages/bindings/npm/linux-arm64-musl/package.json +++ b/packages/bindings/npm/linux-arm64-musl/package.json @@ -21,7 +21,6 @@ ], "files": [ "oboe.node", - "metrics.node", "liboboe.so" ], "publishConfig": { @@ -29,6 +28,6 @@ "provenance": true }, "engines": { - "node": ">=16.13.0" + "node": "^18.19.0 || ^20.8.0 || >=22.0.0" } } diff --git a/packages/bindings/npm/linux-x64-gnu-serverless/package.json b/packages/bindings/npm/linux-x64-gnu-serverless/package.json deleted file mode 100644 index 9c340061..00000000 --- a/packages/bindings/npm/linux-x64-gnu-serverless/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "@solarwinds-apm/bindings-linux-x64-gnu-serverless", - "version": "1.0.2", - "license": "Apache-2.0", - "repository": { - "type": "git", - "url": "git+https://github.com/solarwinds/apm-js.git", - "directory": "packages/bindings/npm/linux-x64-gnu-serverless" - }, - "scripts": { - "release": "node ../../../../scripts/publish.js" - }, - "os": [ - "linux" - ], - "cpu": [ - "x64" - ], - "libc": [ - "glibc" - ], - "files": [ - "oboe.node", - "liboboe.so" - ], - "publishConfig": { - "access": "public", - "provenance": true - }, - "engines": { - "node": ">=16.13.0" - } -} diff --git a/packages/bindings/npm/linux-x64-gnu/package.json b/packages/bindings/npm/linux-x64-gnu/package.json index a945518b..197c44a1 100644 --- a/packages/bindings/npm/linux-x64-gnu/package.json +++ b/packages/bindings/npm/linux-x64-gnu/package.json @@ -21,7 +21,6 @@ ], "files": [ "oboe.node", - "metrics.node", "liboboe.so" ], "publishConfig": { @@ -29,6 +28,6 @@ "provenance": true }, "engines": { - "node": ">=16.13.0" + "node": "^18.19.0 || ^20.8.0 || >=22.0.0" } } diff --git a/packages/bindings/npm/linux-x64-musl/package.json b/packages/bindings/npm/linux-x64-musl/package.json index 3729d3fc..4ae2c40e 100644 --- a/packages/bindings/npm/linux-x64-musl/package.json +++ b/packages/bindings/npm/linux-x64-musl/package.json @@ -21,7 +21,6 @@ ], "files": [ "oboe.node", - "metrics.node", "liboboe.so" ], "publishConfig": { @@ -29,6 +28,6 @@ "provenance": true }, "engines": { - "node": ">=16.13.0" + "node": "^18.19.0 || ^20.8.0 || >=22.0.0" } } diff --git a/packages/bindings/package.json b/packages/bindings/package.json index 46d4aef1..49dd12e6 100644 --- a/packages/bindings/package.json +++ b/packages/bindings/package.json @@ -38,21 +38,16 @@ "test": "swtest", "oboe": "node oboe.js" }, - "dependencies": { - "@solarwinds-apm/module": "workspace:^" - }, "optionalDependencies": { "@solarwinds-apm/bindings-linux-arm64-gnu": "workspace:*", - "@solarwinds-apm/bindings-linux-arm64-gnu-serverless": "workspace:*", "@solarwinds-apm/bindings-linux-arm64-musl": "workspace:*", "@solarwinds-apm/bindings-linux-x64-gnu": "workspace:*", - "@solarwinds-apm/bindings-linux-x64-gnu-serverless": "workspace:*", "@solarwinds-apm/bindings-linux-x64-musl": "workspace:*" }, "devDependencies": { "@solarwinds-apm/eslint-config": "workspace:^", "@solarwinds-apm/test": "workspace:^", - "@types/node": "^16.13.0", + "@types/node": "^18.19.0", "eslint": "^9.9.1", "node-addon-api": "^8.1.0", "prettier": "^3.3.3", @@ -60,6 +55,6 @@ "zig-build": "^0.3.0" }, "engines": { - "node": ">=16.13.0" + "node": "^18.19.0 || ^20.8.0 || >=22.0.0" } } diff --git a/packages/bindings/src/metrics/event_loop.hh b/packages/bindings/src/metrics/event_loop.hh deleted file mode 100644 index 6c93803e..00000000 --- a/packages/bindings/src/metrics/event_loop.hh +++ /dev/null @@ -1,185 +0,0 @@ -#include - -#include -#include - -#include "../util.hh" - -/* -The Node.js event loop is built on top of libuv and works by registering IO operations and callbacks -for them. Each loop iteration simply polls the IO operations and executes the callback for any that -have completed. This file measures the loop latency, as in the time spent executing callbacks and -other operations between each poll. - -The measurement is done by registering prepare and check callbacks with libuv. The prepare step -happens just before polling and the check step happens just after. - -The latency is communicated to the JS side using a callback. Since the latency is measured outside -of the JS context where it's not possible to call JS functions, a thread-safe function is used which -will push the call on a queue and schedule it to be executed with all the other callbacks on the -next loop iteration. - -The overall process goes something like -- JS calls `setCallback` - - The first argument is the JS callback function which receives the latency as its argument - - The second argument is the granularity -- The `set_callback` C++ implementation of `setCallback` runs - - First it cleans up any previous state, and returns early if the first argument is null - - Otherwise it stores the callback passed to it as first argument in a thread-safe function - - It then initialises the libuv handles and `EventLoopData` and registers the libuv callbacks - `on_prepare` and `on_check` to run every loop iteration on their respective steps - - Every `granularity` iterations `on_check` will use the thread-safe function to schedule - the JS callback passed to `setCallback` earlier to be called with the latency - -For instance the following would log the latency every 10 iterations -setCallback((latency) => console.log(latency), 10) -*/ - -namespace { - -struct JsData { - uint64_t latency; -}; - -// This is the native code that is put on a queue to be executed from a JS context, from here we are -// able to create JS values and call the actual JS callback -inline void -call_js_callback(Napi::Env env, Napi::Function js_callback, std::nullopt_t*, JsData* data) { - if (env != nullptr) { - js_callback.Call({Napi::Number::New(env, data->latency)}); - } - delete data; -} - -typedef Napi::TypedThreadSafeFunction ThreadSafeFunction; - -// This is stored as attached data on the libuv handles -struct EventLoopData { - // Thread-safe function - ThreadSafeFunction js_callback_scheduler; - // Number of iterations to sum up before scheduling the callback - unsigned int granularity; - - // nanos timestamp of the previous check step - uint64_t prev_check_time; - // nanos timestamp of the prepare step - uint64_t prepare_time; - // millis timeout libuv calculated for the poll - int poll_timeout; - - // nanos latency sum - uint64_t latency_sum; - // iteration count since last callback - unsigned int iteration_count; -}; - -inline static uv_prepare_t prepare_handle{}; -inline static uv_check_t check_handle{}; -// are we currently measuring -inline static bool set{false}; - -inline void on_prepare(uv_prepare_t* handle) { - uint64_t prepare_time = uv_hrtime(); - - auto data = static_cast(handle->data); - - // store this for use in the check callback math - data->prepare_time = prepare_time; - data->poll_timeout = uv_backend_timeout(uv_default_loop()); -} - -inline void on_check(uv_check_t* handle) { - uint64_t check_time = uv_hrtime(); - - auto data = static_cast(handle->data); - // we need at least one previous iteration to calculate latency - if (data->prev_check_time == 0) { - data->prev_check_time = check_time; - return; - } - - uint64_t latency = data->prepare_time - data->prev_check_time; - - // observed polling time between our prepare and check steps - uint64_t poll_time = check_time - data->prepare_time; - // convert poll timeout to nanos - uint64_t timeout = data->poll_timeout * 1000 * 1000; - // if the observed polling time is greater than the timeout something else blocked and we add - // the difference - if (poll_time > timeout) { - latency += poll_time - timeout; - } - - data->prev_check_time = check_time; - data->latency_sum += latency; - if (data->iteration_count++ < data->granularity) { - return; - } - - // by calling this we are scheduling `call_js_callback` to be run within a JS context with the - // provided `JsData`. `call_js_callback` will in turn call the actual JS callback passed to - // `setCallback` which we can't do here outside of the JS context - data->js_callback_scheduler.BlockingCall(new JsData{data->latency_sum}); - - data->latency_sum = 0; - data->iteration_count = 0; -} - -inline Napi::Value set_callback(sw::CallbackInfo const info) { - auto arg = info.arg(0); - - // if currently enabled, stop the callbacks and clean up the data - if (set) { - auto data = static_cast(prepare_handle.data); - - uv_prepare_stop(&prepare_handle); - uv_check_stop(&check_handle); - - // need to release the thread-safe function first to decrease its reference count so it - // actually gets freed - data->js_callback_scheduler.Release(); - delete data; - } - - if (!arg.IsNull()) { - // create the thread-safe function with its reference count set to 1 - auto js_callback_scheduler = - ThreadSafeFunction::New(info, arg.As(), "Event Loop Callback", 0, 1); - // don't prevent node from exiting because of this callback - js_callback_scheduler.Unref(info); - - auto granularity = info.arg(1); - - // re.initialise the libuv handles - uv_prepare_init(uv_default_loop(), &prepare_handle); - uv_check_init(uv_default_loop(), &check_handle); - - // allocate fresh data to not have skewed measurements if the granularity changed - auto data = new EventLoopData{ - .js_callback_scheduler = std::move(js_callback_scheduler), - .granularity = granularity, - .prev_check_time = 0, - .iteration_count = 0, - }; - prepare_handle.data = data; - check_handle.data = data; - - // actually enable the libuv callbacks - uv_prepare_start(&prepare_handle, on_prepare); - uv_check_start(&check_handle, on_check); - - set = true; - } else { - set = false; - } - - return info.undefined(); -} - -} // namespace - -// module initialisation, defines the `setCallback` function -inline sw::Object event_loop(sw::Object exports) { - exports.set("setCallback", set_callback); - return exports; -} diff --git a/packages/bindings/src/metrics/metrics.cc b/packages/bindings/src/metrics/metrics.cc deleted file mode 100644 index 806d05c9..00000000 --- a/packages/bindings/src/metrics/metrics.cc +++ /dev/null @@ -1,16 +0,0 @@ -#include - -#include "event_loop.hh" - -#include "../util.hh" - -Napi::Object init(Napi::Env env_, Napi::Object exports_) { - sw::Env env{env_}; - sw::Object exports{exports_}; - - exports.set("eventLoop", event_loop(env.object())); - - return exports; -} - -NODE_API_MODULE(metrics, init) diff --git a/packages/bindings/test/oboe.test.ts b/packages/bindings/test/oboe.test.ts index 3f79a5d0..a1c17370 100644 --- a/packages/bindings/test/oboe.test.ts +++ b/packages/bindings/test/oboe.test.ts @@ -18,9 +18,11 @@ import { describe, expect, it } from "@solarwinds-apm/test" import { oboe } from ".." +const lit = process.platform === "linux" ? it : it.skip.bind(it) + describe("Metadata", () => { describe("makeRandom", () => { - it("should produce valid metadata", () => { + lit("should produce valid metadata", () => { const random = oboe.Metadata.makeRandom() expect(random.isValid()).to.be.true }) diff --git a/packages/bindings/types/index.d.ts b/packages/bindings/types/index.d.ts index b41ddc68..8f77adbe 100644 --- a/packages/bindings/types/index.d.ts +++ b/packages/bindings/types/index.d.ts @@ -14,5 +14,4 @@ See the License for the specific language governing permissions and limitations under the License. */ -export * as metrics from "./metrics" export * as oboe from "./oboe" diff --git a/packages/compat/eslint.config.js b/packages/compat/eslint.config.js index eab21fb9..0230433e 100644 --- a/packages/compat/eslint.config.js +++ b/packages/compat/eslint.config.js @@ -14,6 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -import base from "@solarwinds-apm/eslint-config" +const base = require("@solarwinds-apm/eslint-config") -export default [...base()] +module.exports = base() diff --git a/packages/compat/package.json b/packages/compat/package.json index 158df28b..531729d4 100644 --- a/packages/compat/package.json +++ b/packages/compat/package.json @@ -13,14 +13,11 @@ "bugs": { "url": "https://github.com/solarwinds/apm-js/issues" }, - "type": "module", + "type": "commonjs", "exports": { - ".": { - "import": "./dist/es/index.js", - "require": "./dist/cjs/index.js" - } + ".": "./dist/index.js" }, - "main": "./dist/cjs/index.js", + "main": "./dist/index.js", "files": [ "./src/", "./dist/" @@ -30,7 +27,7 @@ "provenance": true }, "scripts": { - "build": "rollup -c --forceExit", + "build": "tsc", "lint": "prettier --check . && eslint . --max-warnings=0", "lint:fix": "eslint --fix . && prettier --write .", "release": "node ../../scripts/publish.js", @@ -48,15 +45,13 @@ "@opentelemetry/api": "^1.3.0", "@opentelemetry/semantic-conventions": "~1.27.0", "@solarwinds-apm/eslint-config": "workspace:^", - "@solarwinds-apm/rollup-config": "workspace:^", "@solarwinds-apm/test": "workspace:^", - "@types/node": "^16.13.0", + "@types/node": "^18.19.0", "eslint": "^9.9.1", "prettier": "^3.3.3", - "rollup": "^4.3.0", "typescript": "~5.5.3" }, "engines": { - "node": ">=16.13.0" + "node": "^18.19.0 || ^20.8.0 || >=22.0.0" } } diff --git a/packages/compat/test/index.test.ts b/packages/compat/test/index.test.ts index d597789f..a806b188 100644 --- a/packages/compat/test/index.test.ts +++ b/packages/compat/test/index.test.ts @@ -16,12 +16,12 @@ limitations under the License. import { SpanStatusCode, trace } from "@opentelemetry/api" import { - SEMATTRS_EXCEPTION_MESSAGE, - SEMATTRS_EXCEPTION_STACKTRACE, + ATTR_EXCEPTION_MESSAGE, + ATTR_EXCEPTION_STACKTRACE, } from "@opentelemetry/semantic-conventions" import { describe, expect, it, otel } from "@solarwinds-apm/test" -import { instrument, pInstrument } from "../src/index.js" +import { instrument, pInstrument } from "../src/index" function inParent(f: () => void | Promise) { return trace.getTracer("test").startActiveSpan("parent", async (span) => { @@ -94,10 +94,10 @@ describe("instrument", () => { message: "error", }) expect(span?.events[0]!.attributes).to.include({ - [SEMATTRS_EXCEPTION_MESSAGE]: "error", + [ATTR_EXCEPTION_MESSAGE]: "error", }) expect(span?.events[0]!.attributes).to.have.property( - SEMATTRS_EXCEPTION_STACKTRACE, + ATTR_EXCEPTION_STACKTRACE, ) }) @@ -142,10 +142,10 @@ describe("instrument", () => { message: "error", }) expect(span?.events[0]!.attributes).to.include({ - [SEMATTRS_EXCEPTION_MESSAGE]: "error", + [ATTR_EXCEPTION_MESSAGE]: "error", }) expect(span?.events[0]!.attributes).to.have.property( - SEMATTRS_EXCEPTION_STACKTRACE, + ATTR_EXCEPTION_STACKTRACE, ) }) @@ -237,10 +237,10 @@ describe("pInstrument", () => { message: "error", }) expect(span?.events[0]!.attributes).to.include({ - [SEMATTRS_EXCEPTION_MESSAGE]: "error", + [ATTR_EXCEPTION_MESSAGE]: "error", }) expect(span?.events[0]!.attributes).to.have.property( - SEMATTRS_EXCEPTION_STACKTRACE, + ATTR_EXCEPTION_STACKTRACE, ) }) }) diff --git a/packages/compat/tsconfig.json b/packages/compat/tsconfig.json index 6f1eaa08..8b8973e7 100644 --- a/packages/compat/tsconfig.json +++ b/packages/compat/tsconfig.json @@ -4,6 +4,5 @@ "compilerOptions": { "rootDir": "./src", "outDir": "./dist" - }, - "references": [{ "path": ".." }] + } } diff --git a/packages/dependencies/eslint.config.js b/packages/dependencies/eslint.config.js index eab21fb9..2be7940d 100644 --- a/packages/dependencies/eslint.config.js +++ b/packages/dependencies/eslint.config.js @@ -16,4 +16,4 @@ limitations under the License. import base from "@solarwinds-apm/eslint-config" -export default [...base()] +export default base() diff --git a/packages/dependencies/package.json b/packages/dependencies/package.json index e92be87a..6308f103 100644 --- a/packages/dependencies/package.json +++ b/packages/dependencies/package.json @@ -16,11 +16,9 @@ "type": "module", "exports": { ".": { - "import": "./dist/es/index.js", - "require": "./dist/cjs/index.js" + "import": "./dist/index.js" } }, - "main": "./dist/cjs/index.js", "files": [ "./src/", "./dist/" @@ -30,7 +28,7 @@ "provenance": true }, "scripts": { - "build": "rollup -c --forceExit", + "build": "tsc", "lint": "prettier --check . && eslint . --max-warnings=0", "lint:fix": "eslint --fix . && prettier --write .", "release": "node ../../scripts/publish.js", @@ -41,15 +39,13 @@ }, "devDependencies": { "@solarwinds-apm/eslint-config": "workspace:^", - "@solarwinds-apm/rollup-config": "workspace:^", "@solarwinds-apm/test": "workspace:^", - "@types/node": "^16.13.0", + "@types/node": "^18.19.0", "eslint": "^9.9.1", "prettier": "^3.3.3", - "rollup": "^4.3.0", "typescript": "~5.5.3" }, "engines": { - "node": ">=16.13.0" + "node": "^18.19.0 || ^20.8.0 || >=22.0.0" } } diff --git a/packages/dependencies/rollup.config.js b/packages/dependencies/rollup.config.js deleted file mode 100644 index fb0d311b..00000000 --- a/packages/dependencies/rollup.config.js +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import config from "@solarwinds-apm/rollup-config" - -export default config() diff --git a/packages/dependencies/src/node-modules.ts b/packages/dependencies/src/node-modules.ts index f8d7c226..f80aef3e 100644 --- a/packages/dependencies/src/node-modules.ts +++ b/packages/dependencies/src/node-modules.ts @@ -18,15 +18,13 @@ import { type Dirent, promises as fs } from "node:fs" import { createRequire } from "node:module" import * as path from "node:path" -import { callsite } from "@solarwinds-apm/module" - import { type Dependencies, type Package } from "./index.js" export function collectNodeModulesDependencies(dependencies: Dependencies) { // node_modules is not a real package we just want all the paths looked up by // package resolution const roots = - createRequire(callsite().getFileName()!).resolve.paths("node_modules") ?? [] + createRequire(import.meta.url).resolve.paths("node_modules") ?? [] const tasks = roots.map((root) => collectRoot(dependencies, root)) return Promise.all(tasks) } diff --git a/packages/dependencies/tsconfig.json b/packages/dependencies/tsconfig.json index 6f1eaa08..8b8973e7 100644 --- a/packages/dependencies/tsconfig.json +++ b/packages/dependencies/tsconfig.json @@ -4,6 +4,5 @@ "compilerOptions": { "rootDir": "./src", "outDir": "./dist" - }, - "references": [{ "path": ".." }] + } } diff --git a/packages/eslint-config/eslint.config.js b/packages/eslint-config/eslint.config.js index 2953917d..aba0cebe 100644 --- a/packages/eslint-config/eslint.config.js +++ b/packages/eslint-config/eslint.config.js @@ -16,4 +16,4 @@ limitations under the License. const base = require(".") -module.exports = [...base()] +module.exports = base() diff --git a/packages/histogram/eslint.config.js b/packages/histogram/eslint.config.js index eab21fb9..2be7940d 100644 --- a/packages/histogram/eslint.config.js +++ b/packages/histogram/eslint.config.js @@ -16,4 +16,4 @@ limitations under the License. import base from "@solarwinds-apm/eslint-config" -export default [...base()] +export default base() diff --git a/packages/histogram/package.json b/packages/histogram/package.json index 4341a279..0b69a87d 100644 --- a/packages/histogram/package.json +++ b/packages/histogram/package.json @@ -16,11 +16,9 @@ "type": "module", "exports": { ".": { - "import": "./dist/es/index.js", - "require": "./dist/cjs/index.js" + "import": "./dist/index.js" } }, - "main": "./dist/cjs/index.js", "files": [ "./src/", "./dist/" @@ -30,7 +28,7 @@ "provenance": true }, "scripts": { - "build": "rollup -c --forceExit", + "build": "tsc", "lint": "prettier --check . && eslint . --max-warnings=0", "lint:fix": "eslint --fix . && prettier --write .", "release": "node ../../scripts/publish.js" @@ -39,14 +37,12 @@ "@opentelemetry/api": "^1.3.0", "@opentelemetry/sdk-metrics": "~1.26.0", "@solarwinds-apm/eslint-config": "workspace:^", - "@solarwinds-apm/rollup-config": "workspace:^", - "@types/node": "^16.13.0", + "@types/node": "^18.19.0", "eslint": "^9.9.1", "prettier": "^3.3.3", - "rollup": "^4.3.0", "typescript": "~5.5.3" }, "engines": { - "node": ">=16.13.0" + "node": "^18.19.0 || ^20.8.0 || >=22.0.0" } } diff --git a/packages/histogram/rollup.config.js b/packages/histogram/rollup.config.js deleted file mode 100644 index fb0d311b..00000000 --- a/packages/histogram/rollup.config.js +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import config from "@solarwinds-apm/rollup-config" - -export default config() diff --git a/packages/histogram/tsconfig.json b/packages/histogram/tsconfig.json index 6f1eaa08..8b8973e7 100644 --- a/packages/histogram/tsconfig.json +++ b/packages/histogram/tsconfig.json @@ -4,6 +4,5 @@ "compilerOptions": { "rootDir": "./src", "outDir": "./dist" - }, - "references": [{ "path": ".." }] + } } diff --git a/packages/instrumentations/eslint.config.js b/packages/instrumentations/eslint.config.js index eab21fb9..2be7940d 100644 --- a/packages/instrumentations/eslint.config.js +++ b/packages/instrumentations/eslint.config.js @@ -16,4 +16,4 @@ limitations under the License. import base from "@solarwinds-apm/eslint-config" -export default [...base()] +export default base() diff --git a/packages/instrumentations/package.json b/packages/instrumentations/package.json index 97d29a80..f434eff3 100644 --- a/packages/instrumentations/package.json +++ b/packages/instrumentations/package.json @@ -16,11 +16,9 @@ "type": "module", "exports": { ".": { - "import": "./dist/es/index.js", - "require": "./dist/cjs/index.js" + "import": "./dist/index.js" } }, - "main": "./dist/cjs/index.js", "files": [ "./src/", "./dist/" @@ -30,7 +28,7 @@ "provenance": true }, "scripts": { - "build": "rollup -c --forceExit && node ./dist/es/compatibility.es.js", + "build": "tsc && node ./dist/compatibility.js", "lint": "prettier --check . && eslint . --max-warnings=0", "lint:fix": "eslint --fix . && prettier --write .", "release": "node ../../scripts/publish.js" @@ -94,15 +92,13 @@ "devDependencies": { "@opentelemetry/api": "^1.3.0", "@solarwinds-apm/eslint-config": "workspace:^", - "@solarwinds-apm/rollup-config": "workspace:^", "@types/semver": "^7.5.3", "eslint": "^9.9.1", "prettier": "^3.3.3", - "rollup": "^4.3.0", "semver": "^7.5.4", "typescript": "~5.5.3" }, "engines": { - "node": ">=16.13.0" + "node": "^18.19.0 || ^20.8.0 || >=22.0.0" } } diff --git a/packages/instrumentations/rollup.config.js b/packages/instrumentations/rollup.config.js deleted file mode 100644 index fb0d311b..00000000 --- a/packages/instrumentations/rollup.config.js +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import config from "@solarwinds-apm/rollup-config" - -export default config() diff --git a/packages/instrumentations/src/compatibility.es.ts b/packages/instrumentations/src/compatibility.ts similarity index 100% rename from packages/instrumentations/src/compatibility.es.ts rename to packages/instrumentations/src/compatibility.ts diff --git a/packages/instrumentations/src/index.ts b/packages/instrumentations/src/index.ts index 26b8d23d..27552122 100644 --- a/packages/instrumentations/src/index.ts +++ b/packages/instrumentations/src/index.ts @@ -62,7 +62,7 @@ import { type DetectorSync, Resource, } from "@opentelemetry/resources" -import { load } from "@solarwinds-apm/module/load" +import { load } from "@solarwinds-apm/module" // map of package names to their instrumentation type interface InstrumentationTypes { diff --git a/packages/instrumentations/tsconfig.json b/packages/instrumentations/tsconfig.json index 6f1eaa08..8b8973e7 100644 --- a/packages/instrumentations/tsconfig.json +++ b/packages/instrumentations/tsconfig.json @@ -4,6 +4,5 @@ "compilerOptions": { "rootDir": "./src", "outDir": "./dist" - }, - "references": [{ "path": ".." }] + } } diff --git a/packages/lazy/.gitignore b/packages/lazy/.gitignore deleted file mode 100644 index 849ddff3..00000000 --- a/packages/lazy/.gitignore +++ /dev/null @@ -1 +0,0 @@ -dist/ diff --git a/packages/lazy/README.md b/packages/lazy/README.md deleted file mode 100644 index 3ccbc5bf..00000000 --- a/packages/lazy/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# @solarwinds-apm/lazy - -This package exports a single `lazy` function which takes a closure and returns a proxy object lazily initialisated with the value returned by the closure on first use. diff --git a/packages/lazy/eslint.config.js b/packages/lazy/eslint.config.js deleted file mode 100644 index eab21fb9..00000000 --- a/packages/lazy/eslint.config.js +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import base from "@solarwinds-apm/eslint-config" - -export default [...base()] diff --git a/packages/lazy/package.json b/packages/lazy/package.json deleted file mode 100644 index 86ccd511..00000000 --- a/packages/lazy/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "@solarwinds-apm/lazy", - "version": "1.0.2", - "license": "Apache-2.0", - "contributors": [ - "Raphaël Thériault " - ], - "repository": { - "type": "git", - "url": "git+https://github.com/solarwinds/apm-js.git", - "directory": "packages/lazy" - }, - "bugs": { - "url": "https://github.com/solarwinds/apm-js/issues" - }, - "type": "module", - "exports": { - ".": { - "import": "./dist/es/index.js", - "require": "./dist/cjs/index.js" - } - }, - "main": "./dist/cjs/index.js", - "files": [ - "./src/", - "./dist/" - ], - "publishConfig": { - "access": "public", - "provenance": true - }, - "scripts": { - "build": "rollup -c --forceExit", - "lint": "prettier --check . && eslint . --max-warnings=0", - "lint:fix": "eslint --fix . && prettier --write .", - "release": "node ../../scripts/publish.js" - }, - "devDependencies": { - "@solarwinds-apm/eslint-config": "workspace:^", - "@solarwinds-apm/rollup-config": "workspace:^", - "eslint": "^9.9.1", - "prettier": "^3.3.3", - "rollup": "^4.3.0", - "typescript": "~5.5.3" - }, - "engines": { - "node": ">=16.13.0" - } -} diff --git a/packages/lazy/rollup.config.js b/packages/lazy/rollup.config.js deleted file mode 100644 index fb0d311b..00000000 --- a/packages/lazy/rollup.config.js +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import config from "@solarwinds-apm/rollup-config" - -export default config() diff --git a/packages/lazy/src/index.ts b/packages/lazy/src/index.ts deleted file mode 100644 index d79d2dd3..00000000 --- a/packages/lazy/src/index.ts +++ /dev/null @@ -1,102 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -const valueKey = Symbol("value") -const initKey = Symbol("init") - -/** - * Creates a lazy proxy object that will initialize the proxied object using - * the provided function on first access. - * - * @param init - Initialization function - * @returns Lazy proxy object - */ -export function lazy(init: () => T): T { - const inner = { - [valueKey]: undefined as T | undefined, - [initKey]: init, - } - - return new Proxy(inner, { - apply: (target, thisArg, args) => - Reflect.apply( - (target[valueKey] ??= target[initKey]()) as T & - ((..._: typeof args) => unknown), - thisArg, - args, - ), - construct: (target, args, newTarget) => - Reflect.construct( - (target[valueKey] ??= target[initKey]()) as T & - (new (..._: typeof args) => unknown), - args, - newTarget, - ) as object, - defineProperty: (target, property, descriptor) => - Reflect.defineProperty( - (target[valueKey] ??= target[initKey]()) as T & object, - property, - descriptor, - ), - deleteProperty: (target, property) => - Reflect.deleteProperty( - (target[valueKey] ??= target[initKey]()) as T & object, - property, - ), - get: (target, property, receiver) => - Reflect.get( - (target[valueKey] ??= target[initKey]()) as T & object, - property, - receiver, - ), - getOwnPropertyDescriptor: (target, property) => - Reflect.getOwnPropertyDescriptor( - (target[valueKey] ??= target[initKey]()) as T & object, - property, - ), - getPrototypeOf: (target) => - Reflect.getPrototypeOf( - (target[valueKey] ??= target[initKey]()) as T & object, - ), - has: (target, property) => - Reflect.has( - (target[valueKey] ??= target[initKey]()) as T & object, - property, - ), - isExtensible: (target) => - Reflect.isExtensible( - (target[valueKey] ??= target[initKey]()) as T & object, - ), - ownKeys: (target) => - Reflect.ownKeys((target[valueKey] ??= target[initKey]()) as T & object), - preventExtensions: (target) => - Reflect.preventExtensions( - (target[valueKey] ??= target[initKey]()) as T & object, - ), - set: (target, property, value, receiver) => - Reflect.set( - (target[valueKey] ??= target[initKey]()) as T & object, - property, - value, - receiver, - ), - setPrototypeOf: (target, prototype) => - Reflect.setPrototypeOf( - (target[valueKey] ??= target[initKey]()) as T & object, - prototype, - ), - }) as T -} diff --git a/packages/lazy/tsconfig.json b/packages/lazy/tsconfig.json deleted file mode 100644 index 6f1eaa08..00000000 --- a/packages/lazy/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "include": ["./src"], - "compilerOptions": { - "rootDir": "./src", - "outDir": "./dist" - }, - "references": [{ "path": ".." }] -} diff --git a/packages/module/eslint.config.js b/packages/module/eslint.config.js index eab21fb9..0230433e 100644 --- a/packages/module/eslint.config.js +++ b/packages/module/eslint.config.js @@ -14,6 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -import base from "@solarwinds-apm/eslint-config" +const base = require("@solarwinds-apm/eslint-config") -export default [...base()] +module.exports = base() diff --git a/packages/module/package.json b/packages/module/package.json index 33592938..ccfe5b87 100644 --- a/packages/module/package.json +++ b/packages/module/package.json @@ -13,18 +13,12 @@ "bugs": { "url": "https://github.com/solarwinds/apm-js/issues" }, - "type": "module", + "type": "commonjs", "exports": { ".": { - "import": "./dist/es/index.js", - "require": "./dist/cjs/index.js" - }, - "./load": { - "import": "./dist/es/load.es.js", - "require": "./dist/cjs/load.cjs.js" + "import": "./dist/index.js" } }, - "main": "./dist/cjs/index.js", "files": [ "./src/", "./dist/" @@ -34,21 +28,19 @@ "provenance": true }, "scripts": { - "build": "rollup -c --forceExit", + "build": "tsc", "lint": "prettier --check . && eslint . --max-warnings=0", "lint:fix": "eslint --fix . && prettier --write .", "release": "node ../../scripts/publish.js" }, "devDependencies": { "@solarwinds-apm/eslint-config": "workspace:^", - "@solarwinds-apm/rollup-config": "workspace:^", - "@types/node": "^16.13.0", + "@types/node": "^18.19.0", "eslint": "^9.9.1", "prettier": "^3.3.3", - "rollup": "^4.3.0", "typescript": "~5.5.3" }, "engines": { - "node": ">=16.13.0" + "node": "^18.19.0 || ^20.8.0 || >=22.0.0" } } diff --git a/packages/module/rollup.config.js b/packages/module/rollup.config.js deleted file mode 100644 index fb0d311b..00000000 --- a/packages/module/rollup.config.js +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import config from "@solarwinds-apm/rollup-config" - -export default config() diff --git a/packages/module/src/index.ts b/packages/module/src/index.ts index fb685ff8..600773f8 100644 --- a/packages/module/src/index.ts +++ b/packages/module/src/index.ts @@ -16,26 +16,18 @@ limitations under the License. import { env } from "node:process" -/** - * Finds the current call site. Useful to replace `import.meta.url` or `__dirname`, - * or to get more than just a file name. - * - * @returns The {@link NodeJS.CallSite} this function was called from - */ -export function callsite(): NodeJS.CallSite { - const prepareStackTrace = Error.prepareStackTrace - try { - const callsites: NodeJS.CallSite[] = [] - Error.prepareStackTrace = (_err, cs) => { - callsites.push(...cs) - } - void new Error().stack - - const current = callsites[0]! - return callsites.find((cs) => cs.getFileName() !== current.getFileName())! - } finally { - Error.prepareStackTrace = prepareStackTrace - } +export async function load(file: string): Promise { + const imported = (await import(file)) as object + + const hasDefault = "default" in imported + const keyCount = Object.keys(imported).length + + const useDefaultExport = + hasDefault && + (keyCount === 1 || (keyCount === 2 && "__esModule" in imported)) + + if (useDefaultExport) return imported.default + else return imported } export const IS_AWS_LAMBDA = "AWS_LAMBDA_FUNCTION_NAME" in env diff --git a/packages/module/src/load.cjs.ts b/packages/module/src/load.cjs.ts deleted file mode 100644 index c8218516..00000000 --- a/packages/module/src/load.cjs.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -export function load(file: string): unknown { - /* eslint-disable-next-line @typescript-eslint/no-require-imports */ - const required: unknown = require(file) - - const isObject = typeof required === "object" && required !== null - const hasDefault = isObject && "default" in required - const keyCount = isObject && Object.keys(required).length - - const useDefaultExport = - hasDefault && - (keyCount === 1 || (keyCount === 2 && "__esModule" in required)) - - if (useDefaultExport) return required.default - else return required -} diff --git a/packages/module/src/load.es.ts b/packages/module/src/load.es.ts deleted file mode 100644 index 9301e562..00000000 --- a/packages/module/src/load.es.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -export async function load(file: string): Promise { - const imported = (await import(file)) as object - - const hasDefault = "default" in imported - const keyCount = Object.keys(imported).length - - const useDefaultExport = - hasDefault && - (keyCount === 1 || (keyCount === 2 && "__esModule" in imported)) - - if (useDefaultExport) return imported.default - else return imported -} diff --git a/packages/module/tsconfig.json b/packages/module/tsconfig.json index 6f1eaa08..8b8973e7 100644 --- a/packages/module/tsconfig.json +++ b/packages/module/tsconfig.json @@ -4,6 +4,5 @@ "compilerOptions": { "rootDir": "./src", "outDir": "./dist" - }, - "references": [{ "path": ".." }] + } } diff --git a/packages/proto/build.js b/packages/proto/build.js index e9c74f0c..3d877fcd 100644 --- a/packages/proto/build.js +++ b/packages/proto/build.js @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { mkdir, writeFile } from "node:fs/promises" +import { mkdir } from "node:fs/promises" import { promisify } from "node:util" import { main as pbjsMain } from "protobufjs-cli/pbjs.js" @@ -23,40 +23,23 @@ import { main as pbtsMain } from "protobufjs-cli/pbts.js" const pbjs = promisify(pbjsMain) const pbts = promisify(pbtsMain) -const targets = { - es: { - wrapper: "./es.wrapper", - dependency: "protobufjs/minimal.js", - }, - cjs: { - wrapper: "./cjs.wrapper", - dependency: "protobufjs/minimal", - }, -} - -for (const [target, options] of Object.entries(targets)) { - await mkdir(`dist/${target}`, { recursive: true }) - - const type = target === "es" ? "module" : "commonjs" - await writeFile(`dist/${target}/package.json`, JSON.stringify({ type })) - - await pbjs([ - "-t", - "static-module", - "-w", - options.wrapper, - "--dependency", - options.dependency, - "-o", - `./dist/${target}/index.js`, - "--es6", - "--force-number", - "--no-create", - "--no-verify", - "--no-convert", - "--no-delimited", - "--no-service", - "src/collector.proto", - ]) - await pbts(["-o", `./dist/${target}/index.d.ts`, `dist/${target}/index.js`]) -} +await mkdir(`dist`, { recursive: true }) +await pbjs([ + "-t", + "static-module", + "-w", + "./wrapper", + "--dependency", + "protobufjs/minimal.js", + "-o", + `./dist/index.js`, + "--es6", + "--force-number", + "--no-create", + "--no-verify", + "--no-convert", + "--no-delimited", + "--no-service", + "src/collector.proto", +]) +await pbts(["-o", `./dist/index.d.ts`, `dist/index.js`]) diff --git a/packages/proto/cjs.wrapper b/packages/proto/cjs.wrapper deleted file mode 100644 index 9bcca07b..00000000 --- a/packages/proto/cjs.wrapper +++ /dev/null @@ -1,10 +0,0 @@ -// https://github.com/protobufjs/protobuf.js/issues/1109 - -const $protobuf = require($DEPENDENCY); - -$protobuf.util.Long = undefined; -$protobuf.configure(); - -$OUTPUT; - -module.exports = $root; diff --git a/packages/proto/eslint.config.js b/packages/proto/eslint.config.js index eab21fb9..2be7940d 100644 --- a/packages/proto/eslint.config.js +++ b/packages/proto/eslint.config.js @@ -16,4 +16,4 @@ limitations under the License. import base from "@solarwinds-apm/eslint-config" -export default [...base()] +export default base() diff --git a/packages/proto/package.json b/packages/proto/package.json index 7c6ac82e..852a1daa 100644 --- a/packages/proto/package.json +++ b/packages/proto/package.json @@ -16,11 +16,9 @@ "type": "module", "exports": { ".": { - "import": "./dist/es/index.js", - "require": "./dist/cjs/index.js" + "import": "./dist/index.js" } }, - "main": "./dist/cjs/index.js", "files": [ "./src/collector.proto", "./dist/" @@ -46,6 +44,6 @@ "typescript": "~5.5.3" }, "engines": { - "node": ">=16.13.0" + "node": "^18.19.0 || ^20.8.0 || >=22.0.0" } } diff --git a/packages/proto/es.wrapper b/packages/proto/wrapper similarity index 100% rename from packages/proto/es.wrapper rename to packages/proto/wrapper diff --git a/packages/rollup-config/README.md b/packages/rollup-config/README.md deleted file mode 100644 index 97e0922f..00000000 --- a/packages/rollup-config/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# @solarwinds-apm/rollup-config - -This package exports the Rollup configuration used by the rest of the packages in this repository. diff --git a/packages/rollup-config/eslint.config.js b/packages/rollup-config/eslint.config.js deleted file mode 100644 index eab21fb9..00000000 --- a/packages/rollup-config/eslint.config.js +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import base from "@solarwinds-apm/eslint-config" - -export default [...base()] diff --git a/packages/rollup-config/index.js b/packages/rollup-config/index.js deleted file mode 100644 index 11c0e486..00000000 --- a/packages/rollup-config/index.js +++ /dev/null @@ -1,92 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import fs from "node:fs/promises" -import path from "node:path" -import process from "node:process" - -import json from "@rollup/plugin-json" -import typescript from "@rollup/plugin-typescript" -import globby from "globby" -import nodeExternals from "rollup-plugin-node-externals" - -const FORMATS = ["es", "cjs"] - -async function task(src, dist, format, sources) { - const dir = path.join(dist, format) - - if (format === "cjs") { - await fs.mkdir(dir, { recursive: true }) - await fs.writeFile( - path.join(dir, "package.json"), - JSON.stringify({ type: "commonjs" }), - ) - } - - const input = Object.fromEntries( - sources - .map((file) => { - // file name without directory or extension - const name = path - .relative(src, file) - .slice(0, -path.extname(file).length) - // full file path - const full = path.join(process.cwd(), file) - - return [name, full] - }) - .filter(([name]) => { - // detect `.es`/`.cjs` and filter out if it doesn't match the current format - const specifier = FORMATS.find((format) => name.endsWith(`.${format}`)) - return specifier ? specifier === format : true - }), - ) - - const output = { - format, - dir, - sourcemap: true, - } - - return { - plugins: [ - nodeExternals({ deps: true, peerDeps: true, devDeps: true }), - typescript({ - outputToFilesystem: true, - cacheDir: path.join("node_modules", ".cache", "rollup", format), - - compilerOptions: { - rootDir: src, - outDir: dir, - // following required cause the plugin overrides tsconfig.json for some reason - // https://github.com/rollup/plugins/issues/1583 - module: "node16", - moduleResolution: "node16", - }, - }), - json({ preferConst: true }), - ], - input, - output, - } -} - -export default async function config(src = "src", dist = "dist") { - const sources = await globby(`${src}/**/*.{ts,js}`) - return await Promise.all( - FORMATS.map((format) => task(src, dist, format, sources)), - ) -} diff --git a/packages/rollup-config/package.json b/packages/rollup-config/package.json deleted file mode 100644 index 245acca2..00000000 --- a/packages/rollup-config/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "@solarwinds-apm/rollup-config", - "version": "1.0.2", - "license": "Apache-2.0", - "contributors": [ - "Raphaël Thériault " - ], - "repository": { - "type": "git", - "url": "git+https://github.com/solarwinds/apm-js.git", - "directory": "packages/rollup-config" - }, - "bugs": { - "url": "https://github.com/solarwinds/apm-js/issues" - }, - "type": "module", - "exports": { - ".": "./index.js" - }, - "main": "./index.js", - "files": [ - "./index.js" - ], - "publishConfig": { - "access": "public", - "provenance": true - }, - "scripts": { - "lint": "prettier --check . && eslint . --max-warnings=0", - "lint:fix": "eslint --fix . && prettier --write .", - "release": "node ../../scripts/publish.js" - }, - "dependencies": { - "@rollup/plugin-json": "^6.0.1", - "@rollup/plugin-typescript": "^11.1.5", - "globby": "^11.1.0", - "rollup-plugin-node-externals": "^7.0.0", - "tslib": "^2.6.2" - }, - "peerDependencies": { - "rollup": "*", - "typescript": "*" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": false - }, - "typescript": { - "optional": false - } - }, - "devDependencies": { - "@solarwinds-apm/eslint-config": "workspace:^", - "eslint": "^9.9.1", - "prettier": "^3.3.3", - "rollup": "^4.3.0", - "typescript": "~5.5.3" - } -} diff --git a/packages/sampling/eslint.config.js b/packages/sampling/eslint.config.js index eab21fb9..2be7940d 100644 --- a/packages/sampling/eslint.config.js +++ b/packages/sampling/eslint.config.js @@ -16,4 +16,4 @@ limitations under the License. import base from "@solarwinds-apm/eslint-config" -export default [...base()] +export default base() diff --git a/packages/sampling/package.json b/packages/sampling/package.json index 8b285997..3abeac7e 100644 --- a/packages/sampling/package.json +++ b/packages/sampling/package.json @@ -16,11 +16,9 @@ "type": "module", "exports": { ".": { - "import": "./dist/es/index.js", - "require": "./dist/cjs/index.js" + "import": "./dist/index.js" } }, - "main": "./dist/cjs/index.js", "files": [ "./src/", "./dist/" @@ -30,7 +28,7 @@ "provenance": true }, "scripts": { - "build": "rollup -c --forceExit", + "build": "tsc", "lint": "prettier --check . && eslint . --max-warnings=0", "lint:fix": "eslint --fix . && prettier --write .", "release": "node ../../scripts/publish.js", @@ -51,15 +49,13 @@ "@opentelemetry/api": "^1.3.0", "@opentelemetry/sdk-metrics": "~1.26.0", "@solarwinds-apm/eslint-config": "workspace:^", - "@solarwinds-apm/rollup-config": "workspace:^", "@solarwinds-apm/test": "workspace:^", - "@types/node": "^16.13.0", + "@types/node": "^18.19.0", "eslint": "^9.9.1", "prettier": "^3.3.3", - "rollup": "^4.3.0", "typescript": "~5.5.3" }, "engines": { - "node": ">=16.13.0" + "node": "^18.19.0 || ^20.8.0 || >=22.0.0" } } diff --git a/packages/sampling/rollup.config.js b/packages/sampling/rollup.config.js deleted file mode 100644 index fb0d311b..00000000 --- a/packages/sampling/rollup.config.js +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import config from "@solarwinds-apm/rollup-config" - -export default config() diff --git a/packages/sampling/src/token-bucket.ts b/packages/sampling/src/token-bucket.ts index d8dd496d..f1eff557 100644 --- a/packages/sampling/src/token-bucket.ts +++ b/packages/sampling/src/token-bucket.ts @@ -62,7 +62,7 @@ export class TokenBucket { this.#t = Math.max(0, Math.min(this.capacity, n)) } - #timer: NodeJS.Timer | undefined = undefined + #timer: NodeJS.Timeout | undefined = undefined constructor(settings: TokenBucketSettings = {}) { this.#capacity = settings.capacity ?? 0 diff --git a/packages/sampling/tsconfig.json b/packages/sampling/tsconfig.json index 6f1eaa08..8b8973e7 100644 --- a/packages/sampling/tsconfig.json +++ b/packages/sampling/tsconfig.json @@ -4,6 +4,5 @@ "compilerOptions": { "rootDir": "./src", "outDir": "./dist" - }, - "references": [{ "path": ".." }] + } } diff --git a/packages/sdk/.gitignore b/packages/sdk/.gitignore deleted file mode 100644 index 849ddff3..00000000 --- a/packages/sdk/.gitignore +++ /dev/null @@ -1 +0,0 @@ -dist/ diff --git a/packages/sdk/README.md b/packages/sdk/README.md deleted file mode 100644 index 37f67637..00000000 --- a/packages/sdk/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# @solarwinds-apm/sdk - -This package provides all of the custom OTel component implementations used by `solarwinds-apm`, and any other code that isn't strictly related to the initialisation logic. It is not meant to be directly consumed by other libraries or applications. diff --git a/packages/sdk/eslint.config.js b/packages/sdk/eslint.config.js deleted file mode 100644 index 16b93ad8..00000000 --- a/packages/sdk/eslint.config.js +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -const base = require("@solarwinds-apm/eslint-config") - -module.exports = [...base()] diff --git a/packages/sdk/lib.d.ts b/packages/sdk/lib.d.ts deleted file mode 100644 index 6b80debe..00000000 --- a/packages/sdk/lib.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -interface ObjectConstructor { - // Object.entries but with very accurate types. The default typings for - // { name: "John", age: 30 } would make the return type - // [string, string | number][] while this typing makes it - // (["name", string] | ["age", number])[] - entries>( - object: T, - ): { [K in keyof T]: [K, T[K]] }[keyof T][] -} diff --git a/packages/sdk/package.json b/packages/sdk/package.json deleted file mode 100644 index d155194c..00000000 --- a/packages/sdk/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "name": "@solarwinds-apm/sdk", - "version": "1.0.2", - "license": "Apache-2.0", - "contributors": [ - "Raphaël Thériault " - ], - "repository": { - "type": "git", - "url": "git+https://github.com/solarwinds/apm-js.git", - "directory": "packages/sdk" - }, - "bugs": { - "url": "https://github.com/solarwinds/apm-js/issues" - }, - "type": "commonjs", - "exports": { - ".": "./dist/index.js", - "./otlp-exporter": "./dist/otlp-exporter.js", - "./otlp-metrics-exporter": "./dist/otlp-metrics-exporter.js" - }, - "main": "./dist/index.js", - "files": [ - "./src/", - "./dist/" - ], - "publishConfig": { - "access": "public", - "provenance": true - }, - "scripts": { - "build": "tsc", - "lint": "prettier --check . && eslint . --max-warnings=0", - "lint:fix": "eslint --fix . && prettier --write .", - "release": "node ../../scripts/publish.js", - "test": "swtest -p test/tsconfig.json -c src" - }, - "dependencies": { - "@opentelemetry/core": "~1.26.0", - "@opentelemetry/sdk-metrics": "~1.26.0", - "@opentelemetry/sdk-trace-base": "~1.26.0", - "@opentelemetry/semantic-conventions": "~1.27.0", - "@solarwinds-apm/bindings": "workspace:^", - "@solarwinds-apm/dependencies": "workspace:^", - "@solarwinds-apm/histogram": "workspace:^", - "@solarwinds-apm/lazy": "workspace:^", - "@solarwinds-apm/module": "workspace:^", - "json-stringify-safe": "^5.0.1", - "semver": "^7.5.4" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0", - "@opentelemetry/exporter-metrics-otlp-grpc": ">=0.34.0", - "@opentelemetry/exporter-trace-otlp-grpc": ">=0.34.0" - }, - "peerDependenciesMeta": { - "@opentelemetry/api": { - "optional": false - }, - "@opentelemetry/exporter-metrics-otlp-grpc": { - "optional": true - }, - "@opentelemetry/exporter-trace-otlp-grpc": { - "optional": true - } - }, - "devDependencies": { - "@opentelemetry/api": "^1.3.0", - "@opentelemetry/exporter-metrics-otlp-grpc": "~0.53.0", - "@opentelemetry/exporter-trace-otlp-grpc": "~0.53.0", - "@opentelemetry/instrumentation": "~0.53.0", - "@opentelemetry/resources": "~1.26.0", - "@opentelemetry/sdk-trace-node": "~1.26.0", - "@solarwinds-apm/eslint-config": "workspace:^", - "@solarwinds-apm/test": "workspace:^", - "@types/json-stringify-safe": "^5.0.3", - "@types/node": "^16.13.0", - "@types/semver": "^7.5.3", - "eslint": "^9.9.1", - "prettier": "^3.3.3", - "typescript": "~5.5.3" - }, - "engines": { - "node": ">=16.13.0" - } -} diff --git a/packages/sdk/src/cache.ts b/packages/sdk/src/cache.ts deleted file mode 100644 index 39f88ba4..00000000 --- a/packages/sdk/src/cache.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { type SpanContext } from "@opentelemetry/api" - -import { type SwConfiguration } from "." - -export interface SpanCache { - txname?: string - txnameCustom?: string - parentId?: string - parentRemote?: boolean -} - -class Cache { - private readonly spanCache = new Map() - - get(ctx: SpanContext): SpanCache | undefined { - return this.spanCache.get(Cache.key(ctx)) - } - - getOrInit(ctx: SpanContext, init: SpanCache = {}): SpanCache { - const k = Cache.key(ctx) - let c = this.spanCache.get(k) - if (!c) { - c = init - this.spanCache.set(k, c) - } - return c - } - - getEntry(ctx: SpanContext): SpanCache | undefined { - for (;;) { - const c = this.get(ctx) - - if (!c) return undefined - if (!c.parentId || c.parentRemote) return c - - ctx = { ...ctx, traceId: ctx.traceId, spanId: c.parentId } - } - } - - getTxname(ctx: SpanContext, config: SwConfiguration): string | undefined { - const c = this.get(ctx) - return c?.txnameCustom ?? config.transactionName ?? c?.txname - } - - clear(ctx: SpanContext): void { - this.spanCache.delete(Cache.key(ctx)) - } - - private static key(ctx: SpanContext): string { - return `${ctx.traceId}-${ctx.spanId}` - } -} -export const cache = new Cache() diff --git a/packages/sdk/src/compound-processor.ts b/packages/sdk/src/compound-processor.ts deleted file mode 100644 index 90567bb1..00000000 --- a/packages/sdk/src/compound-processor.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { type Context, type DiagLogger } from "@opentelemetry/api" -import { - BatchSpanProcessor, - type ReadableSpan, - type Span, - type SpanExporter, - type SpanProcessor, -} from "@opentelemetry/sdk-trace-base" - -export class CompoundSpanProcessor extends BatchSpanProcessor { - constructor( - exporter: SpanExporter, - private readonly processors: SpanProcessor[], - private readonly logger: DiagLogger, - ) { - super(exporter) - } - - override onStart(span: Span, parentContext: Context): void { - this.logger.verbose("span start", span, parentContext) - super.onStart(span, parentContext) - this.processors.forEach((p) => { - p.onStart(span, parentContext) - }) - } - - override onEnd(span: ReadableSpan): void { - this.logger.verbose("span end", span) - ;[...this.processors].reverse().forEach((p) => { - p.onEnd(span) - }) - super.onEnd(span) - } - - override async forceFlush(): Promise { - this.logger.debug("flush") - try { - await Promise.all(this.processors.map((p) => p.forceFlush())) - await super.forceFlush() - } catch (error) { - this.logger.error("flush error", error) - throw error - } - } - - override async shutdown(): Promise { - await Promise.all(this.processors.map((p) => p.shutdown())) - await super.shutdown() - } -} diff --git a/packages/sdk/src/config.ts b/packages/sdk/src/config.ts deleted file mode 100644 index 9fc9642f..00000000 --- a/packages/sdk/src/config.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { type DiagLogLevel } from "@opentelemetry/api" - -export interface SwConfiguration { - token: string - serviceName: string - enabled: boolean - collector?: string - certificate?: string - proxy?: string - metricFormat?: number - oboeLogLevel: number - oboeLogType: number - otelLogLevel: DiagLogLevel - triggerTraceEnabled: boolean - runtimeMetrics: boolean - tracingMode?: boolean - transactionName?: string - insertTraceContextIntoLogs: boolean - insertTraceContextIntoQueries: boolean - exportLogsEnabled: boolean - transactionSettings?: TransactionSetting[] -} - -export interface TransactionSetting { - tracing: boolean - matcher: (identifier: string) => boolean -} diff --git a/packages/sdk/src/context.ts b/packages/sdk/src/context.ts deleted file mode 100644 index e4aa94d0..00000000 --- a/packages/sdk/src/context.ts +++ /dev/null @@ -1,115 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { - type Context, - createContextKey, - isSpanContextValid, - type SpanContext, - trace, -} from "@opentelemetry/api" -import { type ReadableSpan } from "@opentelemetry/sdk-trace-base" -import { oboe } from "@solarwinds-apm/bindings" - -import { cache } from "./cache" - -const TRACE_OPTIONS_KEY = createContextKey("SWO X-Trace-Options") -const TRACEPARENT_VERSION = "00" - -export const TRACESTATE_SW_KEY = "sw" -export const TRACESTATE_TRACE_OPTIONS_RESPONSE_KEY = "xtrace_options_response" - -export const EQUALS_W3C = "####" -export const COMMA_W3C = "...." - -export interface TraceOptions { - header: string - signature?: string - - triggerTrace?: boolean - timestamp?: number - swKeys?: string - - custom: Record - ignored: [string, string | undefined][] -} - -export function getTraceOptions(context: Context): TraceOptions | undefined { - return context.getValue(TRACE_OPTIONS_KEY) as TraceOptions | undefined -} - -export function setTraceOptions( - context: Context, - traceOptions: TraceOptions, -): Context { - return context.setValue(TRACE_OPTIONS_KEY, traceOptions) -} - -export function swValue(spanContext: SpanContext): string { - const spanId = spanContext.spanId - - const flagsInt = spanContext.traceFlags - const flags = flagsInt.toString(16).padStart(2, "0") - - return `${spanId}-${flags}` -} - -export function traceParent(spanContext: SpanContext): string { - const traceId = spanContext.traceId - const sw = swValue(spanContext) - - return `${TRACEPARENT_VERSION}-${traceId}-${sw}` -} - -export function parentSpanContext(span: ReadableSpan): SpanContext | undefined { - const spanContext = span.spanContext() - - const parentId = span.parentSpanId - if (!parentId) return undefined - - return { - traceId: spanContext.traceId, - traceFlags: spanContext.traceFlags, - spanId: parentId, - isRemote: cache.get(spanContext)?.parentRemote, - } -} - -export function isEntrySpan(span: ReadableSpan): boolean { - const parentContext = parentSpanContext(span) - - return ( - !parentContext || - (isSpanContextValid(parentContext) && (parentContext.isRemote ?? false)) - ) -} - -export function setTransactionName(context: Context, name: string): boolean { - if (!name) return false - - const spanContext = trace.getSpanContext(context) - if (!spanContext) return false - - const rootCache = cache.getEntry(spanContext) - if (!rootCache) return false - - rootCache.txnameCustom = name - return true -} - -export function waitUntilReady(timeout: number): number { - return oboe.Context.isReady(timeout) -} diff --git a/packages/sdk/src/diag-logger.ts b/packages/sdk/src/diag-logger.ts deleted file mode 100644 index 6dabeef7..00000000 --- a/packages/sdk/src/diag-logger.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import * as process from "node:process" - -import { type DiagLogFunction, type DiagLogger } from "@opentelemetry/api" -import stringify from "json-stringify-safe" - -const HAS_COLOURS = process.stdout.isTTY && process.stdout.hasColors(16) -const COLOURS = { - red: "\x1b[1;31m", - yellow: "\x1b[1;33m", - cyan: "\x1b[1;36m", -} - -export class SwDiagLogger implements DiagLogger { - readonly error = SwDiagLogger.makeLogger("error", "red") - readonly warn = SwDiagLogger.makeLogger("warn", "yellow") - readonly info = SwDiagLogger.makeLogger("info", "cyan") - readonly debug = SwDiagLogger.makeLogger("debug") - readonly verbose = SwDiagLogger.makeLogger("verbose") - - private static makeLogger( - level: string, - colour?: keyof typeof COLOURS, - ): DiagLogFunction { - if (HAS_COLOURS) { - const colourCode = colour && COLOURS[colour] - - return (message, ...args) => { - let line = `[${new Date().toISOString()}] (` - - if (colourCode) { - line += colourCode - } - line += level.toUpperCase() - if (colourCode) { - line += "\x1b[0m" - } - - line += `) ${message}` - - console.log(line, ...args) - } - } else { - return (message, ...args) => { - while (typeof args[0] === "string") { - message += ` ${args.shift() as string}` - } - - console.log(stringify({ time: new Date(), level, message, args })) - } - } - } -} diff --git a/packages/sdk/src/error.ts b/packages/sdk/src/error.ts deleted file mode 100644 index 6238efe0..00000000 --- a/packages/sdk/src/error.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -export class OboeError extends Error { - klass: string - method?: string - status: number - - constructor(klass: string, method: string, status: number, message?: string) { - const path = `${klass}::${method}` - - let m = `${path} failed with status ${status}` - if (message) { - m += `: ${message}` - } - super(m) - - this.name = "OboeError" - this.klass = klass - this.method = method - this.status = status - } -} diff --git a/packages/sdk/src/exporter.ts b/packages/sdk/src/exporter.ts deleted file mode 100644 index 49ce4e87..00000000 --- a/packages/sdk/src/exporter.ts +++ /dev/null @@ -1,225 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { inspect } from "node:util" - -import { - type AttributeValue, - type DiagLogger, - type SpanContext, - SpanKind, - SpanStatusCode, - trace, -} from "@opentelemetry/api" -import { - type ExportResult, - ExportResultCode, - hrTimeToMicroseconds, -} from "@opentelemetry/core" -import { - type ReadableSpan, - type SpanExporter, - type TimedEvent, -} from "@opentelemetry/sdk-trace-base" -import { - SEMATTRS_EXCEPTION_MESSAGE, - SEMATTRS_EXCEPTION_STACKTRACE, - SEMATTRS_EXCEPTION_TYPE, -} from "@opentelemetry/semantic-conventions" -import { oboe } from "@solarwinds-apm/bindings" - -import { type SwConfiguration } from "." -import { cache } from "./cache" -import { parentSpanContext, traceParent } from "./context" -import { OboeError } from "./error" - -export class SwExporter implements SpanExporter { - private error: Error | undefined = undefined - constructor( - private readonly config: SwConfiguration, - private readonly reporter: oboe.Reporter, - private readonly logger: DiagLogger, - ) {} - - export( - spans: ReadableSpan[], - resultCallback: (result: ExportResult) => void, - ) { - for (const span of spans) { - const context = span.spanContext() - const parentContext = parentSpanContext(span) - - let evt: oboe.Event - const md = SwExporter.metadata(context) - if (parentContext && trace.isSpanContextValid(parentContext)) { - const parentMd = SwExporter.metadata(parentContext) - evt = oboe.Context.createEntry( - md, - hrTimeToMicroseconds(span.startTime), - parentMd, - ) - this.addTxname(context, evt) - } else { - evt = oboe.Context.createEntry(md, hrTimeToMicroseconds(span.startTime)) - this.addTxname(context, evt) - } - - const kind = SpanKind[span.kind] - const layer = `${kind}:${span.name}` - - evt.addInfo("Layer", layer) - evt.addInfo("sw.span_name", span.name) - evt.addInfo("sw.span_kind", kind) - evt.addInfo("Language", "Node.js") - - evt.addInfo("otel.scope.name", span.instrumentationLibrary.name) - evt.addInfo( - "otel.scope.version", - span.instrumentationLibrary.version ?? null, - ) - if (span.status.code !== SpanStatusCode.UNSET) { - evt.addInfo("otel.status_code", SpanStatusCode[span.status.code]) - } - if (span.status.message) { - evt.addInfo("otel.status_description", span.status.message) - } - if (span.droppedAttributesCount > 0) { - evt.addInfo( - "otel.dropped_attributes_count", - span.droppedAttributesCount, - ) - } - if (span.droppedEventsCount > 0) { - evt.addInfo("otel.dropped_events_count", span.droppedEventsCount) - } - if (span.droppedLinksCount > 0) { - evt.addInfo("otel.dropped_links_count", span.droppedLinksCount) - } - - for (const [key, value] of Object.entries(span.attributes)) { - evt.addInfo(key, SwExporter.attributeValue(value)) - } - - this.sendReport(evt) - - for (const event of span.events) { - if (event.name === "exception") { - this.reportErrorEvent(event) - } else { - this.reportInfoEvent(event) - } - } - - evt = oboe.Context.createExit(hrTimeToMicroseconds(span.endTime)) - evt.addInfo("Layer", layer) - this.sendReport(evt) - - cache.clear(context) - } - - const result: ExportResult = this.error - ? { code: ExportResultCode.FAILED, error: this.error } - : { code: ExportResultCode.SUCCESS } - this.error = undefined - resultCallback(result) - } - - forceFlush(): Promise { - this.reporter.flush() - return Promise.resolve() - } - async shutdown(): Promise { - await this.forceFlush() - oboe.Context.shutdown() - } - - private static metadata(span: SpanContext): oboe.Metadata { - const traceparent = traceParent(span) - return oboe.Metadata.fromString(traceparent) - } - - private addTxname(ctx: SpanContext, evt: oboe.Event) { - const txname = cache.getTxname(ctx, this.config) - if (!txname) { - return - } - - evt.addInfo("TransactionName", txname) - } - - private reportErrorEvent(event: TimedEvent) { - const evt = oboe.Context.createEvent(hrTimeToMicroseconds(event.time)) - evt.addInfo("Label", "error") - evt.addInfo("Spec", "error") - - evt.addInfo( - "ErrorClass", - SwExporter.attributeValue(event.attributes?.[SEMATTRS_EXCEPTION_TYPE]), - ) - evt.addInfo( - "ErrorMsg", - SwExporter.attributeValue(event.attributes?.[SEMATTRS_EXCEPTION_MESSAGE]), - ) - evt.addInfo( - "Backtrace", - SwExporter.attributeValue( - event.attributes?.[SEMATTRS_EXCEPTION_STACKTRACE], - ), - ) - - const attributes = Object.entries(event.attributes ?? {}).filter( - ([key]) => - ![ - SEMATTRS_EXCEPTION_TYPE, - SEMATTRS_EXCEPTION_MESSAGE, - SEMATTRS_EXCEPTION_STACKTRACE, - ].includes(key), - ) - for (const [key, value] of attributes) { - evt.addInfo(key, SwExporter.attributeValue(value)) - } - - this.sendReport(evt) - } - - private reportInfoEvent(event: TimedEvent) { - const evt = oboe.Context.createEvent(hrTimeToMicroseconds(event.time)) - evt.addInfo("Label", "info") - for (const [key, value] of Object.entries(event.attributes ?? {})) { - evt.addInfo(key, SwExporter.attributeValue(value)) - } - this.sendReport(evt) - } - - private sendReport(evt: oboe.Event): void { - const status = this.reporter.sendReport(evt, false) - if (status < 0) { - this.error = new OboeError("Reporter", "sendReport", status) - this.logger.warn("error sending report", this.error) - this.logger.debug(evt.metadataString()) - } - } - - private static attributeValue( - v: AttributeValue | undefined, - ): string | number | boolean | null { - if (Array.isArray(v)) { - return inspect(v, { breakLength: Infinity, compact: true }) - } else { - return v ?? null - } - } -} diff --git a/packages/sdk/src/inbound-metrics-processor.ts b/packages/sdk/src/inbound-metrics-processor.ts deleted file mode 100644 index 7ffe0601..00000000 --- a/packages/sdk/src/inbound-metrics-processor.ts +++ /dev/null @@ -1,125 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { SpanKind, SpanStatusCode } from "@opentelemetry/api" -import { hrTimeToMicroseconds } from "@opentelemetry/core" -import { - NoopSpanProcessor, - type ReadableSpan, -} from "@opentelemetry/sdk-trace-base" -import { - SEMATTRS_HTTP_METHOD, - SEMATTRS_HTTP_ROUTE, - SEMATTRS_HTTP_STATUS_CODE, - SEMATTRS_HTTP_URL, -} from "@opentelemetry/semantic-conventions" -import { oboe } from "@solarwinds-apm/bindings" - -import { cache } from "./cache" -import { isEntrySpan } from "./context" - -export class SwInboundMetricsSpanProcessor extends NoopSpanProcessor { - override onEnd(span: ReadableSpan): void { - if (!isEntrySpan(span)) return - - const { - isHttp, - transaction: defaultTransaction, - method, - status, - url, - } = SwInboundMetricsSpanProcessor.httpSpanMeta(span) - const hasError = span.status.code === SpanStatusCode.ERROR - const duration = hrTimeToMicroseconds(span.duration) - // TODO - const domain = null - - const spanCache = cache.getOrInit(span.spanContext()) - const transaction = spanCache.txnameCustom ?? defaultTransaction - - let txname: string - if (isHttp) { - txname = oboe.Span.createHttpSpan({ - transaction, - duration, - method, - status, - url, - domain, - has_error: hasError ? 1 : 0, - }) - } else { - txname = oboe.Span.createSpan({ - transaction, - duration, - domain, - has_error: hasError ? 1 : 0, - }) - } - spanCache.txname = txname - } - - private static httpSpanMeta(span: ReadableSpan): - | { - isHttp: true - transaction: string - method: string - status: number - url: string - } - | { - isHttp: false - transaction: string - method: undefined - status: undefined - url: undefined - } { - if ( - span.kind !== SpanKind.SERVER || - !(SEMATTRS_HTTP_METHOD in span.attributes) - ) { - return { - isHttp: false, - transaction: span.name, - method: undefined, - status: undefined, - url: undefined, - } - } - - const method = String(span.attributes[SEMATTRS_HTTP_METHOD]) - const status = Number(span.attributes[SEMATTRS_HTTP_STATUS_CODE] ?? 0) - const url = String(span.attributes[SEMATTRS_HTTP_URL]) - - let transaction = span.attributes[SEMATTRS_HTTP_ROUTE] - if (typeof transaction !== "string") { - try { - const parsedUrl = new URL(url) - transaction = parsedUrl.pathname - } catch { - transaction = span.name - } - } - - return { - isHttp: true, - transaction, - method, - status, - url, - } - } -} diff --git a/packages/sdk/src/index.ts b/packages/sdk/src/index.ts deleted file mode 100644 index f6ede7ad..00000000 --- a/packages/sdk/src/index.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { metrics, oboe } from "@solarwinds-apm/bindings" - -import { version } from "../package.json" -import { CompoundSpanProcessor } from "./compound-processor" -import { type SwConfiguration } from "./config" -import { setTransactionName, waitUntilReady } from "./context" -import { SwDiagLogger } from "./diag-logger" -import { SwExporter } from "./exporter" -import { SwInboundMetricsSpanProcessor } from "./inbound-metrics-processor" -import { SwMetricsExporter } from "./metric-exporter" -import { SwParentInfoSpanProcessor } from "./parent-info-processor" -import { patch } from "./patches" -import { - createReporter, - createServerlessApi, - initMessage, - sendStatus, -} from "./reporter" -import { SwResponseTimeProcessor } from "./response-time-processor" -import { SwSampler } from "./sampler" -import { SwTraceContextOptionsPropagator } from "./trace-context-options-propagator" -import { SwTraceOptionsResponsePropagator } from "./trace-options-response-propagator" -import { SwTransactionNameProcessor } from "./transaction-name-processor" - -export const VERSION = version - -export const OBOE_ERROR: Error | false = oboe instanceof Error ? oboe : false -export const METRICS_ERROR: Error | false = - metrics instanceof Error ? metrics : false - -export { - CompoundSpanProcessor, - createReporter, - createServerlessApi, - initMessage, - patch, - sendStatus, - setTransactionName, - SwConfiguration, - SwDiagLogger, - SwExporter, - SwInboundMetricsSpanProcessor, - SwMetricsExporter, - SwParentInfoSpanProcessor, - SwResponseTimeProcessor, - SwSampler, - SwTraceContextOptionsPropagator, - SwTraceOptionsResponsePropagator, - SwTransactionNameProcessor, - waitUntilReady, -} -export * as metrics from "./metrics" diff --git a/packages/sdk/src/metric-exporter.ts b/packages/sdk/src/metric-exporter.ts deleted file mode 100644 index b9c74a9b..00000000 --- a/packages/sdk/src/metric-exporter.ts +++ /dev/null @@ -1,279 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { inspect } from "node:util" - -import { type Attributes, type DiagLogger } from "@opentelemetry/api" -import { - type ExportResult, - ExportResultCode, - type InstrumentationScope, -} from "@opentelemetry/core" -import { - Aggregation, - AggregationTemporality, - DataPointType, - type ExponentialHistogram, - ExponentialHistogramAggregation, - type Histogram, - InstrumentType, - type MetricDescriptor, - type PushMetricExporter, - type ResourceMetrics, -} from "@opentelemetry/sdk-metrics" -import { oboe } from "@solarwinds-apm/bindings" -import { OtelHistogram } from "@solarwinds-apm/histogram" - -export class SwMetricsExporter implements PushMetricExporter { - constructor( - private readonly reporter: oboe.Reporter, - private readonly logger: DiagLogger, - ) {} - - export( - metrics: ResourceMetrics, - resultCallback: (result: ExportResult) => void, - ): void { - for (const scopeMetric of metrics.scopeMetrics) { - const scopeTags = SwMetricsExporter.scopeTags(scopeMetric.scope) - - for (const metric of scopeMetric.metrics) { - const name = `trace.node.${metric.descriptor.name}` - const temporality = metric.aggregationTemporality - const descriptorTags = SwMetricsExporter.descriptorTags( - metric.descriptor, - ) - - for (const dataPoint of metric.dataPoints) { - const dataPointTags = SwMetricsExporter.dataPointTags( - dataPoint.attributes, - ) - const [tags, tagCount] = SwMetricsExporter.oboeTags({ - ...scopeTags, - ...descriptorTags, - ...dataPointTags, - }) - - switch (metric.dataPointType) { - case DataPointType.SUM: { - if (temporality === AggregationTemporality.DELTA) { - this.exportCounter( - dataPoint.value as number, - name, - tags, - tagCount, - ) - } else { - this.exportSummary( - dataPoint.value as number, - name, - tags, - tagCount, - ) - } - break - } - case DataPointType.GAUGE: { - if (temporality === AggregationTemporality.CUMULATIVE) { - this.exportSummary( - dataPoint.value as number, - name, - tags, - tagCount, - ) - } else { - this.logger.warn( - "gauges with delta aggregation are not supported", - ) - } - break - } - case DataPointType.HISTOGRAM: { - if (temporality === AggregationTemporality.DELTA) { - const histogram = OtelHistogram.fromHistogram( - dataPoint.value as Histogram, - ) - this.exportHistogram(histogram, name, tags, tagCount) - } else { - this.logger.warn( - "histograms with cumulative aggregation are not supported", - ) - } - break - } - case DataPointType.EXPONENTIAL_HISTOGRAM: { - if (temporality === AggregationTemporality.DELTA) { - const histogram = OtelHistogram.fromExponentialHistogram( - dataPoint.value as ExponentialHistogram, - ) - this.exportHistogram(histogram, name, tags, tagCount) - } else { - this.logger.warn( - "histograms with cumulative aggregation are not supported", - ) - } - break - } - } - } - } - } - - resultCallback({ - code: ExportResultCode.SUCCESS, - }) - } - - selectAggregationTemporality( - instrumentType: InstrumentType, - ): AggregationTemporality { - switch (instrumentType) { - case InstrumentType.UP_DOWN_COUNTER: - case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER: - case InstrumentType.OBSERVABLE_GAUGE: - return AggregationTemporality.CUMULATIVE - default: - return AggregationTemporality.DELTA - } - } - selectAggregation(instrumentType: InstrumentType): Aggregation { - switch (instrumentType) { - case InstrumentType.HISTOGRAM: - return new ExponentialHistogramAggregation(undefined, true) - default: - return Aggregation.Default() - } - } - - forceFlush(): Promise { - this.reporter.flush() - return Promise.resolve() - } - async shutdown(): Promise { - await this.forceFlush() - oboe.Context.shutdown() - } - - private exportCounter( - value: number, - name: string, - tags: oboe.MetricTags, - tagCount: number, - ) { - oboe.CustomMetrics.increment({ - name, - count: value, - tags, - tags_count: tagCount, - host_tag: 1, - service_name: null, - }) - } - - private exportSummary( - value: number, - name: string, - tags: oboe.MetricTags, - tagCount: number, - ) { - oboe.CustomMetrics.summary({ - name, - value, - count: 1, - tags, - tags_count: tagCount, - host_tag: 1, - service_name: null, - }) - } - - private exportHistogram( - histogram: OtelHistogram, - name: string, - tags: oboe.MetricTags, - tagCount: number, - ) { - const stats = { - count: histogram.count, - min: histogram.min, - max: histogram.max, - mean: histogram.mean(), - stddev: histogram.stddev(), - p50: histogram.percentile(50), - p75: histogram.percentile(75), - p90: histogram.percentile(90), - p95: histogram.percentile(95), - } - const filtered = Object.entries(stats).filter(([, v]) => v !== undefined) - for (const [stat, value] of filtered) { - oboe.CustomMetrics.summary({ - name: `${name}.${stat}`, - value: value!, - count: 1, - tags, - tags_count: tagCount, - host_tag: 1, - service_name: null, - }) - } - } - - private static oboeTags( - tags: Record, - ): [tags: oboe.MetricTags, count: number] { - const entries = Object.entries(tags) - const count = entries.length - - const oboeTags = new oboe.MetricTags(count) - for (const [i, [k, v]] of entries.entries()) { - oboeTags.add(i, k, v) - } - return [oboeTags, count] - } - - private static scopeTags( - scope: InstrumentationScope, - ): Record { - const tags: Record = { "scope.name": scope.name } - if (scope.version) { - tags["scope.version"] = scope.version - } - return tags - } - - private static descriptorTags( - descriptor: MetricDescriptor, - ): Record { - return { - description: descriptor.description, - unit: descriptor.unit, - } - } - - private static dataPointTags(attributes: Attributes): Record { - return Object.fromEntries( - Object.entries(attributes) - .filter(([, v]) => v !== undefined) - .map(([k, v]) => { - if (Array.isArray(v)) { - return [k, inspect(v, { breakLength: Infinity, compact: true })] - } else { - return [k, v!.toString()] - } - }), - ) - } -} diff --git a/packages/sdk/src/metrics/cpu.ts b/packages/sdk/src/metrics/cpu.ts deleted file mode 100644 index 1189238a..00000000 --- a/packages/sdk/src/metrics/cpu.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import * as process from "node:process" - -import { type BatchObservableResult, ValueType } from "@opentelemetry/api" -import { lazy } from "@solarwinds-apm/lazy" - -import { meter } from "." - -const user = lazy(() => - meter.createObservableGauge("process.cpuUsage.user", { - description: "time spent in user mode", - unit: "μs", - valueType: ValueType.DOUBLE, - }), -) -const system = lazy(() => - meter.createObservableGauge("process.cpuUsage.system", { - description: "time spent in system mode", - unit: "μs", - valueType: ValueType.DOUBLE, - }), -) - -let previous: NodeJS.CpuUsage | undefined = undefined -function callback(batch: BatchObservableResult) { - const current = process.cpuUsage() - if (previous === undefined) { - previous = current - return - } - - batch.observe(user, current.user - previous.user) - batch.observe(system, current.system - previous.system) - previous = current -} - -export function start() { - meter.addBatchObservableCallback(callback, [user, system]) -} -export function stop() { - meter.removeBatchObservableCallback(callback, [user, system]) - previous = undefined -} diff --git a/packages/sdk/src/metrics/event-loop.ts b/packages/sdk/src/metrics/event-loop.ts deleted file mode 100644 index f76309aa..00000000 --- a/packages/sdk/src/metrics/event-loop.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { ValueType } from "@opentelemetry/api" -import { metrics } from "@solarwinds-apm/bindings" -import { lazy } from "@solarwinds-apm/lazy" - -import { meter } from "." - -// loop iterations to sum when calculating latency -// lower values increase both accuracy and overhead and vice versa -// setting this to 0 will force the event loop into a busy loop -const GRANULARITY = 2 - -const latency = lazy(() => - meter.createHistogram("eventloop", { - description: `measures the latency of the event loop`, - unit: "μs", - valueType: ValueType.DOUBLE, - }), -) - -export function start() { - metrics.eventLoop.setCallback((l) => { - for (let i = 0; i < GRANULARITY + 1; i++) { - latency.record(l / 1000 / (GRANULARITY + 1)) - } - }, GRANULARITY) -} -export function stop() { - metrics.eventLoop.setCallback(null) -} diff --git a/packages/sdk/src/metrics/gc.ts b/packages/sdk/src/metrics/gc.ts deleted file mode 100644 index f5fa9822..00000000 --- a/packages/sdk/src/metrics/gc.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { - constants, - type NodeGCPerformanceDetail, - PerformanceObserver, -} from "node:perf_hooks" - -import { ValueType } from "@opentelemetry/api" -import { lazy } from "@solarwinds-apm/lazy" - -import { meter } from "." - -const major = lazy(() => - meter.createHistogram("gc.major", { - description: "measures the duration of major GC cycles", - unit: "μs", - valueType: ValueType.DOUBLE, - }), -) -const minor = lazy(() => - meter.createHistogram("gc.minor", { - description: "measures the duration of minor GC cycles", - unit: "μs", - valueType: ValueType.DOUBLE, - }), -) - -const obs = new PerformanceObserver((list) => { - for (const entry of list.getEntriesByType("gc")) { - const detail = entry.detail as NodeGCPerformanceDetail - switch (detail.kind) { - case constants.NODE_PERFORMANCE_GC_MAJOR: { - major.record(entry.duration * 1000) - break - } - case constants.NODE_PERFORMANCE_GC_MINOR: { - minor.record(entry.duration * 1000) - break - } - default: { - continue - } - } - } -}) - -export function start() { - obs.observe({ type: "gc" }) -} -export function stop() { - obs.disconnect() -} diff --git a/packages/sdk/src/metrics/index.ts b/packages/sdk/src/metrics/index.ts deleted file mode 100644 index b8291bac..00000000 --- a/packages/sdk/src/metrics/index.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { metrics } from "@opentelemetry/api" -import { lazy } from "@solarwinds-apm/lazy" - -import packageJson from "../../package.json" -import * as cpu from "./cpu" -import * as eventLoop from "./event-loop" -import * as gc from "./gc" -import * as memory from "./memory" -import { serverlessViews } from "./serverless" - -export const meter = lazy(() => - metrics.getMeter(packageJson.name, packageJson.version), -) - -export function start() { - cpu.start() - eventLoop.start() - gc.start() - memory.start() -} -export function stop() { - cpu.stop() - eventLoop.stop() - gc.stop() - memory.stop() -} - -export const views = [...serverlessViews] diff --git a/packages/sdk/src/metrics/memory.ts b/packages/sdk/src/metrics/memory.ts deleted file mode 100644 index 83d21f6e..00000000 --- a/packages/sdk/src/metrics/memory.ts +++ /dev/null @@ -1,166 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import * as process from "node:process" -import * as v8 from "node:v8" - -import { type BatchObservableResult, ValueType } from "@opentelemetry/api" -import { lazy } from "@solarwinds-apm/lazy" - -import { meter } from "." - -const memoryUsageMeters = lazy( - () => - ({ - rss: meter.createObservableUpDownCounter("process.memoryUsage.rss", { - description: "resident set size", - unit: "byte", - valueType: ValueType.INT, - }), - heapTotal: meter.createObservableUpDownCounter( - "process.memoryUsage.heapTotal", - { - description: "total size of the V8 heap", - unit: "byte", - valueType: ValueType.INT, - }, - ), - heapUsed: meter.createObservableUpDownCounter( - "process.memoryUsage.heapUsed", - { - description: "used size of the V8 heap", - unit: "byte", - valueType: ValueType.INT, - }, - ), - external: meter.createObservableUpDownCounter( - "process.memoryUsage.external", - { - description: - "memory usage of C++ objects bound to JavaScript objects managed by V8", - unit: "byte", - valueType: ValueType.INT, - }, - ), - arrayBuffers: meter.createObservableUpDownCounter( - "process.memoryUsage.arrayBuffers", - { - description: - "memory allocated for ArrayBuffers and SharedArrayBuffers", - unit: "byte", - valueType: ValueType.INT, - }, - ), - }) as const, -) - -const heapStatisticsMeters = lazy( - () => - ({ - total_heap_size: meter.createObservableUpDownCounter( - "v8.heapStatistics.total_heap_size", - { - unit: "byte", - valueType: ValueType.INT, - }, - ), - total_heap_size_executable: meter.createObservableUpDownCounter( - "v8.heapStatistics.total_heap_size_executable", - { - unit: "byte", - valueType: ValueType.INT, - }, - ), - total_physical_size: meter.createObservableUpDownCounter( - "v8.heapStatistics.total_physical_size", - { - unit: "byte", - valueType: ValueType.INT, - }, - ), - total_available_size: meter.createObservableUpDownCounter( - "v8.heapStatistics.total_available_size", - { - unit: "byte", - valueType: ValueType.INT, - }, - ), - used_heap_size: meter.createObservableUpDownCounter( - "v8.heapStatistics.used_heap_size", - { - unit: "byte", - valueType: ValueType.INT, - }, - ), - heap_size_limit: meter.createObservableUpDownCounter( - "v8.heapStatistics.heap_size_limit", - { - unit: "byte", - valueType: ValueType.INT, - }, - ), - malloced_memory: meter.createObservableUpDownCounter( - "v8.heapStatistics.malloced_memory", - { - unit: "byte", - valueType: ValueType.INT, - }, - ), - peak_malloced_memory: meter.createObservableUpDownCounter( - "v8.heapStatistics.peak_malloced_memory", - { - unit: "byte", - valueType: ValueType.INT, - }, - ), - }) as const, -) - -function memoryUsageCallback(batch: BatchObservableResult) { - const usage = process.memoryUsage() - for (const [key, meter] of Object.entries(memoryUsageMeters)) { - batch.observe(meter, usage[key]) - } -} - -function heapStatisticsCallback(batch: BatchObservableResult) { - const statistics = v8.getHeapStatistics() - for (const [key, meter] of Object.entries(heapStatisticsMeters)) { - batch.observe(meter, statistics[key]) - } -} - -export function start() { - meter.addBatchObservableCallback( - memoryUsageCallback, - Object.values(memoryUsageMeters), - ) - meter.addBatchObservableCallback( - heapStatisticsCallback, - Object.values(heapStatisticsMeters), - ) -} - -export function stop() { - meter.removeBatchObservableCallback( - memoryUsageCallback, - Object.values(memoryUsageMeters), - ) - meter.removeBatchObservableCallback( - heapStatisticsCallback, - Object.values(heapStatisticsMeters), - ) -} diff --git a/packages/sdk/src/metrics/serverless.ts b/packages/sdk/src/metrics/serverless.ts deleted file mode 100644 index 35051835..00000000 --- a/packages/sdk/src/metrics/serverless.ts +++ /dev/null @@ -1,119 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { - type Attributes, - metrics, - SpanKind, - SpanStatusCode, - ValueType, -} from "@opentelemetry/api" -import { hrTimeToMilliseconds } from "@opentelemetry/core" -import { - ExplicitBucketHistogramAggregation, - View, -} from "@opentelemetry/sdk-metrics" -import { type ReadableSpan } from "@opentelemetry/sdk-trace-base" -import { - SEMATTRS_HTTP_METHOD, - SEMATTRS_HTTP_STATUS_CODE, -} from "@opentelemetry/semantic-conventions" -import { type oboe } from "@solarwinds-apm/bindings" -import { lazy } from "@solarwinds-apm/lazy" - -const samplingMeter = lazy(() => metrics.getMeter("sw.apm.sampling.metrics")) -const requestMeter = lazy(() => metrics.getMeter("sw.apm.request.metrics")) - -const counters = { - RequestCount: lazy(() => - samplingMeter.createCounter("trace.service.request_count", { - valueType: ValueType.INT, - }), - ), - TokenBucketExhaustionCount: lazy(() => - samplingMeter.createCounter("trace.service.tokenbucket_exhaustion_count", { - valueType: ValueType.INT, - }), - ), - TraceCount: lazy(() => - samplingMeter.createCounter("trace.service.tracecount", { - valueType: ValueType.INT, - }), - ), - SampleCount: lazy(() => - samplingMeter.createCounter("trace.service.samplecount", { - valueType: ValueType.INT, - }), - ), - ThroughTraceCount: lazy(() => - samplingMeter.createCounter("trace.service.through_trace_count", { - valueType: ValueType.INT, - }), - ), - TriggeredTraceCount: lazy(() => - samplingMeter.createCounter("trace.service.triggered_trace_count", { - valueType: ValueType.INT, - }), - ), -} - -const responseTime = lazy(() => - requestMeter.createHistogram("trace.service.response_time", { - valueType: ValueType.DOUBLE, - unit: "ms", - }), -) - -export function recordServerlessCounters(serverlessApi: oboe.OboeAPI) { - for (const [name, counter] of Object.entries(counters)) { - const method = `consume${name}` as const - const value = serverlessApi[method]() - if (value !== false) counter.add(value) - } -} - -export function recordServerlessResponseTime( - span: ReadableSpan, - transaction: string | undefined, -) { - const time = hrTimeToMilliseconds(span.duration) - const isError = span.status.code === SpanStatusCode.ERROR - - const copy = - span.kind === SpanKind.SERVER - ? [SEMATTRS_HTTP_METHOD, SEMATTRS_HTTP_STATUS_CODE] - : [] - - const attrs: Attributes = { - "sw.transaction": transaction ?? "unknown", - "sw.is_error": isError, - } - for (const attr of copy) { - if (span.attributes[attr]) { - attrs[attr] = span.attributes[attr] - } - } - - responseTime.record(time, attrs) -} - -export const serverlessViews = [ - new View({ - meterName: "sw.apm.request.metrics", - instrumentName: "trace.service.response_time", - aggregation: new ExplicitBucketHistogramAggregation([], true), - }), -] diff --git a/packages/sdk/src/otlp-exporter.ts b/packages/sdk/src/otlp-exporter.ts deleted file mode 100644 index c18a3058..00000000 --- a/packages/sdk/src/otlp-exporter.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { type ExportResult } from "@opentelemetry/core" -import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-grpc" -import { type ReadableSpan } from "@opentelemetry/sdk-trace-base" - -import { type SwConfiguration } from "." -import { cache } from "./cache" - -export class SwOtlpExporter extends OTLPTraceExporter { - constructor( - private readonly config: SwConfiguration, - superConfig?: ConstructorParameters[0], - ) { - super(superConfig) - } - - override export( - spans: ReadableSpan[], - resultCallback: (result: ExportResult) => void, - ): void { - for (const span of spans) { - const context = span.spanContext() - - const txname = cache.getTxname(context, this.config) - if (txname) { - span.attributes["sw.transaction"] = txname.slice(0, 256) - } - - cache.clear(context) - } - - super.export(spans, resultCallback) - } -} diff --git a/packages/sdk/src/otlp-metrics-exporter.ts b/packages/sdk/src/otlp-metrics-exporter.ts deleted file mode 100644 index 9c4a2a24..00000000 --- a/packages/sdk/src/otlp-metrics-exporter.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { OTLPMetricExporter } from "@opentelemetry/exporter-metrics-otlp-grpc" -import { - Aggregation, - AggregationTemporality, - ExponentialHistogramAggregation, - InstrumentType, - type PushMetricExporter, -} from "@opentelemetry/sdk-metrics" - -export class SwOtlpMetricsExporter - extends OTLPMetricExporter - implements PushMetricExporter -{ - override selectAggregationTemporality( - instrumentType: InstrumentType, - ): AggregationTemporality { - switch (instrumentType) { - case InstrumentType.COUNTER: - case InstrumentType.OBSERVABLE_COUNTER: - case InstrumentType.HISTOGRAM: - return AggregationTemporality.DELTA - default: - return super.selectAggregationTemporality(instrumentType) - } - } - - override selectAggregation(instrumentType: InstrumentType): Aggregation { - switch (instrumentType) { - case InstrumentType.HISTOGRAM: - return new ExponentialHistogramAggregation(undefined, true) - default: - return Aggregation.Default() - } - } -} diff --git a/packages/sdk/src/parent-info-processor.ts b/packages/sdk/src/parent-info-processor.ts deleted file mode 100644 index 0ccf048a..00000000 --- a/packages/sdk/src/parent-info-processor.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { type Context, trace, TraceFlags } from "@opentelemetry/api" -import { - NoopSpanProcessor, - type ReadableSpan, - type Span, -} from "@opentelemetry/sdk-trace-base" - -import { cache } from "./cache" - -export class SwParentInfoSpanProcessor extends NoopSpanProcessor { - override onStart(span: Span, parentContext: Context): void { - const spanContext = span.spanContext() - const parentSpanContext = trace.getSpanContext(parentContext) - - const spanCache = cache.getOrInit(spanContext) - spanCache.parentId = parentSpanContext?.spanId - spanCache.parentRemote = parentSpanContext?.isRemote - } - - override onEnd(span: ReadableSpan): void { - const spanContext = span.spanContext() - // clear here unless sampled in which case the exporter takes care of it - if (!(spanContext.traceFlags & TraceFlags.SAMPLED)) { - cache.clear(spanContext) - } - } -} diff --git a/packages/sdk/src/patches/aws-lambda.ts b/packages/sdk/src/patches/aws-lambda.ts deleted file mode 100644 index 5c7abeda..00000000 --- a/packages/sdk/src/patches/aws-lambda.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { type AwsLambdaInstrumentationConfig } from "@opentelemetry/instrumentation-aws-lambda" -import { IS_AWS_LAMBDA } from "@solarwinds-apm/module" - -import { type Patch } from "." - -export const patch: Patch = (config) => ({ - ...config, - enabled: config.enabled ?? IS_AWS_LAMBDA, - disableAwsContextPropagation: config.disableAwsContextPropagation ?? true, -}) diff --git a/packages/sdk/src/patches/aws-sdk.ts b/packages/sdk/src/patches/aws-sdk.ts deleted file mode 100644 index 44cf3486..00000000 --- a/packages/sdk/src/patches/aws-sdk.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { type InstrumentationConfig } from "@opentelemetry/instrumentation" -import { IS_AWS_LAMBDA } from "@solarwinds-apm/module" - -import { type Patch } from "." - -export const patch: Patch = (config) => ({ - ...config, - enabled: config.enabled ?? (IS_AWS_LAMBDA || undefined), -}) diff --git a/packages/sdk/src/patches/bunyan.ts b/packages/sdk/src/patches/bunyan.ts deleted file mode 100644 index 7e20f769..00000000 --- a/packages/sdk/src/patches/bunyan.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { type BunyanInstrumentationConfig } from "@opentelemetry/instrumentation-bunyan" - -import { type Patch, RESOURCE_SERVICE_NAME } from "." - -export const patch: Patch = (config, options) => ({ - ...config, - enabled: config.enabled ?? options.insertTraceContextIntoLogs, - disableLogSending: config.disableLogSending ?? !options.exportLogsEnabled, - logHook: (span, record) => { - record[RESOURCE_SERVICE_NAME] = options.serviceName - config.logHook?.(span, record) - }, -}) diff --git a/packages/sdk/src/patches/fs.ts b/packages/sdk/src/patches/fs.ts deleted file mode 100644 index dd9fdfa5..00000000 --- a/packages/sdk/src/patches/fs.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { type FsInstrumentationConfig } from "@opentelemetry/instrumentation-fs" - -import { type Patch } from "." - -export const patch: Patch = (config) => ({ - ...config, - requireParentSpan: config.requireParentSpan ?? true, -}) diff --git a/packages/sdk/src/patches/http.ts b/packages/sdk/src/patches/http.ts deleted file mode 100644 index 8bdd3156..00000000 --- a/packages/sdk/src/patches/http.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { type ServerResponse } from "node:http" - -import { ROOT_CONTEXT, trace } from "@opentelemetry/api" -import { type HttpInstrumentationConfig } from "@opentelemetry/instrumentation-http" - -import { type Patch } from "." - -export const patch: Patch = (config, options) => ({ - ...config, - responseHook: (span, response) => { - // only for server responses originating from the instrumented app - if ("setHeader" in response) { - const context = trace.setSpan(ROOT_CONTEXT, span) - options.responsePropagator.inject(context, response, { - set: (res, k, v) => (res as ServerResponse).setHeader(k, v), - }) - } - - config.responseHook?.(span, response) - }, -}) diff --git a/packages/sdk/src/patches/index.ts b/packages/sdk/src/patches/index.ts deleted file mode 100644 index bec948b4..00000000 --- a/packages/sdk/src/patches/index.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -/* -Every instrumentation config patch should live in its own file in this -directory. - -It should export a single `patch` function of type -`Patch` where `InstrumentationConfig` is the config type -specific to the instrumentation being patched. -*/ - -import { type TextMapPropagator } from "@opentelemetry/api" -import { type InstrumentationConfig } from "@opentelemetry/instrumentation" - -import { type SwConfiguration } from "../config" -import * as awsLambda from "./aws-lambda" -import * as awsSdk from "./aws-sdk" -import * as bunyan from "./bunyan" -import * as fs from "./fs" -import * as http from "./http" -import * as mysql2 from "./mysql2" -import * as pg from "./pg" -import * as pino from "./pino" -import * as winston from "./winston" - -export interface SwPatchesConfiguration extends SwConfiguration { - responsePropagator: TextMapPropagator -} - -export type Patch = ( - config: Config, - options: SwPatchesConfiguration, -) => Config - -export const RESOURCE_SERVICE_NAME = "resource.service.name" - -const patches = { - "aws-lambda": awsLambda, - "aws-sdk": awsSdk, - bunyan, - fs, - http, - mysql2, - pg, - pino, - winston, -} as const -type Patches = typeof patches -type PatchableConfigs = { - [Module in keyof Patches as `@opentelemetry/instrumentation-${Module}`]?: Patches[Module] extends { - patch: Patch - } - ? Config - : never -} - -export function patch( - configs: PatchableConfigs, - options: SwPatchesConfiguration, -): PatchableConfigs { - const patched = { ...configs } - for (const [name, { patch }] of Object.entries(patches)) { - const prefixed = `@opentelemetry/instrumentation-${name}` as const - patched[prefixed] = (patch as Patch)( - configs[prefixed] ?? {}, - options, - ) - } - return patched -} diff --git a/packages/sdk/src/patches/mysql2.ts b/packages/sdk/src/patches/mysql2.ts deleted file mode 100644 index 60809245..00000000 --- a/packages/sdk/src/patches/mysql2.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { type MySQL2InstrumentationConfig } from "@opentelemetry/instrumentation-mysql2" - -import { type Patch } from "." - -export const patch: Patch = (config, options) => ({ - ...config, - addSqlCommenterCommentToQueries: - config.addSqlCommenterCommentToQueries ?? - options.insertTraceContextIntoQueries, -}) diff --git a/packages/sdk/src/patches/pg.ts b/packages/sdk/src/patches/pg.ts deleted file mode 100644 index 6cbb4335..00000000 --- a/packages/sdk/src/patches/pg.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { type PgInstrumentationConfig } from "@opentelemetry/instrumentation-pg" - -import { type Patch } from "." - -export const patch: Patch = (config, options) => ({ - ...config, - addSqlCommenterCommentToQueries: - config.addSqlCommenterCommentToQueries ?? - options.insertTraceContextIntoQueries, -}) diff --git a/packages/sdk/src/patches/pino.ts b/packages/sdk/src/patches/pino.ts deleted file mode 100644 index 743c69c1..00000000 --- a/packages/sdk/src/patches/pino.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { type PinoInstrumentationConfig } from "@opentelemetry/instrumentation-pino" - -import { type Patch, RESOURCE_SERVICE_NAME } from "." - -export const patch: Patch = (config, options) => ({ - ...config, - enabled: config.enabled ?? options.insertTraceContextIntoLogs, - disableLogSending: config.disableLogSending ?? !options.exportLogsEnabled, - logHook: (span, record, level) => { - record[RESOURCE_SERVICE_NAME] = options.serviceName - config.logHook?.(span, record, level) - }, -}) diff --git a/packages/sdk/src/patches/winston.ts b/packages/sdk/src/patches/winston.ts deleted file mode 100644 index e0fd25c3..00000000 --- a/packages/sdk/src/patches/winston.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { type WinstonInstrumentationConfig } from "@opentelemetry/instrumentation-winston" - -import { type Patch, RESOURCE_SERVICE_NAME } from "." - -export const patch: Patch = ( - config, - options, -) => ({ - ...config, - enabled: config.enabled ?? options.insertTraceContextIntoLogs, - disableLogSending: config.disableLogSending ?? !options.exportLogsEnabled, - logHook: (span, record) => { - record[RESOURCE_SERVICE_NAME] = options.serviceName - config.logHook?.(span, record) - }, -}) diff --git a/packages/sdk/src/reporter.ts b/packages/sdk/src/reporter.ts deleted file mode 100644 index 648fb71e..00000000 --- a/packages/sdk/src/reporter.ts +++ /dev/null @@ -1,133 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import * as process from "node:process" - -import { type AttributeValue } from "@opentelemetry/api" -import { type Resource } from "@opentelemetry/resources" -import { - SEMRESATTRS_PROCESS_COMMAND_ARGS, - SEMRESATTRS_PROCESS_COMMAND_LINE, - SEMRESATTRS_SERVICE_NAME, -} from "@opentelemetry/semantic-conventions" -import { oboe } from "@solarwinds-apm/bindings" -import { dependencies } from "@solarwinds-apm/dependencies" -import * as semver from "semver" - -import { type SwConfiguration } from "./config" - -export function createReporter(config: SwConfiguration): oboe.Reporter { - return new oboe.Reporter({ - service_key: `${config.token}:${config.serviceName}`, - host: config.collector ?? "", - certificates: config.certificate ?? "", - - hostname_alias: "", - log_level: config.oboeLogLevel, - log_file_path: "", - log_type: config.oboeLogType, - - max_transactions: -1, - max_flush_wait_time: -1, - events_flush_interval: -1, - max_request_size_bytes: -1, - - reporter: "ssl", - - buffer_size: -1, - trace_metrics: 1, - histogram_precision: -1, - token_bucket_capacity: -1, - token_bucket_rate: -1, - file_single: 0, - - ec2_metadata_timeout: -1, - grpc_proxy: config.proxy ?? "", - stdout_clear_nonblocking: 0, - metric_format: config.metricFormat ?? 2, - }) -} - -export function createServerlessApi(config: SwConfiguration): oboe.OboeAPI { - return new oboe.OboeAPI({ - logging_options: { - level: config.oboeLogLevel, - type: config.oboeLogType, - }, - }) -} - -export async function initMessage( - resource: Resource, - version: string, -): Promise> { - const libsVersions = Object.fromEntries( - Object.entries(process.versions) - .filter(([name]) => name !== "node") - .map(([name, version]) => [`Node.${name}.Version`, version!]), - ) - - const deps = await dependencies() - const depsVersions = Object.fromEntries( - [...deps].map(([name, versions]) => [ - `Node.${name}.Version`, - [...versions].sort(semver.compare).join(", "), - ]), - ) - - const resourceAttributes = Object.fromEntries( - Object.entries(resource.attributes) - .map<[string, AttributeValue | undefined]>(([name, value]) => - name === SEMRESATTRS_PROCESS_COMMAND_ARGS - ? [SEMRESATTRS_PROCESS_COMMAND_LINE, (value as string[]).join(" ")] - : [name, value], - ) - .filter( - ([name, value]) => - name !== SEMRESATTRS_SERVICE_NAME && - value !== undefined && - !Array.isArray(value), - ), - ) - - return { - ...depsVersions, - ...libsVersions, - ...resourceAttributes, - - __Init: true, - Layer: "nodejs", - Label: "single", - - "APM.Version": version, - "APM.Extension.Version": oboe.Config.getVersionString(), - } -} - -export function sendStatus( - reporter: oboe.Reporter, - data: Record, -): number { - const md = oboe.Metadata.makeRandom(true) - oboe.Context.set(md) - - const evt = md.createEvent() - for (const [k, v] of Object.entries(data)) { - evt.addInfo(k, v) - } - - return reporter.sendStatus(evt) -} diff --git a/packages/sdk/src/response-time-processor.ts b/packages/sdk/src/response-time-processor.ts deleted file mode 100644 index 4d6427a6..00000000 --- a/packages/sdk/src/response-time-processor.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { - NoopSpanProcessor, - type ReadableSpan, -} from "@opentelemetry/sdk-trace-base" - -import { type SwConfiguration } from "." -import { cache } from "./cache" -import { isEntrySpan } from "./context" -import { recordServerlessResponseTime } from "./metrics/serverless" - -export class SwResponseTimeProcessor extends NoopSpanProcessor { - constructor(private readonly config: SwConfiguration) { - super() - } - - override onEnd(span: ReadableSpan): void { - if (!isEntrySpan(span)) return - - const txname = cache.getTxname(span.spanContext(), this.config) - recordServerlessResponseTime(span, txname) - } -} diff --git a/packages/sdk/src/sampler.ts b/packages/sdk/src/sampler.ts deleted file mode 100644 index 4b8eefc9..00000000 --- a/packages/sdk/src/sampler.ts +++ /dev/null @@ -1,388 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { inspect } from "node:util" - -import { - type Attributes, - type Context, - createTraceState, - type DiagLogger, - type Link, - type SpanContext, - SpanKind, - trace, - type TraceState, -} from "@opentelemetry/api" -import { - type Sampler, - SamplingDecision, - type SamplingResult, -} from "@opentelemetry/sdk-trace-base" -import { - SEMATTRS_HTTP_SCHEME, - SEMATTRS_HTTP_TARGET, - SEMATTRS_NET_HOST_NAME, - SEMATTRS_NET_HOST_PORT, -} from "@opentelemetry/semantic-conventions" -import { oboe } from "@solarwinds-apm/bindings" - -import { type SwConfiguration } from "./config" -import { - COMMA_W3C, - EQUALS_W3C, - getTraceOptions, - type TraceOptions, - traceParent, - TRACESTATE_SW_KEY, - TRACESTATE_TRACE_OPTIONS_RESPONSE_KEY, -} from "./context" -import { OboeError } from "./error" -import { recordServerlessCounters } from "./metrics/serverless" - -const ATTRIBUTES_SW_KEYS_KEY = "SWKeys" -const ATTRIBUTES_TRACESTATE_CAPTURE_KEY = "sw.w3c.tracestate" - -const TRACE_OPTIONS_RESPONSE_AUTH = "auth" -const TRACE_OPTIONS_RESPONSE_TRIGGER = "trigger-trace" -const TRACE_OPTIONS_RESPONSE_IGNORED = "ignored" -const TRACE_OPTIONS_RESPONSE_TRIGGER_IGNORED = "ignored" -const TRACE_OPTIONS_RESPONSE_TRIGGER_NOT_REQUESTED = "not-requested" - -export class SwSampler implements Sampler { - private readonly oboeDecisionFunction: ( - options: oboe.DecisionOptions, - ) => oboe.DecisionResult - private readonly recordMetricsFunction: () => void - - constructor( - private readonly config: SwConfiguration, - private readonly logger: DiagLogger, - serverlessApi: oboe.OboeAPI | undefined, - ) { - if (serverlessApi) { - this.oboeDecisionFunction = - serverlessApi.getTracingDecision.bind(serverlessApi) - this.recordMetricsFunction = () => { - recordServerlessCounters(serverlessApi) - } - } else { - this.oboeDecisionFunction = oboe.Context.getDecisions - this.recordMetricsFunction = () => { - // noop - } - } - } - - shouldSample( - parentContext: Context, - _traceId: string, - spanName: string, - spanKind: SpanKind, - attributes: Attributes, - _links: Link[], - ): SamplingResult { - this.logger.debug("sampling", spanName, SpanKind[spanKind]) - - const parentSpanContext = trace.getSpanContext(parentContext) - const traceOptions = getTraceOptions(parentContext) - - const tracingMode = this.tracingMode(spanName, spanKind, attributes) - const decisions = this.oboeDecisions( - parentSpanContext, - traceOptions, - tracingMode, - ) - - if (decisions.status > oboe.TRACING_DECISIONS_OK) { - this.logger.warn( - "oboe decisions returned with an error status", - new OboeError( - "Context", - "getDecisions", - decisions.status, - decisions.status_msg, - ), - ) - return { decision: SamplingDecision.NOT_RECORD } - } else if (decisions.auth > oboe.TRACING_DECISIONS_AUTH_OK) { - this.logger.debug( - "oboe decisions auth returned with an error status", - new OboeError( - "Context", - "getDecisions", - decisions.auth, - decisions.auth_msg, - ), - ) - } - - const decision = SwSampler.otelSamplingDecisionFromOboe(decisions) - const traceState = SwSampler.traceState( - decisions, - parentSpanContext, - traceOptions, - ) - const newAttributes = SwSampler.attributes( - attributes, - decisions, - parentSpanContext, - traceOptions, - traceState, - ) - - this.recordMetricsFunction() - return { decision, traceState, attributes: newAttributes } - } - - toString(): string { - return `SwSampler ${inspect( - { triggerTraceEnabled: this.config.triggerTraceEnabled }, - { breakLength: Infinity, compact: true }, - )}` - } - - private oboeDecisions( - parentSpanContext: SpanContext | undefined, - traceOptions: TraceOptions | undefined, - tracingMode: oboe.DecisionOptions["custom_tracing_mode"], - ): oboe.DecisionResult { - let traceparent: string | null = null - if ( - parentSpanContext && - trace.isSpanContextValid(parentSpanContext) && - parentSpanContext.isRemote - ) { - traceparent = traceParent(parentSpanContext) - } - - const input: oboe.DecisionOptions = { - in_xtrace: traceparent, - custom_tracing_mode: tracingMode, - custom_trigger_mode: this.config.triggerTraceEnabled - ? oboe.TRIGGER_ENABLED - : oboe.TRIGGER_DISABLED, - request_type: traceOptions?.triggerTrace - ? oboe.REQUEST_TYPE_TRIGGER - : oboe.REQUEST_TYPE_REGULAR, - header_options: traceOptions?.header, - header_signature: traceOptions?.signature, - header_timestamp: traceOptions?.timestamp, - tracestate: parentSpanContext?.traceState?.get(TRACESTATE_SW_KEY), - } - this.logger.debug("tracing decision input", input) - const output = this.oboeDecisionFunction(input) - this.logger.debug("tracing decision output", output) - return output - } - - private tracingMode( - spanName: string, - spanKind: SpanKind, - attributes: Attributes, - ): oboe.DecisionOptions["custom_tracing_mode"] { - let base = oboe.SETTINGS_UNSET - if (this.config.tracingMode === true) { - base = oboe.TRACE_ENABLED - } else if (this.config.tracingMode === false) { - base = oboe.TRACE_DISABLED - } - - if (!this.config.transactionSettings) { - return base - } - - const kindName = SpanKind[spanKind] - - const httpScheme = attributes[SEMATTRS_HTTP_SCHEME]?.toString() - const netHostName = attributes[SEMATTRS_NET_HOST_NAME]?.toString() - const netHostPort = attributes[SEMATTRS_NET_HOST_PORT]?.toString() - const httpTarget = attributes[SEMATTRS_HTTP_TARGET]?.toString() - - let identifier: string - if (httpScheme && netHostName && httpTarget) { - identifier = `${httpScheme}://${netHostName}` - if (netHostPort) { - identifier += `:${netHostPort}` - } - identifier += httpTarget - } else { - identifier = `${kindName}:${spanName}` - } - - for (const { tracing, matcher } of this.config.transactionSettings) { - if (matcher(identifier)) { - return tracing ? oboe.TRACE_ENABLED : oboe.TRACE_DISABLED - } - } - - return base - } - - private static otelSamplingDecisionFromOboe( - decision: oboe.DecisionResult, - ): SamplingDecision { - if (decision.do_sample) { - return SamplingDecision.RECORD_AND_SAMPLED - } else if (decision.do_metrics) { - return SamplingDecision.RECORD - } else { - return SamplingDecision.NOT_RECORD - } - } - - private static traceState( - decisions: oboe.DecisionResult, - parentSpanContext: SpanContext | undefined, - traceOptions: TraceOptions | undefined, - ): TraceState { - if (!parentSpanContext || !trace.isSpanContextValid(parentSpanContext)) { - return this.updateTraceState( - createTraceState(), - decisions, - parentSpanContext, - traceOptions, - ) - } - - const traceState = parentSpanContext.traceState ?? createTraceState() - return this.updateTraceState( - traceState, - decisions, - parentSpanContext, - traceOptions, - ) - } - - private static updateTraceState( - traceState: TraceState, - decisions: oboe.DecisionResult, - parentSpanContext: SpanContext | undefined, - traceOptions: TraceOptions | undefined, - ): TraceState { - if (traceOptions) { - traceState = traceState.set( - TRACESTATE_TRACE_OPTIONS_RESPONSE_KEY, - this.traceOptionsResponse(decisions, parentSpanContext, traceOptions), - ) - } - - return traceState - } - - private static traceOptionsResponse( - decisions: oboe.DecisionResult, - parentSpanContext: SpanContext | undefined, - traceOptions: TraceOptions, - ): string { - const response: string[] = [] - - if (traceOptions.signature && decisions.auth_msg) { - response.push( - [TRACE_OPTIONS_RESPONSE_AUTH, decisions.auth_msg].join(EQUALS_W3C), - ) - } - - if (decisions.auth <= 0) { - let triggerMessage: string - if (traceOptions.triggerTrace) { - if ( - parentSpanContext && - trace.isSpanContextValid(parentSpanContext) && - parentSpanContext.isRemote && - decisions.type === 0 - ) { - triggerMessage = TRACE_OPTIONS_RESPONSE_TRIGGER_IGNORED - } else { - triggerMessage = decisions.status_msg - } - } else { - triggerMessage = TRACE_OPTIONS_RESPONSE_TRIGGER_NOT_REQUESTED - } - response.push( - [TRACE_OPTIONS_RESPONSE_TRIGGER, triggerMessage].join(EQUALS_W3C), - ) - } - - if (traceOptions.ignored.length > 0) { - response.push( - [ - TRACE_OPTIONS_RESPONSE_IGNORED, - traceOptions.ignored.map(([k]) => k).join(COMMA_W3C), - ].join(EQUALS_W3C), - ) - } - - return response.join(";") - } - - private static attributes( - attributes: Attributes, - decisions: oboe.DecisionResult, - parentSpanContext: SpanContext | undefined, - traceOptions: TraceOptions | undefined, - traceState: TraceState, - ): Attributes | undefined { - if (!decisions.do_sample) { - return undefined - } - - const newAttributes = { ...attributes } - - if (traceOptions?.swKeys) { - newAttributes[ATTRIBUTES_SW_KEYS_KEY] = traceOptions.swKeys - } - - if (traceOptions?.custom) { - for (const [k, v] of Object.entries(traceOptions.custom)) { - newAttributes[k] = v - } - } - - newAttributes.BucketCapacity = decisions.bucket_cap - newAttributes.BucketRate = decisions.bucket_rate - newAttributes.SampleRate = decisions.sample_rate - newAttributes.SampleSource = decisions.sample_source - - const parentSw = parentSpanContext?.traceState?.get(TRACESTATE_SW_KEY) - if (parentSw && parentSpanContext?.isRemote) { - newAttributes["sw.tracestate_parent_id"] = parentSw.split("-")[0] - } - - if (parentSpanContext && trace.isSpanContextValid(parentSpanContext)) { - let attrTraceState = traceState - - const capture = attributes[ATTRIBUTES_TRACESTATE_CAPTURE_KEY] - if (capture && typeof capture === "string") { - attrTraceState = this.updateTraceState( - createTraceState(capture), - decisions, - parentSpanContext, - traceOptions, - ) - } - - attrTraceState = attrTraceState.unset( - TRACESTATE_TRACE_OPTIONS_RESPONSE_KEY, - ) - - newAttributes[ATTRIBUTES_TRACESTATE_CAPTURE_KEY] = - attrTraceState.serialize() - } - - return Object.freeze(newAttributes) - } -} diff --git a/packages/sdk/src/trace-context-options-propagator.ts b/packages/sdk/src/trace-context-options-propagator.ts deleted file mode 100644 index ef55c0a0..00000000 --- a/packages/sdk/src/trace-context-options-propagator.ts +++ /dev/null @@ -1,199 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { - type Context, - createTraceState, - type DiagLogger, - type TextMapGetter, - type TextMapPropagator, - type TextMapSetter, - trace, -} from "@opentelemetry/api" -import { W3CTraceContextPropagator } from "@opentelemetry/core" - -import { - setTraceOptions, - swValue, - type TraceOptions, - TRACESTATE_SW_KEY, - TRACESTATE_TRACE_OPTIONS_RESPONSE_KEY, -} from "./context" -import { firstIfArray } from "./util" - -const TRACESTATE_HEADER = "tracestate" -const TRACE_OPTIONS_HEADER = "x-trace-options" -const TRACE_OPTIONS_SIGNATURE_HEADER = "x-trace-options-signature" - -const TRIGGER_TRACE_KEY = "trigger-trace" -const TIMESTAMP_KEY = "ts" -const SW_KEYS_KEY = "sw-keys" - -const CUSTOM_KEY_REGEX = /^custom-[^\s]+$/ - -export class SwTraceContextOptionsPropagator - extends W3CTraceContextPropagator - implements TextMapPropagator -{ - constructor(private readonly logger: DiagLogger) { - super() - } - - override inject( - context: Context, - carrier: unknown, - setter: TextMapSetter, - ): void { - const tempCarrier: Record = {} - const tempGetterSetter: TextMapGetter & - TextMapSetter = { - get: (carrier, key) => carrier[key.toLowerCase()], - set: (carrier, key, value) => (carrier[key.toLowerCase()] = value), - keys: (carrier) => Object.keys(carrier), - } - super.inject(context, tempCarrier, tempGetterSetter) - - for (const key of tempGetterSetter.keys(tempCarrier)) { - setter.set( - carrier, - key, - firstIfArray(tempGetterSetter.get(tempCarrier, key))!, - ) - } - - const spanContext = trace.getSpanContext(context) - if (!spanContext || !trace.isSpanContextValid(spanContext)) { - return - } - - const tracestateHeader = firstIfArray( - tempGetterSetter.get(tempCarrier, TRACESTATE_HEADER), - ) - const sw = swValue(spanContext) - let traceState = tracestateHeader - ? createTraceState(tracestateHeader) - : createTraceState() - - traceState = traceState.set(TRACESTATE_SW_KEY, sw) - traceState = traceState.unset(TRACESTATE_TRACE_OPTIONS_RESPONSE_KEY) - - setter.set(carrier, TRACESTATE_HEADER, traceState.serialize()) - } - - override extract( - context: Context, - carrier: unknown, - getter: TextMapGetter, - ): Context { - context = super.extract(context, carrier, getter) - - const header = firstIfArray(getter.get(carrier, TRACE_OPTIONS_HEADER)) - const signature = firstIfArray( - getter.get(carrier, TRACE_OPTIONS_SIGNATURE_HEADER), - ) - - if (!header) { - return context - } - - return setTraceOptions(context, this.parseTraceOptions(header, signature)) - } - - private parseTraceOptions(header: string, signature?: string): TraceOptions { - const traceOptions: TraceOptions = { - header, - signature, - custom: {}, - ignored: [], - } - - const kvs = header - .split(";") - .filter((kv) => kv.length > 0) - .map<[string, string | undefined]>((kv) => { - const [k, ...vs] = kv.split("=").map((s) => s.trim()) - return [k!, vs.length > 0 ? vs.join("=") : undefined] - }) - .filter(([k]) => k.length > 0) - for (const [k, v] of kvs) { - if (k === TRIGGER_TRACE_KEY) { - if (v !== undefined) { - this.logger.debug( - "invalid trace option for trigger trace, should not have a value", - ) - - traceOptions.ignored.push([k, v]) - continue - } - - traceOptions.triggerTrace = true - } else if (k === TIMESTAMP_KEY) { - if (v === undefined || traceOptions.timestamp !== undefined) { - this.logger.debug( - "invalid trace option for timestamp, should have a value and only be provided once", - ) - - traceOptions.ignored.push([k, v]) - continue - } - - const ts = Number.parseInt(v) - if (Number.isNaN(ts)) { - this.logger.debug( - "invalid trace option for timestamp, should be an integer", - ) - - traceOptions.ignored.push([k, v]) - continue - } - - traceOptions.timestamp = ts - } else if (k === SW_KEYS_KEY) { - if (v === undefined || traceOptions.swKeys !== undefined) { - this.logger.debug( - "invalid trace option for sw keys, should have a value and only be provided once", - ) - continue - } - - traceOptions.swKeys = v - } else if (CUSTOM_KEY_REGEX.test(k)) { - if (v === undefined || traceOptions.custom[k] !== undefined) { - this.logger.debug( - `invalid trace option for custom key ${k}, should have a value and only be provided once`, - ) - - traceOptions.ignored.push([k, v]) - continue - } - - traceOptions.custom[k] = v - } else { - traceOptions.ignored.push([k, v]) - } - } - - return traceOptions - } - - override fields(): string[] { - return [ - ...super.fields(), - TRACE_OPTIONS_HEADER, - TRACE_OPTIONS_SIGNATURE_HEADER, - ] - } -} diff --git a/packages/sdk/src/trace-options-response-propagator.ts b/packages/sdk/src/trace-options-response-propagator.ts deleted file mode 100644 index 370e4f0a..00000000 --- a/packages/sdk/src/trace-options-response-propagator.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { - type Context, - type TextMapGetter, - type TextMapPropagator, - type TextMapSetter, - trace, -} from "@opentelemetry/api" - -import { - COMMA_W3C, - EQUALS_W3C, - traceParent, - TRACESTATE_TRACE_OPTIONS_RESPONSE_KEY, -} from "./context" - -const TRACE_PARENT_HEADER = "x-trace" -const TRACE_OPTIONS_REPONSE_HEADER = "x-trace-options-response" -const EXPOSE_HEADERS_HEADER = "Access-Control-Expose-Headers" - -export class SwTraceOptionsResponsePropagator - implements TextMapPropagator -{ - inject( - context: Context, - carrier: unknown, - setter: TextMapSetter, - ): void { - const spanContext = trace.getSpanContext(context) - if (!spanContext || !trace.isSpanContextValid(spanContext)) { - return - } - - const exposedHeaders = [] - - setter.set(carrier, TRACE_PARENT_HEADER, traceParent(spanContext)) - exposedHeaders.push(TRACE_PARENT_HEADER) - - const w3cTraceOptionsResponse = spanContext.traceState?.get( - TRACESTATE_TRACE_OPTIONS_RESPONSE_KEY, - ) - if (w3cTraceOptionsResponse) { - const traceOptionsResponse = w3cTraceOptionsResponse - .replaceAll(EQUALS_W3C, "=") - .replaceAll(COMMA_W3C, ",") - - setter.set(carrier, TRACE_OPTIONS_REPONSE_HEADER, traceOptionsResponse) - exposedHeaders.push(TRACE_OPTIONS_REPONSE_HEADER) - } - - setter.set(carrier, EXPOSE_HEADERS_HEADER, exposedHeaders.join(", ")) - } - - fields(): string[] { - return [ - TRACE_PARENT_HEADER, - TRACE_OPTIONS_REPONSE_HEADER, - EXPOSE_HEADERS_HEADER, - ] - } - - extract( - context: Context, - _carrier: unknown, - _getter: TextMapGetter, - ): Context { - return context - } -} diff --git a/packages/sdk/src/transaction-name-processor.ts b/packages/sdk/src/transaction-name-processor.ts deleted file mode 100644 index 834af125..00000000 --- a/packages/sdk/src/transaction-name-processor.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { env } from "node:process" - -import { - NoopSpanProcessor, - type ReadableSpan, -} from "@opentelemetry/sdk-trace-base" -import { IS_AWS_LAMBDA } from "@solarwinds-apm/module" - -import { cache } from "./cache" -import { isEntrySpan } from "./context" - -export class SwTransactionNameProcessor extends NoopSpanProcessor { - override onEnd(span: ReadableSpan): void { - if (!isEntrySpan(span)) return - - const spanCache = cache.getOrInit(span.spanContext()) - spanCache.txname = SwTransactionNameProcessor.txname(span) - } - - private static txname(span: ReadableSpan): string { - if (IS_AWS_LAMBDA) { - return env.AWS_LAMBDA_FUNCTION_NAME! - } else { - return span.name - } - } -} diff --git a/packages/sdk/src/util.ts b/packages/sdk/src/util.ts deleted file mode 100644 index 3fbd8555..00000000 --- a/packages/sdk/src/util.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -export function firstIfArray(value: T | T[] | undefined): T | undefined { - if (Array.isArray(value)) { - return value[0] - } else { - return value - } -} diff --git a/packages/sdk/test/cache.test.ts b/packages/sdk/test/cache.test.ts deleted file mode 100644 index e48d0b7a..00000000 --- a/packages/sdk/test/cache.test.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { describe, expect, it } from "@solarwinds-apm/test" - -import { cache } from "../src/cache" -import { type SwConfiguration } from "../src/config" -import * as mock from "./mock" - -describe("Cache", () => { - describe("getTxname", () => { - it("uses txname when present", () => { - const ctx = mock.spanContext() - cache.getOrInit(ctx, { txname: "txname" }) - - const txname = cache.getTxname(ctx, {} as SwConfiguration) - expect(txname).to.equal("txname") - }) - - it("prefers config value over txname", () => { - const ctx = mock.spanContext() - cache.getOrInit(ctx, { txname: "txname" }) - - const txname = cache.getTxname(ctx, { - transactionName: "transactionName", - } as SwConfiguration) - expect(txname).to.equal("transactionName") - }) - - it("prefers txnameCustom over config value", () => { - const ctx = mock.spanContext() - cache.getOrInit(ctx, { txname: "txname", txnameCustom: "txnameCustom" }) - - const txname = cache.getTxname(ctx, { - transactionName: "transactionName", - } as SwConfiguration) - expect(txname).to.equal("txnameCustom") - }) - }) -}) diff --git a/packages/sdk/test/compound-span-processor.test.ts b/packages/sdk/test/compound-span-processor.test.ts deleted file mode 100644 index 40bd5cf9..00000000 --- a/packages/sdk/test/compound-span-processor.test.ts +++ /dev/null @@ -1,99 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { type Context, ROOT_CONTEXT } from "@opentelemetry/api" -import { - InMemorySpanExporter, - type ReadableSpan, - type Span, - type SpanProcessor, -} from "@opentelemetry/sdk-trace-base" -import { describe, expect, it } from "@solarwinds-apm/test" - -import { CompoundSpanProcessor } from "../src/compound-processor" -import * as mock from "./mock" - -const forceFlush: symbol[] = [] -const onStart: [symbol, Span, Context][] = [] -const onEnd: [symbol, ReadableSpan][] = [] -const shutdown: symbol[] = [] - -class TestSpanProcessor implements SpanProcessor { - constructor(readonly id: symbol) {} - forceFlush(): Promise { - forceFlush.push(this.id) - return Promise.resolve() - } - onStart(span: Span, parentContext: Context): void { - onStart.push([this.id, span, parentContext]) - } - onEnd(span: ReadableSpan): void { - onEnd.push([this.id, span]) - } - shutdown(): Promise { - shutdown.push(this.id) - return Promise.resolve() - } -} - -const p1 = new TestSpanProcessor(Symbol("p1")) -const p2 = new TestSpanProcessor(Symbol("p2")) - -const exporter = new InMemorySpanExporter() -const processor = new CompoundSpanProcessor(exporter, [p1, p2], mock.logger()) - -describe("CompoundSpanProcessor", () => { - describe("forceFlush", () => { - it("flushes in any order", async () => { - await processor.forceFlush() - expect(forceFlush).to.include(p1.id) - expect(forceFlush).to.include(p2.id) - }) - }) - - describe("onStart", () => { - it("calls processors in order", () => { - const span = mock.span() - const parentContext = ROOT_CONTEXT - - processor.onStart(span, parentContext) - expect(onStart).to.deep.equal([ - [p1.id, span, parentContext], - [p2.id, span, parentContext], - ]) - }) - }) - - describe("onEnd", () => { - it("calls processors in reverse order", () => { - const span = mock.readableSpan() - - processor.onEnd(span) - expect(onEnd).to.deep.equal([ - [p2.id, span], - [p1.id, span], - ]) - }) - }) - - describe("shutdown", () => { - it("shutdowns in any order", async () => { - await processor.shutdown() - expect(shutdown).to.include(p1.id) - expect(shutdown).to.include(p2.id) - }) - }) -}) diff --git a/packages/sdk/test/context.test.ts b/packages/sdk/test/context.test.ts deleted file mode 100644 index beb648f4..00000000 --- a/packages/sdk/test/context.test.ts +++ /dev/null @@ -1,141 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { - context, - ROOT_CONTEXT, - type Span, - trace, - TraceFlags, -} from "@opentelemetry/api" -import { describe, expect, it, otel } from "@solarwinds-apm/test" - -import { cache } from "../src/cache" -import { - getTraceOptions, - parentSpanContext, - setTraceOptions, - setTransactionName, - swValue, - traceParent, -} from "../src/context" -import { SwParentInfoSpanProcessor } from "../src/parent-info-processor" -import * as mock from "./mock" - -describe("getTraceOptions", () => { - it("returns undefined if no trace options are set", () => { - expect(getTraceOptions(ROOT_CONTEXT)).to.be.undefined - }) - - it("returns the trace options if they are set", () => { - const traceOptions = mock.traceOptions() - - const context = setTraceOptions(ROOT_CONTEXT, traceOptions) - expect(getTraceOptions(context)).to.loosely.deep.equal(traceOptions) - }) -}) - -describe("swValue", () => { - it("returns the right value for NONE flags", () => { - const spanId = mock.spanId() - const spanContext = mock.spanContext({ - spanId, - traceFlags: TraceFlags.NONE, - }) - - expect(swValue(spanContext)).to.equal(`${spanId}-00`) - }) - - it("returns the right value for SAMPLED flags", () => { - const spanId = mock.spanId() - const spanContext = mock.spanContext({ - spanId, - traceFlags: TraceFlags.SAMPLED, - }) - - expect(swValue(spanContext)).to.equal(`${spanId}-01`) - }) -}) - -describe("traceParent", () => { - it("returns the right value", () => { - const traceId = mock.traceId() - const spanContext = mock.spanContext({ traceId }) - - expect(traceParent(spanContext)).to.equal( - `00-${traceId}-${swValue(spanContext)}`, - ) - }) -}) - -describe("parentSpanContext", () => { - it("returns undefined for root spans", () => { - const readableSpan = mock.readableSpan({ parentSpanId: undefined }) - - expect(parentSpanContext(readableSpan)).to.be.undefined - }) - - it("returns the valid span context for spans with a parent", () => { - const traceId = mock.traceId() - const parentSpanId = mock.spanId() - const spanContext = mock.spanContext({ traceId }) - const readableSpan = mock.readableSpan({ - parentSpanId, - spanContext: () => spanContext, - }) - - expect(parentSpanContext(readableSpan)).to.loosely.deep.equal({ - ...spanContext, - spanId: parentSpanId, - }) - }) -}) - -describe("setTransactionName", () => { - it("returns false if there is no active span", () => { - expect(setTransactionName(ROOT_CONTEXT, "foo")).to.be.false - }) - - it("returns false if there is no cache entry", () => { - expect(setTransactionName(trace.setSpan(ROOT_CONTEXT, mock.span()), "foo")) - .to.be.false - }) - - it("returns true and sets the transaction name of the root span if there is a cache entry", async () => { - await otel.reset({ - trace: { processors: [new SwParentInfoSpanProcessor()] }, - }) - - const txname = "foo" - - const tracer = trace.getTracer("test") - - let parent: Span - tracer.startActiveSpan("parent", (s) => { - parent = s - - tracer.startActiveSpan("child", (s) => { - expect(setTransactionName(context.active(), txname)).to.be.true - - s.end() - }) - - s.end() - }) - - expect(cache.get(parent!.spanContext())?.txnameCustom).to.equal(txname) - }) -}) diff --git a/packages/sdk/test/mock.ts b/packages/sdk/test/mock.ts deleted file mode 100644 index 28d0cb6d..00000000 --- a/packages/sdk/test/mock.ts +++ /dev/null @@ -1,214 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { randomBytes, randomInt } from "node:crypto" - -import { - type Attributes, - type Context, - createTraceState, - type DiagLogger, - DiagLogLevel, - type SpanContext, - SpanKind, - type SpanOptions, - TraceFlags, - type TraceState, -} from "@opentelemetry/api" -import { hrTime, type InstrumentationScope } from "@opentelemetry/core" -import { Resource } from "@opentelemetry/resources" -import { - BasicTracerProvider, - type ReadableSpan, - type Span, - Tracer, - type TracerConfig, -} from "@opentelemetry/sdk-trace-base" -import { oboe } from "@solarwinds-apm/bindings" - -import { type SwConfiguration } from "../src" -import { type TraceOptions } from "../src/context" - -export function pick(choices: T[]): T { - return choices[randomInt(choices.length)]! -} - -export function config( - override: Partial = {}, -): SwConfiguration { - const base: SwConfiguration = { - token: "", - serviceName: "", - enabled: true, - oboeLogLevel: 6, - oboeLogType: oboe.INIT_LOG_TYPE_NULL, - otelLogLevel: DiagLogLevel.ALL, - runtimeMetrics: true, - triggerTraceEnabled: true, - insertTraceContextIntoLogs: true, - insertTraceContextIntoQueries: true, - } - - return { ...base, ...override } -} - -export function traceId(): string { - return randomBytes(16).toString("hex") -} - -export function spanId(): string { - return randomBytes(8).toString("hex") -} - -export function traceOptions( - override: Partial = {}, -): TraceOptions { - const base: TraceOptions = { - header: "", - custom: {}, - ignored: [], - } - - return { ...base, ...override } -} - -export function spanContext(override: Partial = {}): SpanContext { - const base: SpanContext = { - traceId: traceId(), - spanId: spanId(), - traceFlags: TraceFlags.NONE, - } - - return { ...base, ...override } -} - -export function resource(attributes: Attributes = {}): Resource { - return new Resource(attributes) -} - -export function instrumentationScope( - override: Partial = {}, -): InstrumentationScope { - const base: InstrumentationScope = { - name: pick(["http", "fs", "crypto"]), - } - - return { ...base, ...override } -} - -export function tracerConfig( - override: Partial = {}, -): TracerConfig { - const base: TracerConfig = {} - - return { ...base, ...override } -} - -export function tracer(is?: InstrumentationScope, tc?: TracerConfig): Tracer { - is ??= instrumentationScope() - tc ??= tracerConfig() - - return new Tracer(is, tc, new BasicTracerProvider(tc)) -} - -export function spanOptions(override: Partial = {}): SpanOptions { - const base: SpanOptions = {} - - return { ...base, ...override } -} - -export function traceState(raw?: string): TraceState { - return createTraceState(raw) -} - -export function span( - t?: Tracer, - name?: string, - so?: SpanOptions, - context?: Context, -): Span { - t ??= tracer() - name ??= pick(["readFile", "writeFile", "connect", "listen", "send", "recv"]) - so ??= spanOptions() - - return t.startSpan(name, so, context) as Span -} - -export function readableSpan( - override: Partial = {}, -): ReadableSpan { - const sc = spanContext() - const base: ReadableSpan = { - name: pick(["readFile", "writeFile", "connect", "listen", "send", "recv"]), - kind: pick([SpanKind.INTERNAL, SpanKind.CLIENT, SpanKind.SERVER]), - spanContext: () => sc, - startTime: hrTime(), - endTime: hrTime(), - status: { code: 0 }, - attributes: {}, - links: [], - events: [], - duration: hrTime(), - ended: pick([true, false]), - resource: new Resource({}), - instrumentationLibrary: instrumentationScope(), - droppedAttributesCount: 0, - droppedEventsCount: 0, - droppedLinksCount: 0, - } - - return { ...base, ...override } -} - -export function oboeDecisions( - override: Partial = {}, -): oboe.DecisionResult { - const base: oboe.DecisionResult = { - do_metrics: pick([0, 1]), - do_sample: pick([0, 1]), - sample_rate: 0, - sample_source: 0, - bucket_rate: 0, - bucket_cap: 0, - type: 0, - auth: 0, - status_msg: "", - auth_msg: "", - status: 0, - } - - return { ...base, ...override } -} - -export function logger(): DiagLogger { - return { - error: () => { - /* noop */ - }, - warn: () => { - /* noop */ - }, - info: () => { - /* noop */ - }, - debug: () => { - /* noop */ - }, - verbose: () => { - /* noop */ - }, - } -} diff --git a/packages/sdk/test/reporter.test.ts b/packages/sdk/test/reporter.test.ts deleted file mode 100644 index 5dd0c70e..00000000 --- a/packages/sdk/test/reporter.test.ts +++ /dev/null @@ -1,101 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { Resource } from "@opentelemetry/resources" -import { - SEMRESATTRS_PROCESS_COMMAND_ARGS, - SEMRESATTRS_PROCESS_COMMAND_LINE, - SEMRESATTRS_SERVICE_NAME, -} from "@opentelemetry/semantic-conventions" -import { describe, expect, it } from "@solarwinds-apm/test" - -import { initMessage } from "../src/reporter" - -describe("initMessage", () => { - it("has right basic properties", async () => { - const message = await initMessage(new Resource({}), "1.0.0") - - expect(message).to.include({ - __Init: true, - Layer: "nodejs", - Label: "single", - }) - expect(message).to.include.keys(["APM.Version", "APM.Extension.Version"]) - }) - - it("forwards basic resource properties", async () => { - const props = { - s: "string", - n: 2, - b: true, - } - const message = await initMessage(new Resource(props), "1.0.0") - - expect(message).to.include(props) - }) - - it("doesn't forward service name", async () => { - const message = await initMessage( - new Resource({ [SEMRESATTRS_SERVICE_NAME]: "value" }), - "1.0.0", - ) - - expect(message).not.to.have.key(SEMRESATTRS_SERVICE_NAME) - }) - - it("doesn't forward array or undefined resource properties", async () => { - const message = await initMessage( - new Resource({ - array: [], - undefined: undefined, - }), - "1.0.0", - ) - - expect(message).not.to.have.any.keys(["array", "undefined"]) - }) - - it("converts process command args to command line", async () => { - const message = await initMessage( - new Resource({ - [SEMRESATTRS_PROCESS_COMMAND_ARGS]: ["node", "index.js"], - }), - "1.0.0", - ) - - expect(message).to.include({ - [SEMRESATTRS_PROCESS_COMMAND_LINE]: "node index.js", - }) - expect(message).not.to.have.key(SEMRESATTRS_PROCESS_COMMAND_ARGS) - }) - - it("doesn't override base attributes with resource attributes", async () => { - const message = await initMessage( - new Resource({ - __Init: false, - Layer: "python", - Label: "multiple", - }), - "1.0.0", - ) - - expect(message).to.include({ - __Init: true, - Layer: "nodejs", - Label: "single", - }) - }) -}) diff --git a/packages/sdk/test/sampler.test.ts b/packages/sdk/test/sampler.test.ts deleted file mode 100644 index 1ec4d377..00000000 --- a/packages/sdk/test/sampler.test.ts +++ /dev/null @@ -1,433 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { SpanKind } from "@opentelemetry/api" -import { SamplingDecision } from "@opentelemetry/sdk-trace-base" -import { - SEMATTRS_HTTP_SCHEME, - SEMATTRS_HTTP_TARGET, - SEMATTRS_NET_HOST_NAME, -} from "@opentelemetry/semantic-conventions" -import { oboe } from "@solarwinds-apm/bindings" -import { describe, expect, it } from "@solarwinds-apm/test" - -import { swValue } from "../src/context" -import { SwSampler } from "../src/sampler" -import * as mock from "./mock" - -describe("SwSampler", () => { - const tracingMode = "tracingMode" - describe(tracingMode, () => { - it("is unset when no config or transaction settings", () => { - const sampler = new SwSampler( - mock.config({ tracingMode: undefined, transactionSettings: undefined }), - mock.logger(), - undefined, - ) - - const result = sampler[tracingMode]("name", SpanKind.SERVER, {}) - expect(result).to.equal(oboe.SETTINGS_UNSET) - }) - - it("is enabled when config is true and no transaction settings", () => { - const sampler = new SwSampler( - mock.config({ tracingMode: true, transactionSettings: undefined }), - mock.logger(), - undefined, - ) - - const result = sampler[tracingMode]("name", SpanKind.SERVER, {}) - expect(result).to.equal(oboe.TRACE_ENABLED) - }) - - it("is disabled when config is false and no transaction settings", () => { - const sampler = new SwSampler( - mock.config({ tracingMode: false, transactionSettings: undefined }), - mock.logger(), - undefined, - ) - - const result = sampler[tracingMode]("name", SpanKind.SERVER, {}) - expect(result).to.equal(oboe.TRACE_DISABLED) - }) - - it("is unset when no config no transaction setting matches", () => { - const settings = [{ tracing: false, matcher: () => false }] - const sampler = new SwSampler( - mock.config({ tracingMode: undefined, transactionSettings: settings }), - mock.logger(), - undefined, - ) - - const result = sampler[tracingMode]("name", SpanKind.SERVER, {}) - expect(result).to.equal(oboe.SETTINGS_UNSET) - }) - - it("is enabled when config is true and no transaction setting matches", () => { - const settings = [{ tracing: true, matcher: () => false }] - const sampler = new SwSampler( - mock.config({ tracingMode: true, transactionSettings: settings }), - mock.logger(), - undefined, - ) - - const result = sampler[tracingMode]("name", SpanKind.SERVER, {}) - expect(result).to.equal(oboe.TRACE_ENABLED) - }) - - it("is disabled when config is false and no transaction setting matches", () => { - const settings = [{ tracing: false, matcher: () => true }] - const sampler = new SwSampler( - mock.config({ tracingMode: false, transactionSettings: settings }), - mock.logger(), - undefined, - ) - - const result = sampler[tracingMode]("name", SpanKind.SERVER, {}) - expect(result).to.equal(oboe.TRACE_DISABLED) - }) - - it("is enabled if config is disabled but matching transaction setting is enabled", () => { - const settings = [{ tracing: true, matcher: () => true }] - const sampler = new SwSampler( - mock.config({ tracingMode: false, transactionSettings: settings }), - mock.logger(), - undefined, - ) - - const result = sampler[tracingMode]("name", SpanKind.SERVER, {}) - expect(result).to.equal(oboe.TRACE_ENABLED) - }) - - it("is disabled if config is enabled but matching transaction setting is disabled", () => { - const settings = [{ tracing: false, matcher: () => true }] - const sampler = new SwSampler( - mock.config({ tracingMode: true, transactionSettings: settings }), - mock.logger(), - undefined, - ) - - const result = sampler[tracingMode]("name", SpanKind.SERVER, {}) - expect(result).to.equal(oboe.TRACE_DISABLED) - }) - - it("respects the first matching transaction setting for http spans", () => { - const target = "/auth" - const settings = [ - { tracing: false, matcher: (url: string) => url.endsWith(target) }, - { tracing: true, matcher: () => true }, - ] - const attributes = { - [SEMATTRS_HTTP_SCHEME]: "http", - [SEMATTRS_NET_HOST_NAME]: "localhost", - [SEMATTRS_HTTP_TARGET]: target, - } - - const sampler = new SwSampler( - mock.config({ transactionSettings: settings }), - mock.logger(), - undefined, - ) - - const result = sampler[tracingMode]("name", SpanKind.SERVER, attributes) - expect(result).to.equal(oboe.TRACE_DISABLED) - }) - - it("respects the first matching transaction setting for non-http spans", () => { - const name = "name" - const kind = SpanKind.SERVER - const settings = [ - { - tracing: true, - matcher: (id: string) => id === `${SpanKind[kind]}:${name}`, - }, - { tracing: false, matcher: () => true }, - ] - const sampler = new SwSampler( - mock.config({ transactionSettings: settings }), - mock.logger(), - undefined, - ) - - const result = sampler[tracingMode](name, kind, {}) - expect(result).to.equal(oboe.TRACE_ENABLED) - }) - }) - - const otelSamplingDecisionFromOboe = "otelSamplingDecisionFromOboe" - describe(otelSamplingDecisionFromOboe, () => { - it("records and samples if do_sample and do_metrics are set", () => { - const decision = SwSampler[otelSamplingDecisionFromOboe]( - mock.oboeDecisions({ do_sample: 1, do_metrics: 1 }), - ) - expect(decision).to.equal(SamplingDecision.RECORD_AND_SAMPLED) - }) - - it("records and samples if do_sample is set and do_metrics is not set", () => { - const decision = SwSampler[otelSamplingDecisionFromOboe]( - mock.oboeDecisions({ - do_sample: 1, - do_metrics: 0, - }), - ) - expect(decision).to.equal(SamplingDecision.RECORD_AND_SAMPLED) - }) - - it("only records if do_sample is not set and do_metrics is set", () => { - const decision = SwSampler[otelSamplingDecisionFromOboe]( - mock.oboeDecisions({ - do_sample: 0, - do_metrics: 1, - }), - ) - expect(decision).to.equal(SamplingDecision.RECORD) - }) - - it("doesn't record or sample if do_sample and do_metrics are not set", () => { - const decision = SwSampler[otelSamplingDecisionFromOboe]( - mock.oboeDecisions({ - do_sample: 0, - do_metrics: 0, - }), - ) - expect(decision).to.equal(SamplingDecision.NOT_RECORD) - }) - }) - - const traceState = "traceState" - describe(traceState, () => { - it("preserves parent trace state", () => { - const decisions = mock.oboeDecisions() - const parentTraceState = mock.traceState("key=value") - const parentContext = mock.spanContext({ traceState: parentTraceState }) - - const result = SwSampler[traceState](decisions, parentContext, undefined) - - expect(result.get("key")).to.equal("value") - }) - }) - - const updateTraceState = "updateTraceState" - describe(updateTraceState, () => { - it("sets trace options response when present", () => { - const old = mock.traceState() - const decisions = mock.oboeDecisions() - const traceOptions = mock.traceOptions() - - const updated = SwSampler[updateTraceState]( - old, - decisions, - undefined, - traceOptions, - ) - - expect(updated.get("xtrace_options_response")).to.deep.equal( - SwSampler[traceOptionsResponse](decisions, undefined, traceOptions), - ) - }) - }) - - const traceOptionsResponse = "traceOptionsResponse" - describe(traceOptionsResponse, () => { - it("contains auth message when present with signature", () => { - const authMsg = "this is a message" - const decisions = mock.oboeDecisions({ - auth_msg: authMsg, - }) - const traceOptions = mock.traceOptions({ - signature: "signature", - }) - - const response = SwSampler[traceOptionsResponse]( - decisions, - undefined, - traceOptions, - ) - - expect(response).to.include(`auth####${authMsg}`) - }) - - it("contains ignored value when trigger-trace ignored", () => { - const decisions = mock.oboeDecisions({ - auth: 0, - type: 0, - }) - const parentContext = mock.spanContext({ - isRemote: true, - }) - const traceOptions = mock.traceOptions({ - triggerTrace: true, - }) - - const response = SwSampler[traceOptionsResponse]( - decisions, - parentContext, - traceOptions, - ) - - expect(response).to.include("trigger-trace####ignored") - }) - - it("contains status message when trigger-trace not ignored", () => { - const statusMsg = "this is a message" - const decisions = mock.oboeDecisions({ - auth: 0, - status_msg: statusMsg, - }) - const traceOptions = mock.traceOptions({ - triggerTrace: true, - }) - - const response = SwSampler[traceOptionsResponse]( - decisions, - undefined, - traceOptions, - ) - - expect(response).to.include(`trigger-trace####${statusMsg}`) - }) - - it("contains not requested message when trigger-trace no requested", () => { - const decisions = mock.oboeDecisions({ - auth: 0, - }) - const traceOptions = mock.traceOptions({ - triggerTrace: false, - }) - - const response = SwSampler[traceOptionsResponse]( - decisions, - undefined, - traceOptions, - ) - - expect(response).to.include("trigger-trace####not-requested") - }) - - it("contains ignored trace options", () => { - const k1 = "key 1" - const k2 = "key 2" - const decisions = mock.oboeDecisions() - const traceOptions = mock.traceOptions({ - ignored: [ - [k1, undefined], - [k2, "value"], - ], - }) - - const response = SwSampler[traceOptionsResponse]( - decisions, - undefined, - traceOptions, - ) - - expect(response).to.include(`ignored####${k1}....${k2}`) - }) - }) - - const attributes = "attributes" - describe(attributes, () => { - it("preserves existing attributes immutably", () => { - const old = { foo: "bar" } - const decisions = mock.oboeDecisions({ do_sample: 1 }) - - const attrs = SwSampler[attributes]( - old, - decisions, - undefined, - undefined, - mock.traceState(), - ) - - expect(attrs).to.include(old) - expect(attrs).to.be.frozen - }) - - it("propagates sw keys and custom keys", () => { - const decisions = mock.oboeDecisions({ do_sample: 1 }) - const swKeys = "foo=bar" - const custom = { foo: "bar" } - const traceOptions = mock.traceOptions({ swKeys, custom }) - - const attrs = SwSampler[attributes]( - {}, - decisions, - undefined, - traceOptions, - mock.traceState(), - ) - - expect(attrs).to.deep.include({ - SWKeys: swKeys, - ...custom, - }) - }) - - it("propagates attributes from decisions", () => { - const bucketCap = 1 - const bucketRate = 2 - const sampleRate = 3 - const sampleSource = 4 - const decisions = mock.oboeDecisions({ - do_sample: 1, - bucket_cap: bucketCap, - bucket_rate: bucketRate, - sample_rate: sampleRate, - sample_source: sampleSource, - }) - - const attrs = SwSampler[attributes]( - {}, - decisions, - undefined, - undefined, - mock.traceState(), - ) - - expect(attrs).to.include({ - BucketCapacity: bucketCap, - BucketRate: bucketRate, - SampleRate: sampleRate, - SampleSource: sampleSource, - }) - }) - - it("propagates parent id when remote", () => { - const parentId = mock.spanId() - const parentContext = mock.spanContext({ - spanId: parentId, - isRemote: true, - }) - const parentSw = swValue(parentContext) - const traceState = mock.traceState(`sw=${parentSw}`) - parentContext.traceState = traceState - - const decisions = mock.oboeDecisions({ do_sample: 1 }) - - const attrs = SwSampler[attributes]( - {}, - decisions, - parentContext, - undefined, - traceState, - ) - - expect(attrs).to.include({ - "sw.tracestate_parent_id": parentId, - }) - }) - }) -}) diff --git a/packages/sdk/test/trace-context-options-propagator.test.ts b/packages/sdk/test/trace-context-options-propagator.test.ts deleted file mode 100644 index 4880ce68..00000000 --- a/packages/sdk/test/trace-context-options-propagator.test.ts +++ /dev/null @@ -1,255 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { describe, expect, it as test } from "@solarwinds-apm/test" - -import { type TraceOptions } from "../src/context" -import { SwTraceContextOptionsPropagator } from "../src/trace-context-options-propagator" -import * as mock from "./mock" - -const propagator = new SwTraceContextOptionsPropagator(mock.logger()) - -const parseTraceOptions = "parseTraceOptions" -describe(parseTraceOptions, () => { - test("no key no value", () => { - const header = "=" - const result = propagator[parseTraceOptions]("=") - - expect(result).to.loosely.deep.equal({ - header, - custom: {}, - ignored: [], - } satisfies TraceOptions) - }) - - test("orphan value", () => { - const header = "=value" - const result = propagator[parseTraceOptions](header) - - expect(result).to.loosely.deep.equal({ - header, - custom: {}, - ignored: [], - } satisfies TraceOptions) - }) - - test("valid trigger trace", () => { - const header = "trigger-trace" - const result = propagator[parseTraceOptions](header) - - expect(result).to.loosely.deep.equal({ - header, - triggerTrace: true, - custom: {}, - ignored: [], - } satisfies TraceOptions) - }) - - test("invalid trigger trace with value", () => { - const header = "trigger-trace=value" - const result = propagator[parseTraceOptions](header) - - expect(result).to.loosely.deep.equal({ - header, - custom: {}, - ignored: [["trigger-trace", "value"]], - } satisfies TraceOptions) - }) - - test("sw-keys strip", () => { - const header = "sw-keys= name:value " - const result = propagator[parseTraceOptions](header) - - expect(result).to.loosely.deep.equal({ - header, - swKeys: "name:value", - custom: {}, - ignored: [], - } satisfies TraceOptions) - }) - - test("sw-keys ignore after semi", () => { - const header = "sw-keys=check-id:check-1013,website-id;booking-demo" - const result = propagator[parseTraceOptions](header) - - expect(result).to.loosely.deep.equal({ - header, - swKeys: "check-id:check-1013,website-id", - custom: {}, - ignored: [["booking-demo", undefined]], - } satisfies TraceOptions) - }) - - test("custom keys strip", () => { - const header = "custom-key= value " - const result = propagator[parseTraceOptions](header) - - expect(result).to.loosely.deep.equal({ - header, - custom: { - "custom-key": "value", - }, - ignored: [], - } satisfies TraceOptions) - }) - - test("custom keys ignore no value", () => { - const header = "custom-key" - const result = propagator[parseTraceOptions](header) - - expect(result).to.loosely.deep.equal({ - header, - custom: {}, - ignored: [["custom-key", undefined]], - } satisfies TraceOptions) - }) - - test("custom keys equals in value", () => { - const header = "custom-key=name=value" - const result = propagator[parseTraceOptions](header) - - expect(result).to.loosely.deep.equal({ - header, - custom: { - "custom-key": "name=value", - }, - ignored: [], - } satisfies TraceOptions) - }) - - test("custom keys ignore spaces in key", () => { - const header = "custom- key=value;custom-ke y=value" - const result = propagator[parseTraceOptions](header) - - expect(result).to.loosely.deep.equal({ - header, - custom: {}, - ignored: [ - ["custom- key", "value"], - ["custom-ke y", "value"], - ], - } satisfies TraceOptions) - }) - - test("timestamp trim", () => { - const header = "ts = 1234567890 " - const result = propagator[parseTraceOptions](header) - - expect(result).to.loosely.deep.equal({ - header, - timestamp: 1234567890, - custom: {}, - ignored: [], - } satisfies TraceOptions) - }) - - test("other ignored", () => { - const header = "key=value" - const result = propagator[parseTraceOptions](header) - - expect(result).to.loosely.deep.equal({ - header, - custom: {}, - ignored: [["key", "value"]], - } satisfies TraceOptions) - }) - - test("signature", () => { - const header = "foo bar baz" - const signature = "signature123" - const result = propagator[parseTraceOptions](header, signature) - - expect(result).to.loosely.deep.equal({ - header, - signature, - custom: {}, - ignored: [["foo bar baz", undefined]], - } satisfies TraceOptions) - }) - - test("strip everything", () => { - const header = - "trigger-trace ; custom-something=value; custom-OtherThing = other val ; sw-keys = 029734wr70:9wqj21,0d9j1 ; ts = 12345 ; foo = bar" - const result = propagator[parseTraceOptions](header) - - expect(result).to.loosely.deep.equal({ - header, - triggerTrace: true, - swKeys: "029734wr70:9wqj21,0d9j1", - timestamp: 12345, - custom: { - "custom-something": "value", - "custom-OtherThing": "other val", - }, - ignored: [["foo", "bar"]], - } satisfies TraceOptions) - }) - - test("semi everywhere", () => { - const header = - ";foo=bar;;;custom-something=value_thing;;sw-keys=02973r70:1b2a3;;;;custom-key=val;ts=12345;;;;;;;trigger-trace;;;" - const result = propagator[parseTraceOptions](header) - - expect(result).to.loosely.deep.equal({ - header, - triggerTrace: true, - swKeys: "02973r70:1b2a3", - timestamp: 12345, - custom: { - "custom-something": "value_thing", - "custom-key": "val", - }, - ignored: [["foo", "bar"]], - } satisfies TraceOptions) - }) - - test("single quotes", () => { - const header = "trigger-trace;custom-foo='bar;bar';custom-bar=foo" - const result = propagator[parseTraceOptions](header) - - expect(result).to.loosely.deep.equal({ - header, - triggerTrace: true, - custom: { - "custom-foo": "'bar", - "custom-bar": "foo", - }, - ignored: [["bar'", undefined]], - } satisfies TraceOptions) - }) - - test("missing values and semi", () => { - const header = - ";trigger-trace;custom-something=value_thing;sw-keys=02973r70:9wqj21,0d9j1;1;2;3;4;5;=custom-key=val?;=" - const result = propagator[parseTraceOptions](header) - - expect(result).to.loosely.deep.equal({ - header, - triggerTrace: true, - swKeys: "02973r70:9wqj21,0d9j1", - custom: { - "custom-something": "value_thing", - }, - ignored: [ - ["1", undefined], - ["2", undefined], - ["3", undefined], - ["4", undefined], - ["5", undefined], - ], - } satisfies TraceOptions) - }) -}) diff --git a/packages/sdk/test/transaction-name-processor.test.ts b/packages/sdk/test/transaction-name-processor.test.ts deleted file mode 100644 index c974cc9d..00000000 --- a/packages/sdk/test/transaction-name-processor.test.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { describe, expect, it } from "@solarwinds-apm/test" - -import { cache } from "../src/cache" -import { SwTransactionNameProcessor } from "../src/transaction-name-processor" -import * as mock from "./mock" - -const processor = new SwTransactionNameProcessor() - -describe("SwTransactionNameProcessor", () => { - describe("root span", () => { - const span = mock.readableSpan({ - name: "root span", - parentSpanId: undefined, - }) - cache.getOrInit(span.spanContext(), { parentId: span.parentSpanId }) - - it("sets the transaction name", () => { - processor.onEnd(span) - - const { txname } = cache.get(span.spanContext())! - expect(txname).to.equal("root span") - }) - }) - - describe("remote parent span", () => { - const parentSpanId = mock.spanId() - const span = mock.readableSpan({ - name: "remote parent span", - parentSpanId, - }) - cache.getOrInit(span.spanContext(), { - parentId: span.parentSpanId, - parentRemote: true, - }) - - it("sets the transaction name", () => { - processor.onEnd(span) - - const { txname } = cache.get(span.spanContext())! - expect(txname).to.equal("remote parent span") - }) - }) - - describe("local parent span", () => { - const parentSpanId = mock.spanId() - const span = mock.readableSpan({ - name: "local parent span", - parentSpanId, - }) - cache.getOrInit(span.spanContext(), { - parentId: span.parentSpanId, - parentRemote: false, - }) - - it("doesn't set the transaction name", () => { - processor.onEnd(span) - - const { txname } = cache.get(span.spanContext())! - expect(txname).to.be.undefined - }) - }) -}) diff --git a/packages/sdk/test/tsconfig.json b/packages/sdk/test/tsconfig.json deleted file mode 100644 index 384056f0..00000000 --- a/packages/sdk/test/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../../tsconfig.base.test.json", - "references": [{ "path": ".." }] -} diff --git a/packages/sdk/tsconfig.json b/packages/sdk/tsconfig.json deleted file mode 100644 index 9119dbaa..00000000 --- a/packages/sdk/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "include": ["./src", "./lib.d.ts"], - "compilerOptions": { - "rootDir": "./src", - "outDir": "./dist" - }, - "references": [{ "path": ".." }] -} diff --git a/packages/solarwinds-apm/package.json b/packages/solarwinds-apm/package.json index 7de9f3e0..063e98ca 100644 --- a/packages/solarwinds-apm/package.json +++ b/packages/solarwinds-apm/package.json @@ -90,16 +90,14 @@ "devDependencies": { "@opentelemetry/api": "^1.3.0", "@solarwinds-apm/eslint-config": "workspace:^", - "@solarwinds-apm/rollup-config": "workspace:^", "@solarwinds-apm/test": "workspace:^", - "@types/node": "^18.19.43", - "@types/semver": "^7.5.3", + "@types/json-stringify-safe": "^5.0.3", + "@types/node": "^18.19.0", "eslint": "^9.9.1", "prettier": "^3.3.3", - "rollup": "^4.3.0", "typescript": "~5.5.3" }, "engines": { - "node": ">=16.13.0" + "node": "^18.19.0 || ^20.8.0 || >=22.0.0" } } diff --git a/packages/sdk/test/test.d.ts b/packages/solarwinds-apm/src/commonjs/flags.d.ts similarity index 93% rename from packages/sdk/test/test.d.ts rename to packages/solarwinds-apm/src/commonjs/flags.d.ts index dfda8e7f..69368441 100644 --- a/packages/sdk/test/test.d.ts +++ b/packages/solarwinds-apm/src/commonjs/flags.d.ts @@ -14,5 +14,4 @@ See the License for the specific language governing permissions and limitations under the License. */ -import "jest" -import "jest-extended" +export declare const INIT: symbol; diff --git a/packages/compat/rollup.config.js b/packages/solarwinds-apm/src/commonjs/flags.js similarity index 88% rename from packages/compat/rollup.config.js rename to packages/solarwinds-apm/src/commonjs/flags.js index fb0d311b..0a3e2765 100644 --- a/packages/compat/rollup.config.js +++ b/packages/solarwinds-apm/src/commonjs/flags.js @@ -1,3 +1,5 @@ +"use strict"; + /* Copyright 2023-2024 SolarWinds Worldwide, LLC. @@ -14,6 +16,4 @@ See the License for the specific language governing permissions and limitations under the License. */ -import config from "@solarwinds-apm/rollup-config" - -export default config() +module.exports.INIT = "solarwinds-apm / init"; diff --git a/packages/solarwinds-apm/src/commonjs/index.js b/packages/solarwinds-apm/src/commonjs/index.js index be61f028..0126c9a4 100644 --- a/packages/solarwinds-apm/src/commonjs/index.js +++ b/packages/solarwinds-apm/src/commonjs/index.js @@ -2,7 +2,7 @@ "use strict"; if (require("./version")) { - if ((!Symbol.for("solarwinds-apm / init")) in global) { + if (global[require("./flags").INIT] !== true) { // this will not trigger if customers use the --import flag then use require, // it will only trigger if they only ever use require console.warn( diff --git a/packages/solarwinds-apm/src/config.ts b/packages/solarwinds-apm/src/config.ts index 99dcb70e..606f4187 100644 --- a/packages/solarwinds-apm/src/config.ts +++ b/packages/solarwinds-apm/src/config.ts @@ -28,7 +28,7 @@ import { type Set, } from "@solarwinds-apm/instrumentations" import { IS_SERVERLESS } from "@solarwinds-apm/module" -import { load } from "@solarwinds-apm/module/load" +import { load } from "@solarwinds-apm/module" import { z, ZodError, ZodIssueCode } from "zod" const PREFIX = "SW_APM_" diff --git a/packages/solarwinds-apm/src/index.ts b/packages/solarwinds-apm/src/index.ts index 84ca47ba..f16242bb 100644 --- a/packages/solarwinds-apm/src/index.ts +++ b/packages/solarwinds-apm/src/index.ts @@ -17,18 +17,31 @@ limitations under the License. import { IS_SERVERLESS } from "@solarwinds-apm/module" import { register } from "module" +import { INIT } from "./commonjs/flags.js" import { init } from "./init.js" -import { global } from "./storage.js" if (!IS_SERVERLESS) { await import("./commonjs/version.js") } -const first = Symbol() -if (global("init", () => first) === first) { +if (!Reflect.has(globalThis, INIT)) { try { + Reflect.defineProperty(globalThis, INIT, { + value: false, + enumerable: false, + configurable: true, + writable: true, + }) + register("./hooks.js", import.meta.url) await init() + + Reflect.defineProperty(globalThis, INIT, { + value: true, + enumerable: false, + configurable: false, + writable: false, + }) } catch (error) { console.error(error) } diff --git a/packages/solarwinds-apm/src/processing/response-time.ts b/packages/solarwinds-apm/src/processing/response-time.ts index 841a3926..c1e83820 100644 --- a/packages/solarwinds-apm/src/processing/response-time.ts +++ b/packages/solarwinds-apm/src/processing/response-time.ts @@ -31,22 +31,12 @@ import { ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_STATUS_CODE, } from "@opentelemetry/semantic-conventions" -import { lazy } from "@solarwinds-apm/lazy" import { componentLogger } from "../logger.js" import { ATTR_HTTP_METHOD, ATTR_HTTP_STATUS_CODE } from "../semattrs.old.js" import { isRootOrEntry } from "./parent-span.js" import { TRANSACTION_NAME_ATTRIBUTE } from "./transaction-name.js" -const RESPONSE_TIME = lazy(() => - metrics - .getMeter("sw.apm.request.metrics") - .createHistogram("trace.service.response_time", { - valueType: ValueType.DOUBLE, - unit: "ms", - }), -) - /** * Processor that records response time metrics * @@ -59,6 +49,12 @@ export class ResponseTimeProcessor implements SpanProcessor { readonly #logger = componentLogger(ResponseTimeProcessor) + readonly #responseTime = metrics + .getMeter("sw.apm.request.metrics") + .createHistogram("trace.service.response_time", { + valueType: ValueType.DOUBLE, + unit: "ms", + }) override onEnd(span: ReadableSpan): void { if (!isRootOrEntry(span)) { @@ -86,6 +82,6 @@ export class ResponseTimeProcessor } this.#logger.debug("recording response time", time, attributes) - RESPONSE_TIME.record(time, attributes) + this.#responseTime.record(time, attributes) } } diff --git a/packages/solarwinds-apm/test/processing/response-time.test.ts b/packages/solarwinds-apm/test/processing/response-time.test.ts index 8eb4beee..43ab4deb 100644 --- a/packages/solarwinds-apm/test/processing/response-time.test.ts +++ b/packages/solarwinds-apm/test/processing/response-time.test.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { diag, SpanKind, SpanStatusCode, trace } from "@opentelemetry/api" +import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api" import { DataPointType, type ExponentialHistogramMetricData, @@ -26,9 +26,9 @@ import { ATTR_HTTP_ROUTE, ATTR_URL_PATH, } from "@opentelemetry/semantic-conventions" -import { type SwConfiguration } from "@solarwinds-apm/sdk" import { describe, expect, it, otel } from "@solarwinds-apm/test" +import { type Configuration } from "../../src/config.js" import { ParentSpanProcessor } from "../../src/processing/parent-span.js" import { ResponseTimeProcessor } from "../../src/processing/response-time.js" import { TransactionNameProcessor } from "../../src/processing/transaction-name.js" @@ -68,8 +68,8 @@ describe("ResponseTimeProcessor", () => { otel.reset({ trace: { processors: [ - new TransactionNameProcessor({} as SwConfiguration, diag), - new ResponseTimeProcessor(diag), + new TransactionNameProcessor({} as Configuration), + new ResponseTimeProcessor(), new ParentSpanProcessor(), ], }, diff --git a/packages/solarwinds-apm/test/processing/transaction-name.test.ts b/packages/solarwinds-apm/test/processing/transaction-name.test.ts index 9cff5845..dbca0366 100644 --- a/packages/solarwinds-apm/test/processing/transaction-name.test.ts +++ b/packages/solarwinds-apm/test/processing/transaction-name.test.ts @@ -16,15 +16,15 @@ limitations under the License. import { setTimeout } from "node:timers/promises" -import { diag, trace } from "@opentelemetry/api" +import { trace } from "@opentelemetry/api" import type * as sdk from "@opentelemetry/sdk-trace-base" import { ATTR_HTTP_ROUTE, ATTR_URL_PATH, } from "@opentelemetry/semantic-conventions" -import { type SwConfiguration } from "@solarwinds-apm/sdk" import { describe, expect, it, otel } from "@solarwinds-apm/test" +import { type Configuration } from "../../src/config.js" import { ParentSpanProcessor } from "../../src/processing/parent-span.js" import { computedTransactionName, @@ -39,7 +39,7 @@ describe("TransactionNameProcessor", () => { await otel.reset({ trace: { processors: [ - new TransactionNameProcessor({} as SwConfiguration, diag), + new TransactionNameProcessor({} as Configuration), new ParentSpanProcessor(), ], }, @@ -71,12 +71,9 @@ describe("TransactionNameProcessor", () => { await otel.reset({ trace: { processors: [ - new TransactionNameProcessor( - { - transactionName: "default", - } as SwConfiguration, - diag, - ), + new TransactionNameProcessor({ + transactionName: "default", + } as Configuration), new ParentSpanProcessor(), ], }, @@ -108,12 +105,9 @@ describe("TransactionNameProcessor", () => { await otel.reset({ trace: { processors: [ - new TransactionNameProcessor( - { - transactionName: "default", - } as SwConfiguration, - diag, - ), + new TransactionNameProcessor({ + transactionName: "default", + } as Configuration), new ParentSpanProcessor(), ], }, @@ -148,7 +142,7 @@ describe("TransactionNameProcessor", () => { await otel.reset({ trace: { processors: [ - new TransactionNameProcessor({} as SwConfiguration, diag), + new TransactionNameProcessor({} as Configuration), new ParentSpanProcessor(), ], }, @@ -173,7 +167,7 @@ describe("TransactionNameProcessor", () => { await otel.reset({ trace: { processors: [ - new TransactionNameProcessor({} as SwConfiguration, diag), + new TransactionNameProcessor({} as Configuration), new ParentSpanProcessor(), ], }, diff --git a/packages/solarwinds-apm/test/sampling/grpc.test.ts b/packages/solarwinds-apm/test/sampling/grpc.test.ts index 23c1670e..79ae16f1 100644 --- a/packages/solarwinds-apm/test/sampling/grpc.test.ts +++ b/packages/solarwinds-apm/test/sampling/grpc.test.ts @@ -18,19 +18,12 @@ import { hostname } from "node:os" import { setTimeout } from "node:timers/promises" import { credentials, type ServiceError, status } from "@grpc/grpc-js" -import { diag, trace } from "@opentelemetry/api" +import { trace } from "@opentelemetry/api" import { collector } from "@solarwinds-apm/proto" import { BucketType, Flags, SampleSource } from "@solarwinds-apm/sampling" -import { type SwConfiguration } from "@solarwinds-apm/sdk" -import { - before, - describe, - expect, - it, - otel, - TestDiagLogger, -} from "@solarwinds-apm/test" +import { before, describe, expect, it, otel } from "@solarwinds-apm/test" +import { type Configuration } from "../../src/config.js" import { GrpcCollectorClient, GrpcSampler, @@ -55,9 +48,9 @@ describe("GrpcSampler", () => { collector: COLLECTOR, token, serviceName, - } as unknown as SwConfiguration + } as unknown as Configuration - const sampler = new GrpcSampler(config, diag) + const sampler = new GrpcSampler(config) await otel.reset({ trace: { sampler } }) await sampler.ready }) @@ -82,16 +75,14 @@ describe("GrpcSampler", () => { }) describe("invalid service key", () => { - const logger = new TestDiagLogger() - before(async () => { const config = { collector: COLLECTOR, token: "woops", serviceName, - } as unknown as SwConfiguration + } as unknown as Configuration - const sampler = new GrpcSampler(config, logger) + const sampler = new GrpcSampler(config) await otel.reset({ trace: { sampler } }) await sampler.ready }) @@ -106,22 +97,18 @@ describe("GrpcSampler", () => { const spans = await otel.spans() expect(spans).to.be.empty - - expect(logger.logs.warn).not.to.be.empty }) }) describe("invalid collector", () => { - const logger = new TestDiagLogger() - before(async () => { const config = { collector: "woops", token, serviceName, - } as unknown as SwConfiguration + } as unknown as Configuration - const sampler = new GrpcSampler(config, logger) + const sampler = new GrpcSampler(config) await otel.reset({ trace: { sampler } }) await sampler.ready }) @@ -136,17 +123,10 @@ describe("GrpcSampler", () => { const spans = await otel.spans() expect(spans).to.be.empty - - expect(logger.logs.warn).not.to.be.empty }) it("retries with backoff", async () => { await setTimeout(1000) - - const logs = logger.logs.debug.filter(([message]) => - message.includes("retry"), - ) - expect(logs).not.to.be.empty }) }) }) diff --git a/packages/solarwinds-apm/test/sampling/sampler.test.ts b/packages/solarwinds-apm/test/sampling/sampler.test.ts index 70876e58..ee644e0b 100644 --- a/packages/solarwinds-apm/test/sampling/sampler.test.ts +++ b/packages/solarwinds-apm/test/sampling/sampler.test.ts @@ -29,9 +29,9 @@ import { SampleSource, type Settings, } from "@solarwinds-apm/sampling" -import { type SwConfiguration } from "@solarwinds-apm/sdk" import { describe, expect, it, otel } from "@solarwinds-apm/test" +import { type Configuration } from "../../src/config.js" import { HEADERS_STORAGE } from "../../src/propagation/headers.js" import { httpSpanMetadata, Sampler } from "../../src/sampling/sampler.js" import { @@ -43,7 +43,7 @@ import { } from "../../src/semattrs.old.js" class TestSampler extends Sampler { - constructor(config: SwConfiguration, settings: Settings) { + constructor(config: Configuration, settings: Settings) { super(config, diag) this.updateSettings(settings) } @@ -56,13 +56,13 @@ class TestSampler extends Sampler { const options = (options: { tracing?: boolean triggerTrace: boolean - transactionSettings?: SwConfiguration["transactionSettings"] -}): SwConfiguration => + transactionSettings?: Configuration["transactionSettings"] +}): Configuration => ({ tracingMode: options.tracing, triggerTraceEnabled: options.triggerTrace, transactionSettings: options.transactionSettings, - }) as SwConfiguration + }) as Configuration const settings = (options: { enabled: boolean diff --git a/packages/solarwinds-apm/tsconfig.json b/packages/solarwinds-apm/tsconfig.json index 9119dbaa..98e2a4ba 100644 --- a/packages/solarwinds-apm/tsconfig.json +++ b/packages/solarwinds-apm/tsconfig.json @@ -4,6 +4,5 @@ "compilerOptions": { "rootDir": "./src", "outDir": "./dist" - }, - "references": [{ "path": ".." }] + } } diff --git a/packages/test/eslint.config.js b/packages/test/eslint.config.js index eab21fb9..0230433e 100644 --- a/packages/test/eslint.config.js +++ b/packages/test/eslint.config.js @@ -14,6 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -import base from "@solarwinds-apm/eslint-config" +const base = require("@solarwinds-apm/eslint-config") -export default [...base()] +module.exports = base() diff --git a/packages/test/package.json b/packages/test/package.json index 0efa0a6b..959f6929 100644 --- a/packages/test/package.json +++ b/packages/test/package.json @@ -13,22 +13,19 @@ "bugs": { "url": "https://github.com/solarwinds/apm-js/issues" }, - "type": "module", + "type": "commonjs", "exports": { - ".": { - "import": "./dist/es/index.js", - "require": "./dist/cjs/index.js" - }, + ".": "./dist/index.js", "./ts-node/import": { - "import": "./dist/es/ts-node/import.es.js" + "import": "./dist/ts-node/import.mjs" }, "./ts-node/loader": { - "import": "./dist/es/ts-node/loader.es.js" + "import": "./dist/ts-node/loader.mjs" } }, - "main": "./dist/cjs/index.js", + "main": "./dist/index.js", "bin": { - "swtest": "./dist/es/bin.js" + "swtest": "./dist/bin.js" }, "files": [ "./src/", @@ -39,17 +36,16 @@ "provenance": true }, "scripts": { - "build": "rollup -c --forceExit", + "build": "tsc", "lint": "prettier --check . && eslint . --max-warnings=0", "lint:fix": "eslint --fix . && prettier --write .", "release": "node ../../scripts/publish.js" }, "dependencies": { - "@solarwinds-apm/module": "workspace:^", "@types/chai": "^4.3.6", "@types/chai-as-promised": "^7.1.6", "@types/mocha": "^10.0.7", - "@types/node": "^18.19.0 || >=20.6.0", + "@types/node": "^18.19.0", "c8": "^10.1.2", "chai": "^4.3.10", "chai-as-promised": "^7.1.1", @@ -65,13 +61,11 @@ "@opentelemetry/sdk-trace-base": "~1.26.0", "@opentelemetry/sdk-trace-node": "~1.26.0", "@solarwinds-apm/eslint-config": "workspace:^", - "@solarwinds-apm/rollup-config": "workspace:^", "eslint": "^9.9.1", "prettier": "^3.3.3", - "rollup": "^4.3.0", "typescript": "~5.5.3" }, "engines": { - "node": ">=16.13.0" + "node": "^18.19.0 || ^20.8.0 || >=22.0.0" } } diff --git a/packages/test/rollup.config.js b/packages/test/rollup.config.js deleted file mode 100644 index fb0d311b..00000000 --- a/packages/test/rollup.config.js +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2023-2024 SolarWinds Worldwide, LLC. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import config from "@solarwinds-apm/rollup-config" - -export default config() diff --git a/packages/test/src/bin.ts b/packages/test/src/bin.ts index d8f417dd..b8559f5f 100644 --- a/packages/test/src/bin.ts +++ b/packages/test/src/bin.ts @@ -16,11 +16,9 @@ limitations under the License. */ import { spawnSync } from "node:child_process" -import { createRequire } from "node:module" import * as path from "node:path" import * as process from "node:process" -import { callsite } from "@solarwinds-apm/module" import * as dotenv from "dotenv" import globby from "globby" import semver from "semver" @@ -35,8 +33,6 @@ const DEFAULTS = [ "*.test.mts", ] -const resolve = createRequire(callsite().getFileName()!).resolve - // Skip Node executable and current script path let argv = process.argv.slice(2) const parseFlag = (options: { short: string; long: string }) => { @@ -77,7 +73,7 @@ if (argv.length === 0) { argv = DEFAULTS.map((p) => `**/${p}`) } -const mocha = resolve("mocha/bin/mocha.js") +const mocha = require.resolve("mocha/bin/mocha.js") // We are not going through a shell to start the process so glob extension is done manually argv = globby.sync(argv, { gitignore: true, expandDirectories: DEFAULTS }) @@ -118,7 +114,7 @@ if (coverage) { ".coverage", ) - const c8 = resolve("c8/bin/c8.js") + const c8 = require.resolve("c8/bin/c8.js") argv = [ c8, // count all files in the coverage directory diff --git a/packages/test/src/ts-node/import.es.ts b/packages/test/src/ts-node/import.mts similarity index 93% rename from packages/test/src/ts-node/import.es.ts rename to packages/test/src/ts-node/import.mts index 258908c7..d0e0b175 100644 --- a/packages/test/src/ts-node/import.es.ts +++ b/packages/test/src/ts-node/import.mts @@ -18,4 +18,4 @@ import "ts-node/register" import { register } from "node:module" -register("./loader.es.js", import.meta.url) +register("./loader.mjs", import.meta.url) diff --git a/packages/test/src/ts-node/loader.es.ts b/packages/test/src/ts-node/loader.mts similarity index 100% rename from packages/test/src/ts-node/loader.es.ts rename to packages/test/src/ts-node/loader.mts diff --git a/packages/test/tsconfig.json b/packages/test/tsconfig.json index 6f1eaa08..8b8973e7 100644 --- a/packages/test/tsconfig.json +++ b/packages/test/tsconfig.json @@ -4,6 +4,5 @@ "compilerOptions": { "rootDir": "./src", "outDir": "./dist" - }, - "references": [{ "path": ".." }] + } } diff --git a/packages/tsconfig.json b/packages/tsconfig.json deleted file mode 100644 index 79294323..00000000 --- a/packages/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "include": ["*/package.json"] -} diff --git a/tsconfig.base.json b/tsconfig.base.json index a48c31eb..dd6ede29 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -10,7 +10,6 @@ "esModuleInterop": true, "allowJs": true, "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true, "skipLibCheck": true, "strict": true, // not included in strict mode but useful diff --git a/turbo.json b/turbo.json index 711093ac..14d6802d 100644 --- a/turbo.json +++ b/turbo.json @@ -7,7 +7,6 @@ "build.js", "package.json", "tsconfig.json", - "rollup.config.json", "src/**", "oboe/**" ], @@ -42,14 +41,12 @@ }, "globalDependencies": [ ".clang-format", - ".env", ".prettierrc.json", ".yarnrc.yml", "tsconfig.base.json", "tsconfig.base.test.json", "yarn.lock", - "packages/eslint-config/index.js", - "packages/rollup-config/index.js" + "packages/eslint-config/index.js" ], "globalPassThroughEnv": ["SW_APM_*", "OTEL_*", "NODE_ENV", "GITHUB_TOKEN"] } diff --git a/yarn.lock b/yarn.lock index 6cdc0e56..fc8b0579 100644 --- a/yarn.lock +++ b/yarn.lock @@ -227,7 +227,7 @@ __metadata: languageName: node linkType: hard -"@grpc/grpc-js@npm:^1.10.6, @grpc/grpc-js@npm:^1.7.1": +"@grpc/grpc-js@npm:^1.10.6": version: 1.11.2 resolution: "@grpc/grpc-js@npm:1.11.2" dependencies: @@ -544,24 +544,6 @@ __metadata: languageName: node linkType: hard -"@opentelemetry/exporter-metrics-otlp-grpc@npm:~0.53.0": - version: 0.53.0 - resolution: "@opentelemetry/exporter-metrics-otlp-grpc@npm:0.53.0" - dependencies: - "@grpc/grpc-js": "npm:^1.7.1" - "@opentelemetry/core": "npm:1.26.0" - "@opentelemetry/exporter-metrics-otlp-http": "npm:0.53.0" - "@opentelemetry/otlp-exporter-base": "npm:0.53.0" - "@opentelemetry/otlp-grpc-exporter-base": "npm:0.53.0" - "@opentelemetry/otlp-transformer": "npm:0.53.0" - "@opentelemetry/resources": "npm:1.26.0" - "@opentelemetry/sdk-metrics": "npm:1.26.0" - peerDependencies: - "@opentelemetry/api": ^1.3.0 - checksum: 10c0/c270e3ccde4bd3ed51ecdb41c1514b9f8084236be751600ab3ae33d9404b03d047a755fc8454fcace0d3d5abfddec89c795e2960811fe3a667ec639b65fc63e7 - languageName: node - linkType: hard - "@opentelemetry/exporter-metrics-otlp-http@npm:0.53.0": version: 0.53.0 resolution: "@opentelemetry/exporter-metrics-otlp-http@npm:0.53.0" @@ -593,22 +575,6 @@ __metadata: languageName: node linkType: hard -"@opentelemetry/exporter-trace-otlp-grpc@npm:~0.53.0": - version: 0.53.0 - resolution: "@opentelemetry/exporter-trace-otlp-grpc@npm:0.53.0" - dependencies: - "@grpc/grpc-js": "npm:^1.7.1" - "@opentelemetry/core": "npm:1.26.0" - "@opentelemetry/otlp-grpc-exporter-base": "npm:0.53.0" - "@opentelemetry/otlp-transformer": "npm:0.53.0" - "@opentelemetry/resources": "npm:1.26.0" - "@opentelemetry/sdk-trace-base": "npm:1.26.0" - peerDependencies: - "@opentelemetry/api": ^1.0.0 - checksum: 10c0/7933e1d4ed2ea8c470a7d7783de0ed84adcbf125a11420c67842f17f5d68baefdb6e7db9635287b22eb3cec6f2fd791ab4f5c7eb22152a4c0c2ce9a201b0b110 - languageName: node - linkType: hard - "@opentelemetry/exporter-trace-otlp-proto@npm:~0.53.0": version: 0.53.0 resolution: "@opentelemetry/exporter-trace-otlp-proto@npm:0.53.0" @@ -1161,20 +1127,6 @@ __metadata: languageName: node linkType: hard -"@opentelemetry/otlp-grpc-exporter-base@npm:0.53.0": - version: 0.53.0 - resolution: "@opentelemetry/otlp-grpc-exporter-base@npm:0.53.0" - dependencies: - "@grpc/grpc-js": "npm:^1.7.1" - "@opentelemetry/core": "npm:1.26.0" - "@opentelemetry/otlp-exporter-base": "npm:0.53.0" - "@opentelemetry/otlp-transformer": "npm:0.53.0" - peerDependencies: - "@opentelemetry/api": ^1.0.0 - checksum: 10c0/8a1b616d8b5026998c3744fdb76c6ee986ca6cfd8efb30d51bf6ed8bd6a58fa73f0e433a9074d0e8c2af9138ad25be451fbd0a3be1c90772417ecec2a269cfb0 - languageName: node - linkType: hard - "@opentelemetry/otlp-transformer@npm:0.53.0": version: 0.53.0 resolution: "@opentelemetry/otlp-transformer@npm:0.53.0" @@ -1522,167 +1474,6 @@ __metadata: languageName: node linkType: hard -"@rollup/plugin-json@npm:^6.0.1": - version: 6.1.0 - resolution: "@rollup/plugin-json@npm:6.1.0" - dependencies: - "@rollup/pluginutils": "npm:^5.1.0" - peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - checksum: 10c0/9400c431b5e0cf3088ba2eb2d038809a2b0fb2a84ed004997da85582f48cd64958ed3168893c4f2c8109e38652400ed68282d0c92bf8ec07a3b2ef2e1ceab0b7 - languageName: node - linkType: hard - -"@rollup/plugin-typescript@npm:^11.1.5": - version: 11.1.6 - resolution: "@rollup/plugin-typescript@npm:11.1.6" - dependencies: - "@rollup/pluginutils": "npm:^5.1.0" - resolve: "npm:^1.22.1" - peerDependencies: - rollup: ^2.14.0||^3.0.0||^4.0.0 - tslib: "*" - typescript: ">=3.7.0" - peerDependenciesMeta: - rollup: - optional: true - tslib: - optional: true - checksum: 10c0/5347cd73ac28d4cf2401a3e689864a1a0df8f3ae029abd9c38525cbc84bcfa16c3a32a0ac5698dac65ec531ba7cf8332e14f5fc7f8fa501193da23320a134c5c - languageName: node - linkType: hard - -"@rollup/pluginutils@npm:^5.1.0": - version: 5.1.0 - resolution: "@rollup/pluginutils@npm:5.1.0" - dependencies: - "@types/estree": "npm:^1.0.0" - estree-walker: "npm:^2.0.2" - picomatch: "npm:^2.3.1" - peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - checksum: 10c0/c7bed15711f942d6fdd3470fef4105b73991f99a478605e13d41888963330a6f9e32be37e6ddb13f012bc7673ff5e54f06f59fd47109436c1c513986a8a7612d - languageName: node - linkType: hard - -"@rollup/rollup-android-arm-eabi@npm:4.21.2": - version: 4.21.2 - resolution: "@rollup/rollup-android-arm-eabi@npm:4.21.2" - conditions: os=android & cpu=arm - languageName: node - linkType: hard - -"@rollup/rollup-android-arm64@npm:4.21.2": - version: 4.21.2 - resolution: "@rollup/rollup-android-arm64@npm:4.21.2" - conditions: os=android & cpu=arm64 - languageName: node - linkType: hard - -"@rollup/rollup-darwin-arm64@npm:4.21.2": - version: 4.21.2 - resolution: "@rollup/rollup-darwin-arm64@npm:4.21.2" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - -"@rollup/rollup-darwin-x64@npm:4.21.2": - version: 4.21.2 - resolution: "@rollup/rollup-darwin-x64@npm:4.21.2" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - -"@rollup/rollup-linux-arm-gnueabihf@npm:4.21.2": - version: 4.21.2 - resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.21.2" - conditions: os=linux & cpu=arm & libc=glibc - languageName: node - linkType: hard - -"@rollup/rollup-linux-arm-musleabihf@npm:4.21.2": - version: 4.21.2 - resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.21.2" - conditions: os=linux & cpu=arm & libc=musl - languageName: node - linkType: hard - -"@rollup/rollup-linux-arm64-gnu@npm:4.21.2": - version: 4.21.2 - resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.21.2" - conditions: os=linux & cpu=arm64 & libc=glibc - languageName: node - linkType: hard - -"@rollup/rollup-linux-arm64-musl@npm:4.21.2": - version: 4.21.2 - resolution: "@rollup/rollup-linux-arm64-musl@npm:4.21.2" - conditions: os=linux & cpu=arm64 & libc=musl - languageName: node - linkType: hard - -"@rollup/rollup-linux-powerpc64le-gnu@npm:4.21.2": - version: 4.21.2 - resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.21.2" - conditions: os=linux & cpu=ppc64 & libc=glibc - languageName: node - linkType: hard - -"@rollup/rollup-linux-riscv64-gnu@npm:4.21.2": - version: 4.21.2 - resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.21.2" - conditions: os=linux & cpu=riscv64 & libc=glibc - languageName: node - linkType: hard - -"@rollup/rollup-linux-s390x-gnu@npm:4.21.2": - version: 4.21.2 - resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.21.2" - conditions: os=linux & cpu=s390x & libc=glibc - languageName: node - linkType: hard - -"@rollup/rollup-linux-x64-gnu@npm:4.21.2": - version: 4.21.2 - resolution: "@rollup/rollup-linux-x64-gnu@npm:4.21.2" - conditions: os=linux & cpu=x64 & libc=glibc - languageName: node - linkType: hard - -"@rollup/rollup-linux-x64-musl@npm:4.21.2": - version: 4.21.2 - resolution: "@rollup/rollup-linux-x64-musl@npm:4.21.2" - conditions: os=linux & cpu=x64 & libc=musl - languageName: node - linkType: hard - -"@rollup/rollup-win32-arm64-msvc@npm:4.21.2": - version: 4.21.2 - resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.21.2" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - -"@rollup/rollup-win32-ia32-msvc@npm:4.21.2": - version: 4.21.2 - resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.21.2" - conditions: os=win32 & cpu=ia32 - languageName: node - linkType: hard - -"@rollup/rollup-win32-x64-msvc@npm:4.21.2": - version: 4.21.2 - resolution: "@rollup/rollup-win32-x64-msvc@npm:4.21.2" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - "@rushstack/eslint-patch@npm:^1.3.3": version: 1.7.2 resolution: "@rushstack/eslint-patch@npm:1.7.2" @@ -1690,12 +1481,6 @@ __metadata: languageName: node linkType: hard -"@solarwinds-apm/bindings-linux-arm64-gnu-serverless@workspace:*, @solarwinds-apm/bindings-linux-arm64-gnu-serverless@workspace:packages/bindings/npm/linux-arm64-gnu-serverless": - version: 0.0.0-use.local - resolution: "@solarwinds-apm/bindings-linux-arm64-gnu-serverless@workspace:packages/bindings/npm/linux-arm64-gnu-serverless" - languageName: unknown - linkType: soft - "@solarwinds-apm/bindings-linux-arm64-gnu@workspace:*, @solarwinds-apm/bindings-linux-arm64-gnu@workspace:packages/bindings/npm/linux-arm64-gnu": version: 0.0.0-use.local resolution: "@solarwinds-apm/bindings-linux-arm64-gnu@workspace:packages/bindings/npm/linux-arm64-gnu" @@ -1708,12 +1493,6 @@ __metadata: languageName: unknown linkType: soft -"@solarwinds-apm/bindings-linux-x64-gnu-serverless@workspace:*, @solarwinds-apm/bindings-linux-x64-gnu-serverless@workspace:packages/bindings/npm/linux-x64-gnu-serverless": - version: 0.0.0-use.local - resolution: "@solarwinds-apm/bindings-linux-x64-gnu-serverless@workspace:packages/bindings/npm/linux-x64-gnu-serverless" - languageName: unknown - linkType: soft - "@solarwinds-apm/bindings-linux-x64-gnu@workspace:*, @solarwinds-apm/bindings-linux-x64-gnu@workspace:packages/bindings/npm/linux-x64-gnu": version: 0.0.0-use.local resolution: "@solarwinds-apm/bindings-linux-x64-gnu@workspace:packages/bindings/npm/linux-x64-gnu" @@ -1731,15 +1510,12 @@ __metadata: resolution: "@solarwinds-apm/bindings@workspace:packages/bindings" dependencies: "@solarwinds-apm/bindings-linux-arm64-gnu": "workspace:*" - "@solarwinds-apm/bindings-linux-arm64-gnu-serverless": "workspace:*" "@solarwinds-apm/bindings-linux-arm64-musl": "workspace:*" "@solarwinds-apm/bindings-linux-x64-gnu": "workspace:*" - "@solarwinds-apm/bindings-linux-x64-gnu-serverless": "workspace:*" "@solarwinds-apm/bindings-linux-x64-musl": "workspace:*" "@solarwinds-apm/eslint-config": "workspace:^" - "@solarwinds-apm/module": "workspace:^" "@solarwinds-apm/test": "workspace:^" - "@types/node": "npm:^16.13.0" + "@types/node": "npm:^18.19.0" eslint: "npm:^9.9.1" node-addon-api: "npm:^8.1.0" prettier: "npm:^3.3.3" @@ -1748,14 +1524,10 @@ __metadata: dependenciesMeta: "@solarwinds-apm/bindings-linux-arm64-gnu": optional: true - "@solarwinds-apm/bindings-linux-arm64-gnu-serverless": - optional: true "@solarwinds-apm/bindings-linux-arm64-musl": optional: true "@solarwinds-apm/bindings-linux-x64-gnu": optional: true - "@solarwinds-apm/bindings-linux-x64-gnu-serverless": - optional: true "@solarwinds-apm/bindings-linux-x64-musl": optional: true languageName: unknown @@ -1768,12 +1540,10 @@ __metadata: "@opentelemetry/api": "npm:^1.3.0" "@opentelemetry/semantic-conventions": "npm:~1.27.0" "@solarwinds-apm/eslint-config": "workspace:^" - "@solarwinds-apm/rollup-config": "workspace:^" "@solarwinds-apm/test": "workspace:^" - "@types/node": "npm:^16.13.0" + "@types/node": "npm:^18.19.0" eslint: "npm:^9.9.1" prettier: "npm:^3.3.3" - rollup: "npm:^4.3.0" typescript: "npm:~5.5.3" peerDependencies: "@opentelemetry/api": ^1.3.0 @@ -1789,12 +1559,10 @@ __metadata: dependencies: "@solarwinds-apm/eslint-config": "workspace:^" "@solarwinds-apm/module": "workspace:^" - "@solarwinds-apm/rollup-config": "workspace:^" "@solarwinds-apm/test": "workspace:^" - "@types/node": "npm:^16.13.0" + "@types/node": "npm:^18.19.0" eslint: "npm:^9.9.1" prettier: "npm:^3.3.3" - rollup: "npm:^4.3.0" typescript: "npm:~5.5.3" languageName: unknown linkType: soft @@ -1885,7 +1653,7 @@ __metadata: "@opentelemetry/api": "npm:^1.3.0" "@prisma/client": "npm:^5.4.1" "@prisma/instrumentation": "npm:^5.4.1" - "@types/node": "npm:^16.13.0" + "@types/node": "npm:^18.19.0" "@types/react": "npm:^18.2.25" eslint: "npm:^8.57.0" eslint-config-next: "npm:^14.0.3" @@ -1916,11 +1684,9 @@ __metadata: "@opentelemetry/api": "npm:^1.3.0" "@opentelemetry/sdk-metrics": "npm:~1.26.0" "@solarwinds-apm/eslint-config": "workspace:^" - "@solarwinds-apm/rollup-config": "workspace:^" - "@types/node": "npm:^16.13.0" + "@types/node": "npm:^18.19.0" eslint: "npm:^9.9.1" prettier: "npm:^3.3.3" - rollup: "npm:^4.3.0" typescript: "npm:~5.5.3" languageName: unknown linkType: soft @@ -1977,11 +1743,9 @@ __metadata: "@opentelemetry/winston-transport": "npm:^0.6.0" "@solarwinds-apm/eslint-config": "workspace:^" "@solarwinds-apm/module": "workspace:^" - "@solarwinds-apm/rollup-config": "workspace:^" "@types/semver": "npm:^7.5.3" eslint: "npm:^9.9.1" prettier: "npm:^3.3.3" - rollup: "npm:^4.3.0" semver: "npm:^7.5.4" typescript: "npm:~5.5.3" peerDependencies: @@ -1992,29 +1756,14 @@ __metadata: languageName: unknown linkType: soft -"@solarwinds-apm/lazy@workspace:^, @solarwinds-apm/lazy@workspace:packages/lazy": - version: 0.0.0-use.local - resolution: "@solarwinds-apm/lazy@workspace:packages/lazy" - dependencies: - "@solarwinds-apm/eslint-config": "workspace:^" - "@solarwinds-apm/rollup-config": "workspace:^" - eslint: "npm:^9.9.1" - prettier: "npm:^3.3.3" - rollup: "npm:^4.3.0" - typescript: "npm:~5.5.3" - languageName: unknown - linkType: soft - "@solarwinds-apm/module@workspace:^, @solarwinds-apm/module@workspace:packages/module": version: 0.0.0-use.local resolution: "@solarwinds-apm/module@workspace:packages/module" dependencies: "@solarwinds-apm/eslint-config": "workspace:^" - "@solarwinds-apm/rollup-config": "workspace:^" - "@types/node": "npm:^16.13.0" + "@types/node": "npm:^18.19.0" eslint: "npm:^9.9.1" prettier: "npm:^3.3.3" - rollup: "npm:^4.3.0" typescript: "npm:~5.5.3" languageName: unknown linkType: soft @@ -2032,31 +1781,6 @@ __metadata: languageName: unknown linkType: soft -"@solarwinds-apm/rollup-config@workspace:^, @solarwinds-apm/rollup-config@workspace:packages/rollup-config": - version: 0.0.0-use.local - resolution: "@solarwinds-apm/rollup-config@workspace:packages/rollup-config" - dependencies: - "@rollup/plugin-json": "npm:^6.0.1" - "@rollup/plugin-typescript": "npm:^11.1.5" - "@solarwinds-apm/eslint-config": "workspace:^" - eslint: "npm:^9.9.1" - globby: "npm:^11.1.0" - prettier: "npm:^3.3.3" - rollup: "npm:^4.3.0" - rollup-plugin-node-externals: "npm:^7.0.0" - tslib: "npm:^2.6.2" - typescript: "npm:~5.5.3" - peerDependencies: - rollup: "*" - typescript: "*" - peerDependenciesMeta: - rollup: - optional: false - typescript: - optional: false - languageName: unknown - linkType: soft - "@solarwinds-apm/sampling@workspace:^, @solarwinds-apm/sampling@workspace:packages/sampling": version: 0.0.0-use.local resolution: "@solarwinds-apm/sampling@workspace:packages/sampling" @@ -2065,12 +1789,10 @@ __metadata: "@opentelemetry/sdk-metrics": "npm:~1.26.0" "@opentelemetry/sdk-trace-base": "npm:~1.26.0" "@solarwinds-apm/eslint-config": "workspace:^" - "@solarwinds-apm/rollup-config": "workspace:^" "@solarwinds-apm/test": "workspace:^" - "@types/node": "npm:^16.13.0" + "@types/node": "npm:^18.19.0" eslint: "npm:^9.9.1" prettier: "npm:^3.3.3" - rollup: "npm:^4.3.0" typescript: "npm:~5.5.3" peerDependencies: "@opentelemetry/api": ^1.3.0 @@ -2094,49 +1816,6 @@ __metadata: languageName: unknown linkType: soft -"@solarwinds-apm/sdk@workspace:packages/sdk": - version: 0.0.0-use.local - resolution: "@solarwinds-apm/sdk@workspace:packages/sdk" - dependencies: - "@opentelemetry/api": "npm:^1.3.0" - "@opentelemetry/core": "npm:~1.26.0" - "@opentelemetry/exporter-metrics-otlp-grpc": "npm:~0.53.0" - "@opentelemetry/exporter-trace-otlp-grpc": "npm:~0.53.0" - "@opentelemetry/instrumentation": "npm:~0.53.0" - "@opentelemetry/resources": "npm:~1.26.0" - "@opentelemetry/sdk-metrics": "npm:~1.26.0" - "@opentelemetry/sdk-trace-base": "npm:~1.26.0" - "@opentelemetry/sdk-trace-node": "npm:~1.26.0" - "@opentelemetry/semantic-conventions": "npm:~1.27.0" - "@solarwinds-apm/bindings": "workspace:^" - "@solarwinds-apm/dependencies": "workspace:^" - "@solarwinds-apm/eslint-config": "workspace:^" - "@solarwinds-apm/histogram": "workspace:^" - "@solarwinds-apm/lazy": "workspace:^" - "@solarwinds-apm/module": "workspace:^" - "@solarwinds-apm/test": "workspace:^" - "@types/json-stringify-safe": "npm:^5.0.3" - "@types/node": "npm:^16.13.0" - "@types/semver": "npm:^7.5.3" - eslint: "npm:^9.9.1" - json-stringify-safe: "npm:^5.0.1" - prettier: "npm:^3.3.3" - semver: "npm:^7.5.4" - typescript: "npm:~5.5.3" - peerDependencies: - "@opentelemetry/api": ^1.3.0 - "@opentelemetry/exporter-metrics-otlp-grpc": ">=0.34.0" - "@opentelemetry/exporter-trace-otlp-grpc": ">=0.34.0" - peerDependenciesMeta: - "@opentelemetry/api": - optional: false - "@opentelemetry/exporter-metrics-otlp-grpc": - optional: true - "@opentelemetry/exporter-trace-otlp-grpc": - optional: true - languageName: unknown - linkType: soft - "@solarwinds-apm/solarwinds-apm@workspace:.": version: 0.0.0-use.local resolution: "@solarwinds-apm/solarwinds-apm@workspace:." @@ -2158,12 +1837,10 @@ __metadata: "@opentelemetry/sdk-trace-base": "npm:~1.26.0" "@opentelemetry/sdk-trace-node": "npm:~1.26.0" "@solarwinds-apm/eslint-config": "workspace:^" - "@solarwinds-apm/module": "workspace:^" - "@solarwinds-apm/rollup-config": "workspace:^" "@types/chai": "npm:^4.3.6" "@types/chai-as-promised": "npm:^7.1.6" "@types/mocha": "npm:^10.0.7" - "@types/node": "npm:^18.19.0 || >=20.6.0" + "@types/node": "npm:^18.19.0" c8: "npm:^10.1.2" chai: "npm:^4.3.10" chai-as-promised: "npm:^7.1.1" @@ -2172,12 +1849,11 @@ __metadata: globby: "npm:^11.1.0" mocha: "npm:^10.3.0" prettier: "npm:^3.3.3" - rollup: "npm:^4.3.0" semver: "npm:^7.5.4" ts-node: "npm:^11.0.0-beta.1" typescript: "npm:~5.5.3" bin: - swtest: ./dist/es/bin.js + swtest: ./dist/bin.js languageName: unknown linkType: soft @@ -2267,13 +1943,6 @@ __metadata: languageName: node linkType: hard -"@types/estree@npm:1.0.5, @types/estree@npm:^1.0.0": - version: 1.0.5 - resolution: "@types/estree@npm:1.0.5" - checksum: 10c0/b3b0e334288ddb407c7b3357ca67dbee75ee22db242ca7c56fe27db4e1a31989cb8af48a84dd401deb787fe10cc6b2ab1ee82dc4783be87ededbe3d53c79c70d - languageName: node - linkType: hard - "@types/istanbul-lib-coverage@npm:^2.0.1": version: 2.0.6 resolution: "@types/istanbul-lib-coverage@npm:2.0.6" @@ -2351,7 +2020,7 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:*, @types/node@npm:>=13.7.0, @types/node@npm:^18.19.0 || >=20.6.0": +"@types/node@npm:*, @types/node@npm:>=13.7.0": version: 20.11.24 resolution: "@types/node@npm:20.11.24" dependencies: @@ -2360,19 +2029,12 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^16.13.0": - version: 16.18.86 - resolution: "@types/node@npm:16.18.86" - checksum: 10c0/7280efb4ee49b10c34a456d4d0d89872c099a721093439e001ff3b5e3569167305fba4a578a30a087fdfa06bf55f4a98aa65e9e2c31589e66ddeca1460de1dd0 - languageName: node - linkType: hard - -"@types/node@npm:^18.19.43": - version: 18.19.43 - resolution: "@types/node@npm:18.19.43" +"@types/node@npm:^18.19.0": + version: 18.19.56 + resolution: "@types/node@npm:18.19.56" dependencies: undici-types: "npm:~5.26.4" - checksum: 10c0/8be49897596d7641941d21d943b10a7b907af714617f9e3d1c69d735850de0c0a8d04f1428277c2b2451b4eda6ab1a3c05bfadfe66b4a30cd9ca51200814c647 + checksum: 10c0/4cc4a6e9051d2d4458bfef4cbaee3c5f920dd318f6e940a5e0c378b1b2ec5e716d0973a406270cc51096a682069524d8a5aeee02046d4430addf56f41af47375 languageName: node linkType: hard @@ -4523,13 +4185,6 @@ __metadata: languageName: node linkType: hard -"estree-walker@npm:^2.0.2": - version: 2.0.2 - resolution: "estree-walker@npm:2.0.2" - checksum: 10c0/53a6c54e2019b8c914dc395890153ffdc2322781acf4bd7d1a32d7aedc1710807bdcd866ac133903d5629ec601fbb50abe8c2e5553c7f5a0afdd9b6af6c945af - languageName: node - linkType: hard - "esutils@npm:^2.0.2": version: 2.0.3 resolution: "esutils@npm:2.0.3" @@ -5300,14 +4955,7 @@ __metadata: languageName: node linkType: hard -"ignore@npm:^5.2.0, ignore@npm:^5.3.1": - version: 5.3.1 - resolution: "ignore@npm:5.3.1" - checksum: 10c0/703f7f45ffb2a27fb2c5a8db0c32e7dee66b33a225d28e8db4e1be6474795f606686a6e3bcc50e1aa12f2042db4c9d4a7d60af3250511de74620fbed052ea4cd - languageName: node - linkType: hard - -"ignore@npm:^5.2.4": +"ignore@npm:^5.2.0, ignore@npm:^5.2.4, ignore@npm:^5.3.1": version: 5.3.2 resolution: "ignore@npm:5.3.2" checksum: 10c0/f9f652c957983634ded1e7f02da3b559a0d4cc210fca3792cb67f1b153623c9c42efdc1c4121af171e295444459fc4a9201101fb041b1104a3c000bccb188337 @@ -7622,78 +7270,6 @@ __metadata: languageName: node linkType: hard -"rollup-plugin-node-externals@npm:^7.0.0": - version: 7.1.3 - resolution: "rollup-plugin-node-externals@npm:7.1.3" - peerDependencies: - rollup: ^3.0.0 || ^4.0.0 - checksum: 10c0/79d0a964cb488d442f571dd7ce29c53099ca40a76cb71fd985b9978d52efad31346b11138dced9c974e9881b4a56dce384afc0e6d42d9740cebb58120028a37a - languageName: node - linkType: hard - -"rollup@npm:^4.3.0": - version: 4.21.2 - resolution: "rollup@npm:4.21.2" - dependencies: - "@rollup/rollup-android-arm-eabi": "npm:4.21.2" - "@rollup/rollup-android-arm64": "npm:4.21.2" - "@rollup/rollup-darwin-arm64": "npm:4.21.2" - "@rollup/rollup-darwin-x64": "npm:4.21.2" - "@rollup/rollup-linux-arm-gnueabihf": "npm:4.21.2" - "@rollup/rollup-linux-arm-musleabihf": "npm:4.21.2" - "@rollup/rollup-linux-arm64-gnu": "npm:4.21.2" - "@rollup/rollup-linux-arm64-musl": "npm:4.21.2" - "@rollup/rollup-linux-powerpc64le-gnu": "npm:4.21.2" - "@rollup/rollup-linux-riscv64-gnu": "npm:4.21.2" - "@rollup/rollup-linux-s390x-gnu": "npm:4.21.2" - "@rollup/rollup-linux-x64-gnu": "npm:4.21.2" - "@rollup/rollup-linux-x64-musl": "npm:4.21.2" - "@rollup/rollup-win32-arm64-msvc": "npm:4.21.2" - "@rollup/rollup-win32-ia32-msvc": "npm:4.21.2" - "@rollup/rollup-win32-x64-msvc": "npm:4.21.2" - "@types/estree": "npm:1.0.5" - fsevents: "npm:~2.3.2" - dependenciesMeta: - "@rollup/rollup-android-arm-eabi": - optional: true - "@rollup/rollup-android-arm64": - optional: true - "@rollup/rollup-darwin-arm64": - optional: true - "@rollup/rollup-darwin-x64": - optional: true - "@rollup/rollup-linux-arm-gnueabihf": - optional: true - "@rollup/rollup-linux-arm-musleabihf": - optional: true - "@rollup/rollup-linux-arm64-gnu": - optional: true - "@rollup/rollup-linux-arm64-musl": - optional: true - "@rollup/rollup-linux-powerpc64le-gnu": - optional: true - "@rollup/rollup-linux-riscv64-gnu": - optional: true - "@rollup/rollup-linux-s390x-gnu": - optional: true - "@rollup/rollup-linux-x64-gnu": - optional: true - "@rollup/rollup-linux-x64-musl": - optional: true - "@rollup/rollup-win32-arm64-msvc": - optional: true - "@rollup/rollup-win32-ia32-msvc": - optional: true - "@rollup/rollup-win32-x64-msvc": - optional: true - fsevents: - optional: true - bin: - rollup: dist/bin/rollup - checksum: 10c0/c9d97f7a21cde110371b2e890a31a996fee09b81e639e79372b962a9638ae653d2d24186b94632fc5dfab8a0582e1d0639dfe34b8b75051facd86915a9585a5f - languageName: node - linkType: hard - "run-parallel@npm:^1.1.9": version: 1.2.0 resolution: "run-parallel@npm:1.2.0" @@ -8020,16 +7596,14 @@ __metadata: "@solarwinds-apm/instrumentations": "workspace:^" "@solarwinds-apm/module": "workspace:^" "@solarwinds-apm/proto": "workspace:^" - "@solarwinds-apm/rollup-config": "workspace:^" "@solarwinds-apm/sampling": "workspace:^" "@solarwinds-apm/test": "workspace:^" - "@types/node": "npm:^18.19.43" - "@types/semver": "npm:^7.5.3" + "@types/json-stringify-safe": "npm:^5.0.3" + "@types/node": "npm:^18.19.0" eslint: "npm:^9.9.1" json-stringify-safe: "npm:^5.0.1" node-releases: "npm:^2.0.18" prettier: "npm:^3.3.3" - rollup: "npm:^4.3.0" typescript: "npm:~5.5.3" zod: "npm:^3.22.4" peerDependencies: @@ -8466,7 +8040,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.1.0, tslib@npm:^2.4.0, tslib@npm:^2.6.2": +"tslib@npm:^2.1.0, tslib@npm:^2.4.0": version: 2.7.0 resolution: "tslib@npm:2.7.0" checksum: 10c0/469e1d5bf1af585742128827000711efa61010b699cb040ab1800bcd3ccdd37f63ec30642c9e07c4439c1db6e46345582614275daca3e0f4abae29b0083f04a6 From 7a26628a704d9bd25193cf7d61247cb2258c43c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Th=C3=A9riault?= Date: Fri, 18 Oct 2024 15:48:49 -0400 Subject: [PATCH 02/15] remove old node16 stuff --- .github/RELEASE.md | 1 + .github/workflows/checks.yml | 19 ++---- .github/workflows/images.yml | 15 ++-- .github/workflows/release.yml | 2 + docker/16-amazonlinux2023.Dockerfile | 17 ----- docker/16-ubuntu20.04.Dockerfile | 18 ----- docker/18-alpine.Dockerfile | 15 ---- ...16.Dockerfile => 18-alpine3.17.Dockerfile} | 2 +- ...ckerfile => 18-amazonlinux2023.Dockerfile} | 2 +- docker/18-debian.Dockerfile | 13 ---- ...an10.Dockerfile => 18-debian10.Dockerfile} | 2 +- docker/18-ubi.Dockerfile | 20 ------ ...{16-ubi8.Dockerfile => 18-ubi8.Dockerfile} | 2 +- ...u.Dockerfile => 18-ubuntu20.04.Dockerfile} | 2 +- docker/docker-compose.yml | 68 +++---------------- docker/otel-collector/config.yml | 4 +- scripts/example.js | 3 +- 17 files changed, 33 insertions(+), 172 deletions(-) delete mode 100644 docker/16-amazonlinux2023.Dockerfile delete mode 100644 docker/16-ubuntu20.04.Dockerfile delete mode 100644 docker/18-alpine.Dockerfile rename docker/{16-alpine3.16.Dockerfile => 18-alpine3.17.Dockerfile} (88%) rename docker/{18-amazonlinux.Dockerfile => 18-amazonlinux2023.Dockerfile} (92%) delete mode 100644 docker/18-debian.Dockerfile rename docker/{16-debian10.Dockerfile => 18-debian10.Dockerfile} (88%) delete mode 100644 docker/18-ubi.Dockerfile rename docker/{16-ubi8.Dockerfile => 18-ubi8.Dockerfile} (81%) rename docker/{18-ubuntu.Dockerfile => 18-ubuntu20.04.Dockerfile} (94%) diff --git a/.github/RELEASE.md b/.github/RELEASE.md index 6f4875cb..5ab60673 100644 --- a/.github/RELEASE.md +++ b/.github/RELEASE.md @@ -10,6 +10,7 @@ - `opentelemetry/api {{api}}` - `opentelemetry/core {{core}}` +- `opentelemetry/instrumentation {{instrumentation}}` ## Breaking changes diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index e55c57ed..f0e918bd 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -90,16 +90,11 @@ jobs: strategy: matrix: image: - - 16-alpine3.16 - - 16-amazonlinux2023 - - 16-debian10 - - 16-ubi8 - - 16-ubuntu20.04 - - 18-alpine - - 18-amazonlinux - - 18-debian - - 18-ubi - - 18-ubuntu + - 18-alpine3.17 + - 18-amazonlinux2023 + - 18-debian10 + - 18-ubi8 + - 18-ubuntu20.04 - 20-alpine - 20-amazonlinux - 20-debian @@ -115,9 +110,7 @@ jobs: - arm64 # https://github.com/actions/runner/issues/801 exclude: - - image: 16-alpine3.16 - arch: arm64 - - image: 18-alpine + - image: 18-alpine3.17 arch: arm64 - image: 20-alpine arch: arm64 diff --git a/.github/workflows/images.yml b/.github/workflows/images.yml index 27872fc5..54abace0 100644 --- a/.github/workflows/images.yml +++ b/.github/workflows/images.yml @@ -13,16 +13,11 @@ jobs: strategy: matrix: image: - - 16-alpine3.16 - - 16-amazonlinux2023 - - 16-debian10 - - 16-ubi8 - - 16-ubuntu20.04 - - 18-alpine - - 18-amazonlinux - - 18-debian - - 18-ubi - - 18-ubuntu + - 18-alpine3.17 + - 18-amazonlinux2023 + - 18-debian10 + - 18-ubi8 + - 18-ubuntu20.04 - 20-alpine - 20-amazonlinux - 20-debian diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3e742d18..a05b8c3a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,9 +56,11 @@ jobs: run: | API=$(cat packages/solarwinds-apm/package.json | jq -r '.peerDependencies."@opentelemetry/api"') CORE=$(cat packages/solarwinds-apm/package.json | jq -r '.dependencies."@opentelemetry/core"') + INSTRUMENTATION=$(cat packages/solarwinds-apm/package.json | jq -r '.dependencies."@opentelemetry/instrumentation"') sed -i 's/{{arn}}/${{ needs.lambda.outputs.arn }}/' .github/RELEASE.md sed -i "s/{{api}}/${API}/" .github/RELEASE.md sed -i "s/{{core}}/${CORE}/" .github/RELEASE.md + sed -i "s/{{instrumentation}}/${INSTRUMENTATION}/" .github/RELEASE.md - name: Create release draft env: diff --git a/docker/16-amazonlinux2023.Dockerfile b/docker/16-amazonlinux2023.Dockerfile deleted file mode 100644 index 23786bef..00000000 --- a/docker/16-amazonlinux2023.Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM amazonlinux:2023 - -RUN dnf install -y \ - curl-minimal \ - git \ - git-lfs \ - tar \ - xz - -RUN curl -fsSL https://rpm.nodesource.com/setup_16.x | bash - && \ - dnf install -y nodejs && \ - dnf clean -y all - -RUN corepack enable - -WORKDIR /solarwinds-apm -ENTRYPOINT ["/bin/bash", "-c"] diff --git a/docker/16-ubuntu20.04.Dockerfile b/docker/16-ubuntu20.04.Dockerfile deleted file mode 100644 index 08a8dbf2..00000000 --- a/docker/16-ubuntu20.04.Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM ubuntu:20.04 - -RUN apt-get update && apt-get install -y \ - ca-certificates \ - curl \ - git \ - git-lfs \ - xz-utils - -RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \ - apt-get update && \ - apt-get install -y nodejs && \ - apt-get clean - -RUN corepack enable - -WORKDIR /solarwinds-apm -ENTRYPOINT ["/bin/sh", "-c"] diff --git a/docker/18-alpine.Dockerfile b/docker/18-alpine.Dockerfile deleted file mode 100644 index 300d17a9..00000000 --- a/docker/18-alpine.Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM node:18-alpine - -RUN apk add --no-cache \ - curl \ - gcompat \ - git \ - git-lfs \ - libc6-compat \ - tar \ - xz - -RUN corepack enable - -WORKDIR /solarwinds-apm -ENTRYPOINT ["/bin/sh", "-c"] diff --git a/docker/16-alpine3.16.Dockerfile b/docker/18-alpine3.17.Dockerfile similarity index 88% rename from docker/16-alpine3.16.Dockerfile rename to docker/18-alpine3.17.Dockerfile index 64e3464c..7ff267e7 100644 --- a/docker/16-alpine3.16.Dockerfile +++ b/docker/18-alpine3.17.Dockerfile @@ -1,4 +1,4 @@ -FROM node:16-alpine3.16 +FROM node:18-alpine3.17 RUN apk add --no-cache \ curl \ diff --git a/docker/18-amazonlinux.Dockerfile b/docker/18-amazonlinux2023.Dockerfile similarity index 92% rename from docker/18-amazonlinux.Dockerfile rename to docker/18-amazonlinux2023.Dockerfile index 6e5f0a11..89b365bc 100644 --- a/docker/18-amazonlinux.Dockerfile +++ b/docker/18-amazonlinux2023.Dockerfile @@ -1,4 +1,4 @@ -FROM amazonlinux +FROM amazonlinux:2023 RUN dnf install -y \ curl-minimal \ diff --git a/docker/18-debian.Dockerfile b/docker/18-debian.Dockerfile deleted file mode 100644 index 3a89c612..00000000 --- a/docker/18-debian.Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM node:18-slim - -RUN apt-get update && apt-get install -y \ - curl \ - git \ - git-lfs \ - xz-utils \ - && apt-get clean - -RUN corepack enable - -WORKDIR /solarwinds-apm -ENTRYPOINT ["/bin/bash", "-c"] diff --git a/docker/16-debian10.Dockerfile b/docker/18-debian10.Dockerfile similarity index 88% rename from docker/16-debian10.Dockerfile rename to docker/18-debian10.Dockerfile index 70309e89..2b942a69 100644 --- a/docker/16-debian10.Dockerfile +++ b/docker/18-debian10.Dockerfile @@ -1,4 +1,4 @@ -FROM node:16-buster-slim +FROM node:18-buster-slim RUN apt-get update && apt-get install -y \ curl \ diff --git a/docker/18-ubi.Dockerfile b/docker/18-ubi.Dockerfile deleted file mode 100644 index 69535685..00000000 --- a/docker/18-ubi.Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM registry.access.redhat.com/ubi9 - -RUN dnf install -y \ - curl-minimal \ - git \ - git-lfs \ - tar \ - xz - -RUN dnf module disable -y nodejs && \ - update-crypto-policies --set LEGACY && \ - curl -fsSL https://rpm.nodesource.com/setup_18.x | bash - && \ - dnf install -y nodejs && \ - update-crypto-policies --set DEFAULT && \ - dnf clean -y all - -RUN corepack enable - -WORKDIR /solarwinds-apm -ENTRYPOINT ["/bin/bash", "-c"] diff --git a/docker/16-ubi8.Dockerfile b/docker/18-ubi8.Dockerfile similarity index 81% rename from docker/16-ubi8.Dockerfile rename to docker/18-ubi8.Dockerfile index 540bb0b4..e3bce008 100644 --- a/docker/16-ubi8.Dockerfile +++ b/docker/18-ubi8.Dockerfile @@ -8,7 +8,7 @@ RUN dnf install -y \ xz RUN dnf module disable -y nodejs && \ - curl -fsSL https://rpm.nodesource.com/setup_16.x | bash - && \ + curl -fsSL https://rpm.nodesource.com/setup_18.x | bash - && \ dnf install -y nodejs && \ dnf clean -y all diff --git a/docker/18-ubuntu.Dockerfile b/docker/18-ubuntu20.04.Dockerfile similarity index 94% rename from docker/18-ubuntu.Dockerfile rename to docker/18-ubuntu20.04.Dockerfile index a6cfc197..d1c1b32c 100644 --- a/docker/18-ubuntu.Dockerfile +++ b/docker/18-ubuntu20.04.Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu +FROM ubuntu:20.04 RUN apt-get update && apt-get install -y \ ca-certificates \ diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 6f3ff395..39502865 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,9 +1,9 @@ version: "3" services: - 16-alpine: + 18-alpine: build: context: . - dockerfile: 16-alpine3.16.Dockerfile + dockerfile: 18-alpine3.17.Dockerfile environment: YARN_IGNORE_NODE: 1 volumes: @@ -11,10 +11,10 @@ services: links: - apm-collector - otel-collector - 16-amazonlinux: + 18-amazonlinux: build: context: . - dockerfile: 16-amazonlinux2023.Dockerfile + dockerfile: 18-amazonlinux2023.Dockerfile environment: YARN_IGNORE_NODE: 1 volumes: @@ -22,10 +22,10 @@ services: links: - apm-collector - otel-collector - 16-debian: + 18-debian: build: context: . - dockerfile: 16-debian10.Dockerfile + dockerfile: 18-debian10.Dockerfile environment: YARN_IGNORE_NODE: 1 volumes: @@ -33,10 +33,10 @@ services: links: - apm-collector - otel-collector - 16-ubi: + 18-ubi: build: context: . - dockerfile: 16-ubi8.Dockerfile + dockerfile: 18-ubi8.Dockerfile environment: YARN_IGNORE_NODE: 1 volumes: @@ -44,10 +44,10 @@ services: links: - apm-collector - otel-collector - 16-ubuntu: + 18-ubuntu: build: context: . - dockerfile: 16-ubuntu20.04.Dockerfile + dockerfile: 18-ubuntu20.04.Dockerfile environment: YARN_IGNORE_NODE: 1 volumes: @@ -56,52 +56,6 @@ services: - apm-collector - otel-collector - 18-alpine: - build: - context: . - dockerfile: 18-alpine.Dockerfile - volumes: - - ..:/solarwinds-apm - links: - - apm-collector - - otel-collector - 18-amazonlinux: - build: - context: . - dockerfile: 18-amazonlinux.Dockerfile - volumes: - - ..:/solarwinds-apm - links: - - apm-collector - - otel-collector - 18-debian: - build: - context: . - dockerfile: 18-debian.Dockerfile - volumes: - - ..:/solarwinds-apm - links: - - apm-collector - - otel-collector - 18-ubi: - build: - context: . - dockerfile: 18-ubi.Dockerfile - volumes: - - ..:/solarwinds-apm - links: - - apm-collector - - otel-collector - 18-ubuntu: - build: - context: . - dockerfile: 18-ubuntu.Dockerfile - volumes: - - ..:/solarwinds-apm - links: - - apm-collector - - otel-collector - 20-alpine: build: context: . @@ -228,7 +182,7 @@ services: - 12225 otel-collector: - image: ${OTEL_COLLECTOR_IMAGE:-otel/opentelemetry-collector:0.97.0} + image: ${OTEL_COLLECTOR_IMAGE:-otel/opentelemetry-collector:0.111.0} command: [--config=/solarwinds-apm/docker/otel-collector/config.yml] volumes: - ..:/solarwinds-apm diff --git a/docker/otel-collector/config.yml b/docker/otel-collector/config.yml index 83b34b51..854a8bc7 100644 --- a/docker/otel-collector/config.yml +++ b/docker/otel-collector/config.yml @@ -1,8 +1,8 @@ receivers: otlp: protocols: - grpc: - endpoint: otel-collector:4317 + http: + endpoint: otel-collector:4318 processors: batch: diff --git a/scripts/example.js b/scripts/example.js index da3c7245..83ad801d 100644 --- a/scripts/example.js +++ b/scripts/example.js @@ -42,8 +42,7 @@ if (collector) { env.SW_APM_COLLECTOR = "apm-collector:12224" env.SW_APM_TRUSTED_PATH = "/solarwinds-apm/docker/apm-collector/server-grpc.crt" - env.OTEL_EXPORTER_OTLP_PROTOCOL = "grpc" - env.OTEL_EXPORTER_OTLP_ENDPOINT = "http://otel-collector:4317" + env.OTEL_EXPORTER_OTLP_ENDPOINT = "http://otel-collector:4318" } // run example inside container From 52cbb8b740015c68f31da1014fec4003baeba7c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Th=C3=A9riault?= Date: Fri, 18 Oct 2024 15:54:45 -0400 Subject: [PATCH 03/15] remove old lambda stuff --- README.md | 2 +- lambda/package.json | 2 -- lambda/wrapper | 5 ++--- scripts/lambda.js | 3 --- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 0f7f37c5..6e660c22 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ This project contains a few examples of how to use the library in the [`examples ## Node.js Version Support -The packages in this project support all currently maintained LTS versions. At the moment this means Node.js 16, 18 and 20 are supported. +The packages in this project support all LTS Node.js versions up until their End Of Life plus 1 year. At the moment this means Node.js 18, 20 and 22 are supported. ## License diff --git a/lambda/package.json b/lambda/package.json index 79f572bd..c8cc188f 100644 --- a/lambda/package.json +++ b/lambda/package.json @@ -5,8 +5,6 @@ "dependencies": { "{{name}}": "{{version}}", "@opentelemetry/api": "{{api-version}}", - "@opentelemetry/exporter-trace-otlp-grpc": "{{exporters-version}}", - "@opentelemetry/exporter-metrics-otlp-grpc": "{{exporters-version}}", "semver": "^7" } } diff --git a/lambda/wrapper b/lambda/wrapper index 5ebd3a4c..3465e7d0 100755 --- a/lambda/wrapper +++ b/lambda/wrapper @@ -1,9 +1,8 @@ #!/bin/bash export NODE_OPTIONS="${NODE_OPTIONS} --import /opt/solarwinds-apm/shim.mjs" -# The default for Node is http/proto but we only include the gRPC exporters -export OTEL_EXPORTER_OTLP_PROTOCOL="grpc" -export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4317" +export OTEL_EXPORTER_OTLP_PROTOCOL="http" +export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4318" # Lambda function is default service name if [ -z "${OTEL_SERVICE_NAME}" ]; then diff --git a/scripts/lambda.js b/scripts/lambda.js index 43401769..83b9b906 100644 --- a/scripts/lambda.js +++ b/scripts/lambda.js @@ -31,8 +31,6 @@ const [name, version] = argv.slice(2) const sdkPackage = JSON.parse(readFileSync("packages/sdk/package.json")) const apiVersion = sdkPackage.peerDependencies["@opentelemetry/api"] -const exportersVersion = - sdkPackage.devDependencies["@opentelemetry/exporter-trace-otlp-grpc"] const rm = (...args) => { try { @@ -48,7 +46,6 @@ const replace = (file) => { .replaceAll("{{name}}", name) .replaceAll("{{version}}", version) .replaceAll("{{api-version}}", apiVersion) - .replaceAll("{{exporters-version}}", exportersVersion) writeFileSync(file, contents) } From 1559cabdac9da824752269b0895d04fcb1fcabbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Th=C3=A9riault?= Date: Fri, 18 Oct 2024 16:15:49 -0400 Subject: [PATCH 04/15] update deps --- .github/workflows/checks.yml | 4 +- examples/express-mysql/package.json | 6 +- examples/fastify-postgres/package.json | 6 +- examples/hello-distributed/package.json | 2 +- examples/next-prisma/package.json | 16 +- examples/package.json | 2 +- package.json | 6 +- packages/bindings/package.json | 4 +- packages/compat/package.json | 2 +- packages/dependencies/package.json | 2 +- packages/eslint-config/package.json | 6 +- packages/histogram/package.json | 2 +- packages/instrumentations/package.json | 6 +- packages/instrumentations/src/index.ts | 6 +- packages/module/package.json | 2 +- packages/proto/package.json | 6 +- packages/sampling/package.json | 2 +- packages/solarwinds-apm/package.json | 6 +- packages/solarwinds-apm/src/config.ts | 1 + .../src/processing/response-time.ts | 2 + .../src/processing/transaction-name.ts | 2 + .../solarwinds-apm/src/sampling/sampler.ts | 23 +- .../test/processing/response-time.test.ts | 1 + packages/test/package.json | 17 +- scripts/package.json | 6 +- yarn.lock | 1018 ++++++++--------- 26 files changed, 582 insertions(+), 574 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index f0e918bd..1227cf03 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -35,8 +35,8 @@ jobs: - run: yarn install --immutable - run: yarn build - - run: yarn lint - - run: yarn test + - run: yarn lint --affected + - run: yarn test --affected env: SW_APM_COLLECTOR: ${{ secrets.SW_APM_COLLECTOR }} SW_APM_SERVICE_KEY: ${{ secrets.SW_APM_SERVICE_KEY }} diff --git a/examples/express-mysql/package.json b/examples/express-mysql/package.json index d7c5b97e..5754a6e0 100644 --- a/examples/express-mysql/package.json +++ b/examples/express-mysql/package.json @@ -6,9 +6,9 @@ }, "dependencies": { "@opentelemetry/api": "^1.3.0", - "express": "^4.18.2", - "mysql2": "^3.6.1", + "express": "^4.21.1", + "mysql2": "^3.11.3", "solarwinds-apm": "workspace:^", - "winston": "^3.10.0" + "winston": "^3.15.0" } } diff --git a/examples/fastify-postgres/package.json b/examples/fastify-postgres/package.json index 80447a99..c6f454cb 100644 --- a/examples/fastify-postgres/package.json +++ b/examples/fastify-postgres/package.json @@ -8,9 +8,9 @@ "dependencies": { "@fastify/postgres": "^5.2.0", "@opentelemetry/api": "^1.3.0", - "fastify": "^4.23.2", - "pg": "^8.11.3", - "pino": "^9.0.0", + "fastify": "^4.28.1", + "pg": "^8.13.0", + "pino": "^9.5.0", "solarwinds-apm": "workspace:^" } } diff --git a/examples/hello-distributed/package.json b/examples/hello-distributed/package.json index 26298481..c01f3f42 100644 --- a/examples/hello-distributed/package.json +++ b/examples/hello-distributed/package.json @@ -10,6 +10,6 @@ "solarwinds-apm": "workspace:^" }, "devDependencies": { - "concurrently": "^9.0.0" + "concurrently": "^9.0.1" } } diff --git a/examples/next-prisma/package.json b/examples/next-prisma/package.json index 53b6027a..c2477077 100644 --- a/examples/next-prisma/package.json +++ b/examples/next-prisma/package.json @@ -8,19 +8,19 @@ }, "dependencies": { "@opentelemetry/api": "^1.3.0", - "@prisma/client": "^5.4.1", - "@prisma/instrumentation": "^5.4.1", - "next": "^14.0.3", - "react": "^18.2.0", - "react-dom": "^18.2.0", + "@prisma/client": "^5.21.1", + "@prisma/instrumentation": "^5.21.1", + "next": "^14.2.15", + "react": "^18.3.1", + "react-dom": "^18.3.1", "solarwinds-apm": "workspace:^" }, "devDependencies": { "@types/node": "^18.19.0", - "@types/react": "^18.2.25", + "@types/react": "^18.3.11", "eslint": "^8.57.0", - "eslint-config-next": "^14.0.3", - "prisma": "^5.4.1", + "eslint-config-next": "^14.2.15", + "prisma": "^5.21.1", "typescript": "~5.5.3" } } diff --git a/examples/package.json b/examples/package.json index 682181c3..9b59b804 100644 --- a/examples/package.json +++ b/examples/package.json @@ -8,7 +8,7 @@ }, "devDependencies": { "@solarwinds-apm/eslint-config": "workspace:^", - "eslint": "^9.9.1", + "eslint": "^9.12.0", "prettier": "^3.3.3", "typescript": "~5.5.3" } diff --git a/package.json b/package.json index 8b2f7793..dbab0650 100644 --- a/package.json +++ b/package.json @@ -27,10 +27,10 @@ "prepare": "husky" }, "devDependencies": { - "eslint": "^9.9.1", - "husky": "^9.0.11", + "eslint": "^9.12.0", + "husky": "^9.1.6", "prettier": "^3.3.3", - "turbo": "^2.0.9", + "turbo": "^2.2.0", "typescript": "~5.5.3" } } diff --git a/packages/bindings/package.json b/packages/bindings/package.json index 49dd12e6..b16311d7 100644 --- a/packages/bindings/package.json +++ b/packages/bindings/package.json @@ -48,8 +48,8 @@ "@solarwinds-apm/eslint-config": "workspace:^", "@solarwinds-apm/test": "workspace:^", "@types/node": "^18.19.0", - "eslint": "^9.9.1", - "node-addon-api": "^8.1.0", + "eslint": "^9.12.0", + "node-addon-api": "^8.2.1", "prettier": "^3.3.3", "typescript": "~5.5.3", "zig-build": "^0.3.0" diff --git a/packages/compat/package.json b/packages/compat/package.json index 531729d4..d76ae8cd 100644 --- a/packages/compat/package.json +++ b/packages/compat/package.json @@ -47,7 +47,7 @@ "@solarwinds-apm/eslint-config": "workspace:^", "@solarwinds-apm/test": "workspace:^", "@types/node": "^18.19.0", - "eslint": "^9.9.1", + "eslint": "^9.12.0", "prettier": "^3.3.3", "typescript": "~5.5.3" }, diff --git a/packages/dependencies/package.json b/packages/dependencies/package.json index 6308f103..c4803efd 100644 --- a/packages/dependencies/package.json +++ b/packages/dependencies/package.json @@ -41,7 +41,7 @@ "@solarwinds-apm/eslint-config": "workspace:^", "@solarwinds-apm/test": "workspace:^", "@types/node": "^18.19.0", - "eslint": "^9.9.1", + "eslint": "^9.12.0", "prettier": "^3.3.3", "typescript": "~5.5.3" }, diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index cd349d48..92e85651 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -31,11 +31,11 @@ "release": "node ../../scripts/publish.js" }, "dependencies": { - "@eslint/js": "^9.9.1", + "@eslint/js": "^9.12.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-notice": "^1.0.0", "eslint-plugin-simple-import-sort": "^12.1.1", - "typescript-eslint": "^8.3.0" + "typescript-eslint": "^8.10.0" }, "peerDependencies": { "eslint": "^9.0.0", @@ -54,7 +54,7 @@ } }, "devDependencies": { - "eslint": "^9.9.1", + "eslint": "^9.12.0", "prettier": "^3.3.3", "typescript": "~5.5.3" } diff --git a/packages/histogram/package.json b/packages/histogram/package.json index 0b69a87d..47ba430d 100644 --- a/packages/histogram/package.json +++ b/packages/histogram/package.json @@ -38,7 +38,7 @@ "@opentelemetry/sdk-metrics": "~1.26.0", "@solarwinds-apm/eslint-config": "workspace:^", "@types/node": "^18.19.0", - "eslint": "^9.9.1", + "eslint": "^9.12.0", "prettier": "^3.3.3", "typescript": "~5.5.3" }, diff --git a/packages/instrumentations/package.json b/packages/instrumentations/package.json index f434eff3..e07e0d24 100644 --- a/packages/instrumentations/package.json +++ b/packages/instrumentations/package.json @@ -92,10 +92,10 @@ "devDependencies": { "@opentelemetry/api": "^1.3.0", "@solarwinds-apm/eslint-config": "workspace:^", - "@types/semver": "^7.5.3", - "eslint": "^9.9.1", + "@types/semver": "^7.5.8", + "eslint": "^9.12.0", "prettier": "^3.3.3", - "semver": "^7.5.4", + "semver": "^7.6.3", "typescript": "~5.5.3" }, "engines": { diff --git a/packages/instrumentations/src/index.ts b/packages/instrumentations/src/index.ts index 27552122..c6bb12fb 100644 --- a/packages/instrumentations/src/index.ts +++ b/packages/instrumentations/src/index.ts @@ -275,9 +275,9 @@ export function getResource( resourceDetectors.map(async ({ module, name }) => { try { const loaded = await load(module) - const detector = ( - loaded as Record - )[name] + const detector = + // eslint-disable-next-line @typescript-eslint/no-deprecated + (loaded as Record)[name] const resource = await detector.detect() await resource.waitForAsyncAttributes?.() diff --git a/packages/module/package.json b/packages/module/package.json index ccfe5b87..2ca9860c 100644 --- a/packages/module/package.json +++ b/packages/module/package.json @@ -36,7 +36,7 @@ "devDependencies": { "@solarwinds-apm/eslint-config": "workspace:^", "@types/node": "^18.19.0", - "eslint": "^9.9.1", + "eslint": "^9.12.0", "prettier": "^3.3.3", "typescript": "~5.5.3" }, diff --git a/packages/proto/package.json b/packages/proto/package.json index 852a1daa..db311baa 100644 --- a/packages/proto/package.json +++ b/packages/proto/package.json @@ -34,13 +34,13 @@ "release": "node ../../scripts/publish.js" }, "dependencies": { - "protobufjs": "^7.2.6" + "protobufjs": "^7.4.0" }, "devDependencies": { "@solarwinds-apm/eslint-config": "workspace:^", - "eslint": "^9.9.1", + "eslint": "^9.12.0", "prettier": "^3.3.3", - "protobufjs-cli": "^1.1.2", + "protobufjs-cli": "^1.1.3", "typescript": "~5.5.3" }, "engines": { diff --git a/packages/sampling/package.json b/packages/sampling/package.json index 3abeac7e..45c739b8 100644 --- a/packages/sampling/package.json +++ b/packages/sampling/package.json @@ -51,7 +51,7 @@ "@solarwinds-apm/eslint-config": "workspace:^", "@solarwinds-apm/test": "workspace:^", "@types/node": "^18.19.0", - "eslint": "^9.9.1", + "eslint": "^9.12.0", "prettier": "^3.3.3", "typescript": "~5.5.3" }, diff --git a/packages/solarwinds-apm/package.json b/packages/solarwinds-apm/package.json index 063e98ca..e5971fcb 100644 --- a/packages/solarwinds-apm/package.json +++ b/packages/solarwinds-apm/package.json @@ -55,7 +55,7 @@ "test": "swtest -p test/tsconfig.json -c src" }, "dependencies": { - "@grpc/grpc-js": "^1.10.6", + "@grpc/grpc-js": "^1.12.2", "@opentelemetry/api-logs": "~0.53.0", "@opentelemetry/core": "~1.26.0", "@opentelemetry/exporter-logs-otlp-proto": "~0.53.0", @@ -77,7 +77,7 @@ "@solarwinds-apm/sampling": "workspace:^", "json-stringify-safe": "^5.0.1", "node-releases": "^2.0.18", - "zod": "^3.22.4" + "zod": "^3.23.8" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" @@ -93,7 +93,7 @@ "@solarwinds-apm/test": "workspace:^", "@types/json-stringify-safe": "^5.0.3", "@types/node": "^18.19.0", - "eslint": "^9.9.1", + "eslint": "^9.12.0", "prettier": "^3.3.3", "typescript": "~5.5.3" }, diff --git a/packages/solarwinds-apm/src/config.ts b/packages/solarwinds-apm/src/config.ts index 606f4187..20bbfbfc 100644 --- a/packages/solarwinds-apm/src/config.ts +++ b/packages/solarwinds-apm/src/config.ts @@ -139,6 +139,7 @@ interface Instrumentations { interface ResourceDetectors { configs?: ResourceDetectorConfigMap + // eslint-disable-next-line @typescript-eslint/no-deprecated extra?: (DetectorSync | Detector)[] set?: Set } diff --git a/packages/solarwinds-apm/src/processing/response-time.ts b/packages/solarwinds-apm/src/processing/response-time.ts index c1e83820..a290f88e 100644 --- a/packages/solarwinds-apm/src/processing/response-time.ts +++ b/packages/solarwinds-apm/src/processing/response-time.ts @@ -71,7 +71,9 @@ export class ResponseTimeProcessor copy.push( ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_STATUS_CODE, + // eslint-disable-next-line @typescript-eslint/no-deprecated ATTR_HTTP_METHOD, + // eslint-disable-next-line @typescript-eslint/no-deprecated ATTR_HTTP_STATUS_CODE, ) } diff --git a/packages/solarwinds-apm/src/processing/transaction-name.ts b/packages/solarwinds-apm/src/processing/transaction-name.ts index 11d3373c..7ba6a734 100644 --- a/packages/solarwinds-apm/src/processing/transaction-name.ts +++ b/packages/solarwinds-apm/src/processing/transaction-name.ts @@ -95,6 +95,7 @@ export class TransactionNameProcessor } /** Computes a transaction name from a span and its attributes */ +/* eslint-disable @typescript-eslint/no-deprecated */ export function computedTransactionName(span: ReadableSpan): string { if (typeof process.env.AWS_LAMBDA_FUNCTION_NAME === "string") { return process.env.AWS_LAMBDA_FUNCTION_NAME @@ -110,6 +111,7 @@ export function computedTransactionName(span: ReadableSpan): string { return span.name } } +/* eslint-enable @typescript-eslint/no-deprecated */ /** * A pool that prevents explosion of cardinality in transaction names diff --git a/packages/solarwinds-apm/src/sampling/sampler.ts b/packages/solarwinds-apm/src/sampling/sampler.ts index e4b5d759..ed05868d 100644 --- a/packages/solarwinds-apm/src/sampling/sampler.ts +++ b/packages/solarwinds-apm/src/sampling/sampler.ts @@ -57,29 +57,44 @@ export function httpSpanMetadata(kind: SpanKind, attributes: Attributes) { // The method attribute is always required so we can tell whether this is HTTP from it if ( kind !== SpanKind.SERVER || - !(ATTR_HTTP_REQUEST_METHOD in attributes || ATTR_HTTP_METHOD in attributes) + !( + ATTR_HTTP_REQUEST_METHOD in attributes || + // eslint-disable-next-line @typescript-eslint/no-deprecated + ATTR_HTTP_METHOD in attributes + ) ) { return { http: false } as const } const method = String( - attributes[ATTR_HTTP_REQUEST_METHOD] ?? attributes[ATTR_HTTP_METHOD], + attributes[ATTR_HTTP_REQUEST_METHOD] ?? + // eslint-disable-next-line @typescript-eslint/no-deprecated + attributes[ATTR_HTTP_METHOD], ) const status = Number( attributes[ATTR_HTTP_RESPONSE_STATUS_CODE] ?? + // eslint-disable-next-line @typescript-eslint/no-deprecated attributes[ATTR_HTTP_STATUS_CODE] ?? 0, ) const scheme = String( - attributes[ATTR_URL_SCHEME] ?? attributes[ATTR_HTTP_SCHEME] ?? "http", + attributes[ATTR_URL_SCHEME] ?? + // eslint-disable-next-line @typescript-eslint/no-deprecated + attributes[ATTR_HTTP_SCHEME] ?? + "http", ) const hostname = String( attributes[ATTR_SERVER_ADDRESS] ?? + // eslint-disable-next-line @typescript-eslint/no-deprecated attributes[ATTR_NET_HOST_NAME] ?? "localhost", ) - const path = String(attributes[ATTR_URL_PATH] ?? attributes[ATTR_HTTP_TARGET]) + const path = String( + attributes[ATTR_URL_PATH] ?? + // eslint-disable-next-line @typescript-eslint/no-deprecated + attributes[ATTR_HTTP_TARGET], + ) const url = `${scheme}://${hostname}${path}` return { diff --git a/packages/solarwinds-apm/test/processing/response-time.test.ts b/packages/solarwinds-apm/test/processing/response-time.test.ts index 43ab4deb..49025ca9 100644 --- a/packages/solarwinds-apm/test/processing/response-time.test.ts +++ b/packages/solarwinds-apm/test/processing/response-time.test.ts @@ -125,6 +125,7 @@ describe("ResponseTimeProcessor", () => { span.end() }) + // eslint-disable-next-line @typescript-eslint/no-deprecated span.setAttribute(ATTR_HTTP_STATUS_CODE, 200) span.end() }, diff --git a/packages/test/package.json b/packages/test/package.json index 959f6929..ad9e0b65 100644 --- a/packages/test/package.json +++ b/packages/test/package.json @@ -42,17 +42,17 @@ "release": "node ../../scripts/publish.js" }, "dependencies": { - "@types/chai": "^4.3.6", - "@types/chai-as-promised": "^7.1.6", - "@types/mocha": "^10.0.7", + "@types/chai": "^4.3.20", + "@types/chai-as-promised": "^7.1.8", + "@types/mocha": "^10.0.9", "@types/node": "^18.19.0", "c8": "^10.1.2", - "chai": "^4.3.10", - "chai-as-promised": "^7.1.1", + "chai": "^4.5.0", + "chai-as-promised": "^7.1.2", "dotenv": "^16.4.5", "globby": "^11.1.0", - "mocha": "^10.3.0", - "semver": "^7.5.4", + "mocha": "^10.7.3", + "semver": "^7.6.3", "ts-node": "^11.0.0-beta.1" }, "devDependencies": { @@ -61,7 +61,8 @@ "@opentelemetry/sdk-trace-base": "~1.26.0", "@opentelemetry/sdk-trace-node": "~1.26.0", "@solarwinds-apm/eslint-config": "workspace:^", - "eslint": "^9.9.1", + "@types/semver": "^7.5.8", + "eslint": "^9.12.0", "prettier": "^3.3.3", "typescript": "~5.5.3" }, diff --git a/scripts/package.json b/scripts/package.json index 9a8c1332..e3c9e5da 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -6,12 +6,12 @@ "lint:fix": "eslint --fix . && prettier --write ." }, "dependencies": { - "bson": "^6.1.0" + "bson": "^6.8.0" }, "devDependencies": { "@solarwinds-apm/eslint-config": "workspace:^", - "archiver": "^7.0.0", - "eslint": "^9.9.1", + "archiver": "^7.0.1", + "eslint": "^9.12.0", "ora": "^5.4.1", "prettier": "^3.3.3", "typescript": "~5.5.3" diff --git a/yarn.lock b/yarn.lock index fc8b0579..09d6bf6b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -100,7 +100,7 @@ __metadata: languageName: node linkType: hard -"@eslint-community/regexpp@npm:^4.10.0, @eslint-community/regexpp@npm:^4.11.0, @eslint-community/regexpp@npm:^4.5.1, @eslint-community/regexpp@npm:^4.6.1": +"@eslint-community/regexpp@npm:^4.10.0, @eslint-community/regexpp@npm:^4.11.0, @eslint-community/regexpp@npm:^4.6.1": version: 4.11.0 resolution: "@eslint-community/regexpp@npm:4.11.0" checksum: 10c0/0f6328869b2741e2794da4ad80beac55cba7de2d3b44f796a60955b0586212ec75e6b0253291fd4aad2100ad471d1480d8895f2b54f1605439ba4c875e05e523 @@ -118,6 +118,13 @@ __metadata: languageName: node linkType: hard +"@eslint/core@npm:^0.6.0": + version: 0.6.0 + resolution: "@eslint/core@npm:0.6.0" + checksum: 10c0/fffdb3046ad6420f8cb9204b6466fdd8632a9baeebdaf2a97d458a4eac0e16653ba50d82d61835d7d771f6ced0ec942ec482b2fbccc300e45f2cbf784537f240 + languageName: node + linkType: hard + "@eslint/eslintrc@npm:^2.1.4": version: 2.1.4 resolution: "@eslint/eslintrc@npm:2.1.4" @@ -159,17 +166,10 @@ __metadata: languageName: node linkType: hard -"@eslint/js@npm:9.9.1": - version: 9.9.1 - resolution: "@eslint/js@npm:9.9.1" - checksum: 10c0/a3a91de2ce78469f7c4eee78c1eba77360706e1d0fa0ace2e19102079bcf237b851217c85ea501dc92c4c3719d60d9df966977abc8554d4c38e3638c1f53dcb2 - languageName: node - linkType: hard - -"@eslint/js@npm:^9.9.1": - version: 9.10.0 - resolution: "@eslint/js@npm:9.10.0" - checksum: 10c0/2ac45a002dc1ccf25be46ea61001ada8d77248d1313ab4e53f3735e5ae00738a757874e41f62ad6fbd49df7dffeece66e5f53ff0d7b78a99ce4c68e8fea66753 +"@eslint/js@npm:9.12.0, @eslint/js@npm:^9.12.0": + version: 9.12.0 + resolution: "@eslint/js@npm:9.12.0" + checksum: 10c0/325650a59a1ce3d97c69441501ebaf415607248bacbe8c8ca35adc7cb73b524f592f266a75772f496b06f3239e3ee1996722a242148085f0ee5fb3dd7065897c languageName: node linkType: hard @@ -180,6 +180,15 @@ __metadata: languageName: node linkType: hard +"@eslint/plugin-kit@npm:^0.2.0": + version: 0.2.0 + resolution: "@eslint/plugin-kit@npm:0.2.0" + dependencies: + levn: "npm:^0.4.1" + checksum: 10c0/00b92bc52ad09b0e2bbbb30591c02a895f0bec3376759562590e8a57a13d096b22f8c8773b6bf791a7cf2ea614123b3d592fd006c51ac5fd0edbb90ea6d8760c + languageName: node + linkType: hard + "@fastify/ajv-compiler@npm:^3.5.0": version: 3.5.0 resolution: "@fastify/ajv-compiler@npm:3.5.0" @@ -227,13 +236,13 @@ __metadata: languageName: node linkType: hard -"@grpc/grpc-js@npm:^1.10.6": - version: 1.11.2 - resolution: "@grpc/grpc-js@npm:1.11.2" +"@grpc/grpc-js@npm:^1.12.2": + version: 1.12.2 + resolution: "@grpc/grpc-js@npm:1.12.2" dependencies: "@grpc/proto-loader": "npm:^0.7.13" "@js-sdsl/ordered-map": "npm:^4.4.2" - checksum: 10c0/d69a1db3726d7a09a54394971bd54c77dfc2e8f48b23384771a2074ecc947b240ea065b4f1d74300e76fd47d7914071460d98702bd1512b7a9d6085eac6a6012 + checksum: 10c0/0370bdec80a5d73f0929c4b7a882af3b0ca85ed1fda361ce3986b705eb2aa9be59bba39a18b99cc05080d5c0819b319a56796dfde248375971ba64efd55fc9d6 languageName: node linkType: hard @@ -251,6 +260,23 @@ __metadata: languageName: node linkType: hard +"@humanfs/core@npm:^0.19.0": + version: 0.19.0 + resolution: "@humanfs/core@npm:0.19.0" + checksum: 10c0/f87952d5caba6ae427a620eff783c5d0b6cef0cfc256dec359cdaa636c5f161edb8d8dad576742b3de7f0b2f222b34aad6870248e4b7d2177f013426cbcda232 + languageName: node + linkType: hard + +"@humanfs/node@npm:^0.16.5": + version: 0.16.5 + resolution: "@humanfs/node@npm:0.16.5" + dependencies: + "@humanfs/core": "npm:^0.19.0" + "@humanwhocodes/retry": "npm:^0.3.0" + checksum: 10c0/41c365ab09e7c9eaeed373d09243195aef616d6745608a36fc3e44506148c28843872f85e69e2bf5f1e992e194286155a1c1cecfcece6a2f43875e37cd243935 + languageName: node + linkType: hard + "@humanwhocodes/config-array@npm:^0.11.14": version: 0.11.14 resolution: "@humanwhocodes/config-array@npm:0.11.14" @@ -283,6 +309,13 @@ __metadata: languageName: node linkType: hard +"@humanwhocodes/retry@npm:^0.3.1": + version: 0.3.1 + resolution: "@humanwhocodes/retry@npm:0.3.1" + checksum: 10c0/f0da1282dfb45e8120480b9e2e275e2ac9bbe1cf016d046fdad8e27cc1285c45bb9e711681237944445157b430093412b4446c1ab3fc4bb037861b5904101d3b + languageName: node + linkType: hard + "@isaacs/cliui@npm:^8.0.2": version: 8.0.2 resolution: "@isaacs/cliui@npm:8.0.2" @@ -354,81 +387,81 @@ __metadata: languageName: node linkType: hard -"@next/env@npm:14.2.8": - version: 14.2.8 - resolution: "@next/env@npm:14.2.8" - checksum: 10c0/8fd09c932ff472c9fd6c58c532f85972b7b0c72ef40bd937034ae34f3ff2692d6c829ef31b30eda761d467b1cd2c7ab7ad31aed829547546483e8beaf6d753f9 +"@next/env@npm:14.2.15": + version: 14.2.15 + resolution: "@next/env@npm:14.2.15" + checksum: 10c0/b1af95941bd7e080276af0901512c8c56b4e157402d2d913feca435c6a6f01130c9f322cca67e5c2b1ca160f54f6c0c4913fb8a3201812a5bb62dbdccae6f8fa languageName: node linkType: hard -"@next/eslint-plugin-next@npm:14.2.8": - version: 14.2.8 - resolution: "@next/eslint-plugin-next@npm:14.2.8" +"@next/eslint-plugin-next@npm:14.2.15": + version: 14.2.15 + resolution: "@next/eslint-plugin-next@npm:14.2.15" dependencies: glob: "npm:10.3.10" - checksum: 10c0/577b336feae3cd915af5befd6fd0e733e396b98dcdce792e406a7ebf020cc4a206e44f16d8cfb21416000086951c1f0eef37a6492551eae64c3e756c81356c95 + checksum: 10c0/54dd8cd8fd47722528ffb7862a8e079bbc07d9131125502273ec88a706238d7a7d2e4abf3ba72ee2a21ea2890de53bf6dfec0308ddf9cfc7794a4b5bbc5d06cc languageName: node linkType: hard -"@next/swc-darwin-arm64@npm:14.2.8": - version: 14.2.8 - resolution: "@next/swc-darwin-arm64@npm:14.2.8" +"@next/swc-darwin-arm64@npm:14.2.15": + version: 14.2.15 + resolution: "@next/swc-darwin-arm64@npm:14.2.15" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@next/swc-darwin-x64@npm:14.2.8": - version: 14.2.8 - resolution: "@next/swc-darwin-x64@npm:14.2.8" +"@next/swc-darwin-x64@npm:14.2.15": + version: 14.2.15 + resolution: "@next/swc-darwin-x64@npm:14.2.15" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@next/swc-linux-arm64-gnu@npm:14.2.8": - version: 14.2.8 - resolution: "@next/swc-linux-arm64-gnu@npm:14.2.8" +"@next/swc-linux-arm64-gnu@npm:14.2.15": + version: 14.2.15 + resolution: "@next/swc-linux-arm64-gnu@npm:14.2.15" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@next/swc-linux-arm64-musl@npm:14.2.8": - version: 14.2.8 - resolution: "@next/swc-linux-arm64-musl@npm:14.2.8" +"@next/swc-linux-arm64-musl@npm:14.2.15": + version: 14.2.15 + resolution: "@next/swc-linux-arm64-musl@npm:14.2.15" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@next/swc-linux-x64-gnu@npm:14.2.8": - version: 14.2.8 - resolution: "@next/swc-linux-x64-gnu@npm:14.2.8" +"@next/swc-linux-x64-gnu@npm:14.2.15": + version: 14.2.15 + resolution: "@next/swc-linux-x64-gnu@npm:14.2.15" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@next/swc-linux-x64-musl@npm:14.2.8": - version: 14.2.8 - resolution: "@next/swc-linux-x64-musl@npm:14.2.8" +"@next/swc-linux-x64-musl@npm:14.2.15": + version: 14.2.15 + resolution: "@next/swc-linux-x64-musl@npm:14.2.15" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@next/swc-win32-arm64-msvc@npm:14.2.8": - version: 14.2.8 - resolution: "@next/swc-win32-arm64-msvc@npm:14.2.8" +"@next/swc-win32-arm64-msvc@npm:14.2.15": + version: 14.2.15 + resolution: "@next/swc-win32-arm64-msvc@npm:14.2.15" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@next/swc-win32-ia32-msvc@npm:14.2.8": - version: 14.2.8 - resolution: "@next/swc-win32-ia32-msvc@npm:14.2.8" +"@next/swc-win32-ia32-msvc@npm:14.2.15": + version: 14.2.15 + resolution: "@next/swc-win32-ia32-msvc@npm:14.2.15" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@next/swc-win32-x64-msvc@npm:14.2.8": - version: 14.2.8 - resolution: "@next/swc-win32-x64-msvc@npm:14.2.8" +"@next/swc-win32-x64-msvc@npm:14.2.15": + version: 14.2.15 + resolution: "@next/swc-win32-x64-msvc@npm:14.2.15" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -1083,7 +1116,7 @@ __metadata: languageName: node linkType: hard -"@opentelemetry/instrumentation@npm:0.53.0, @opentelemetry/instrumentation@npm:^0.53.0, @opentelemetry/instrumentation@npm:~0.53.0": +"@opentelemetry/instrumentation@npm:0.53.0, @opentelemetry/instrumentation@npm:^0.49 || ^0.50 || ^0.51 || ^0.52.0 || ^0.53.0, @opentelemetry/instrumentation@npm:^0.53.0, @opentelemetry/instrumentation@npm:~0.53.0": version: 0.53.0 resolution: "@opentelemetry/instrumentation@npm:0.53.0" dependencies: @@ -1099,7 +1132,7 @@ __metadata: languageName: node linkType: hard -"@opentelemetry/instrumentation@npm:^0.49 || ^0.50 || ^0.51 || ^0.52.0, @opentelemetry/instrumentation@npm:^0.52.0": +"@opentelemetry/instrumentation@npm:^0.52.0": version: 0.52.1 resolution: "@opentelemetry/instrumentation@npm:0.52.1" dependencies: @@ -1332,72 +1365,72 @@ __metadata: languageName: node linkType: hard -"@prisma/client@npm:^5.4.1": - version: 5.19.1 - resolution: "@prisma/client@npm:5.19.1" +"@prisma/client@npm:^5.21.1": + version: 5.21.1 + resolution: "@prisma/client@npm:5.21.1" peerDependencies: prisma: "*" peerDependenciesMeta: prisma: optional: true - checksum: 10c0/3fd0c77c831cf592155539d0d369849d5c4f6bbe483b7e5ed476aad29434491a0d5a63ebcda86852484b808fa94bdd614c7715fb2084c0696fdcedd21d3671fb + checksum: 10c0/066bf678d6bda048893eb9080818339a99bba995a0ba19935cccda30a10eb46c6674bc445bbbbb37881e52d3010c72ce4a28565156b80bfea5438cafd9868941 languageName: node linkType: hard -"@prisma/debug@npm:5.19.1": - version: 5.19.1 - resolution: "@prisma/debug@npm:5.19.1" - checksum: 10c0/4b88719b9a0dd76692bec766fd8188b685a81f0459f3df8fb44b4c492b483a6aadaf7021f7aca90afa5a2f27d84d737a3f2d5abed5f9f818a640487f49d1b8c4 +"@prisma/debug@npm:5.21.1": + version: 5.21.1 + resolution: "@prisma/debug@npm:5.21.1" + checksum: 10c0/5d69a13ae83efe3748efabb16ceae1dc0e9c2cc0c132e7fe46016a85a6d403eaa994094e8b30fb660b42e23abf5034b8ac1733bca30d6d66cb3fd763281e64e1 languageName: node linkType: hard -"@prisma/engines-version@npm:5.19.1-2.69d742ee20b815d88e17e54db4a2a7a3b30324e3": - version: 5.19.1-2.69d742ee20b815d88e17e54db4a2a7a3b30324e3 - resolution: "@prisma/engines-version@npm:5.19.1-2.69d742ee20b815d88e17e54db4a2a7a3b30324e3" - checksum: 10c0/9bf4ad5b199054fe56a96ddbda1b835e7f103d690d2b7d04c159f29399261356516ec8881e8caf637bd4523395ccc4ce450013a0c9a8a3ffa16d2fc15b93bfa8 +"@prisma/engines-version@npm:5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36": + version: 5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36 + resolution: "@prisma/engines-version@npm:5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36" + checksum: 10c0/3b4ca9f8911c36da847740951f73b2ab66f2f3619530dea7a9667764e8853675d2b7fbbd24e2568ece5ad9c5a78c5498e44be94af2979372d7b8743c83ee27a1 languageName: node linkType: hard -"@prisma/engines@npm:5.19.1": - version: 5.19.1 - resolution: "@prisma/engines@npm:5.19.1" +"@prisma/engines@npm:5.21.1": + version: 5.21.1 + resolution: "@prisma/engines@npm:5.21.1" dependencies: - "@prisma/debug": "npm:5.19.1" - "@prisma/engines-version": "npm:5.19.1-2.69d742ee20b815d88e17e54db4a2a7a3b30324e3" - "@prisma/fetch-engine": "npm:5.19.1" - "@prisma/get-platform": "npm:5.19.1" - checksum: 10c0/d12893935d842fea1c5344e3ab0f769b01ec1c71a91bec3ac9ceb58838fe7f745d226d5b8b9ac386ad503c56773272586bb73188d592ec8d4e05f43285009155 + "@prisma/debug": "npm:5.21.1" + "@prisma/engines-version": "npm:5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36" + "@prisma/fetch-engine": "npm:5.21.1" + "@prisma/get-platform": "npm:5.21.1" + checksum: 10c0/5a6a76457da5cb075e39a21e566b7e03295cacd357182b0f96f849e9950676c2a9d49cdaac7b974b1b9af6a350d96791a8fd30cf7814a669fa77e14ba17a7531 languageName: node linkType: hard -"@prisma/fetch-engine@npm:5.19.1": - version: 5.19.1 - resolution: "@prisma/fetch-engine@npm:5.19.1" +"@prisma/fetch-engine@npm:5.21.1": + version: 5.21.1 + resolution: "@prisma/fetch-engine@npm:5.21.1" dependencies: - "@prisma/debug": "npm:5.19.1" - "@prisma/engines-version": "npm:5.19.1-2.69d742ee20b815d88e17e54db4a2a7a3b30324e3" - "@prisma/get-platform": "npm:5.19.1" - checksum: 10c0/670d3f604549c4778d32febe56d948896b5c16dad5b51814c5b168a6007c9782d453cebee43cb81ddd58c9e9538811ea1a793516420ecf2c84ae4c3b4ed34f6c + "@prisma/debug": "npm:5.21.1" + "@prisma/engines-version": "npm:5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36" + "@prisma/get-platform": "npm:5.21.1" + checksum: 10c0/068663fa15cb204d033b166588157915be11571a1584c914372968248faab0f7c236ec1086aaf194929ece3ae2a3d2d0b28e33dac114a1545e0dee1011dc669c languageName: node linkType: hard -"@prisma/get-platform@npm:5.19.1": - version: 5.19.1 - resolution: "@prisma/get-platform@npm:5.19.1" +"@prisma/get-platform@npm:5.21.1": + version: 5.21.1 + resolution: "@prisma/get-platform@npm:5.21.1" dependencies: - "@prisma/debug": "npm:5.19.1" - checksum: 10c0/a53b5c894cf4074af6164d9c503e387aba92c518ad7bad82be40f834a0030270c60f6149b20951c3e1db32bd836f582053e63c4bf7099461f0160dd5956f063e + "@prisma/debug": "npm:5.21.1" + checksum: 10c0/3e6f2378e8a6086db0cc02e95e5b872b602263d0b2e55c3e18f6041bbbf9edea5edbfb9efce331527e75e13411eee68d2b34c24b9aeac9c579e75aac2a39432c languageName: node linkType: hard -"@prisma/instrumentation@npm:^5.4.1": - version: 5.19.1 - resolution: "@prisma/instrumentation@npm:5.19.1" +"@prisma/instrumentation@npm:^5.21.1": + version: 5.21.1 + resolution: "@prisma/instrumentation@npm:5.21.1" dependencies: "@opentelemetry/api": "npm:^1.8" - "@opentelemetry/instrumentation": "npm:^0.49 || ^0.50 || ^0.51 || ^0.52.0" + "@opentelemetry/instrumentation": "npm:^0.49 || ^0.50 || ^0.51 || ^0.52.0 || ^0.53.0" "@opentelemetry/sdk-trace-base": "npm:^1.22" - checksum: 10c0/437ca8b61815642cb511bfbe9d5ba64a94accbd4902a037ab12b68e9ca77a9bf74c9269b6b3fd02a4bfd7474209e151accc24f051dd99828568c9df5f57d4a0d + checksum: 10c0/279fc16d12f24b5565b4f24164ccea14aa37354185bef7dc6a33f980dc5b44338d6f9cc07e74f6d720bb1889adc0aff567ba905486d74eb9bfa4176b7d2fd7bd languageName: node linkType: hard @@ -1516,8 +1549,8 @@ __metadata: "@solarwinds-apm/eslint-config": "workspace:^" "@solarwinds-apm/test": "workspace:^" "@types/node": "npm:^18.19.0" - eslint: "npm:^9.9.1" - node-addon-api: "npm:^8.1.0" + eslint: "npm:^9.12.0" + node-addon-api: "npm:^8.2.1" prettier: "npm:^3.3.3" typescript: "npm:~5.5.3" zig-build: "npm:^0.3.0" @@ -1542,7 +1575,7 @@ __metadata: "@solarwinds-apm/eslint-config": "workspace:^" "@solarwinds-apm/test": "workspace:^" "@types/node": "npm:^18.19.0" - eslint: "npm:^9.9.1" + eslint: "npm:^9.12.0" prettier: "npm:^3.3.3" typescript: "npm:~5.5.3" peerDependencies: @@ -1561,7 +1594,7 @@ __metadata: "@solarwinds-apm/module": "workspace:^" "@solarwinds-apm/test": "workspace:^" "@types/node": "npm:^18.19.0" - eslint: "npm:^9.9.1" + eslint: "npm:^9.12.0" prettier: "npm:^3.3.3" typescript: "npm:~5.5.3" languageName: unknown @@ -1571,14 +1604,14 @@ __metadata: version: 0.0.0-use.local resolution: "@solarwinds-apm/eslint-config@workspace:packages/eslint-config" dependencies: - "@eslint/js": "npm:^9.9.1" - eslint: "npm:^9.9.1" + "@eslint/js": "npm:^9.12.0" + eslint: "npm:^9.12.0" eslint-config-prettier: "npm:^9.1.0" eslint-plugin-notice: "npm:^1.0.0" eslint-plugin-simple-import-sort: "npm:^12.1.1" prettier: "npm:^3.3.3" typescript: "npm:~5.5.3" - typescript-eslint: "npm:^8.3.0" + typescript-eslint: "npm:^8.10.0" peerDependencies: eslint: ^9.0.0 prettier: ^3.0.0 @@ -1598,10 +1631,10 @@ __metadata: resolution: "@solarwinds-apm/example-express-mysql@workspace:examples/express-mysql" dependencies: "@opentelemetry/api": "npm:^1.3.0" - express: "npm:^4.18.2" - mysql2: "npm:^3.6.1" + express: "npm:^4.21.1" + mysql2: "npm:^3.11.3" solarwinds-apm: "workspace:^" - winston: "npm:^3.10.0" + winston: "npm:^3.15.0" languageName: unknown linkType: soft @@ -1611,9 +1644,9 @@ __metadata: dependencies: "@fastify/postgres": "npm:^5.2.0" "@opentelemetry/api": "npm:^1.3.0" - fastify: "npm:^4.23.2" - pg: "npm:^8.11.3" - pino: "npm:^9.0.0" + fastify: "npm:^4.28.1" + pg: "npm:^8.13.0" + pino: "npm:^9.5.0" solarwinds-apm: "workspace:^" languageName: unknown linkType: soft @@ -1623,7 +1656,7 @@ __metadata: resolution: "@solarwinds-apm/example-hello-distributed@workspace:examples/hello-distributed" dependencies: "@opentelemetry/api": "npm:^1.3.0" - concurrently: "npm:^9.0.0" + concurrently: "npm:^9.0.1" solarwinds-apm: "workspace:^" languageName: unknown linkType: soft @@ -1651,16 +1684,16 @@ __metadata: resolution: "@solarwinds-apm/example-next-prisma@workspace:examples/next-prisma" dependencies: "@opentelemetry/api": "npm:^1.3.0" - "@prisma/client": "npm:^5.4.1" - "@prisma/instrumentation": "npm:^5.4.1" + "@prisma/client": "npm:^5.21.1" + "@prisma/instrumentation": "npm:^5.21.1" "@types/node": "npm:^18.19.0" - "@types/react": "npm:^18.2.25" + "@types/react": "npm:^18.3.11" eslint: "npm:^8.57.0" - eslint-config-next: "npm:^14.0.3" - next: "npm:^14.0.3" - prisma: "npm:^5.4.1" - react: "npm:^18.2.0" - react-dom: "npm:^18.2.0" + eslint-config-next: "npm:^14.2.15" + next: "npm:^14.2.15" + prisma: "npm:^5.21.1" + react: "npm:^18.3.1" + react-dom: "npm:^18.3.1" solarwinds-apm: "workspace:^" typescript: "npm:~5.5.3" languageName: unknown @@ -1671,7 +1704,7 @@ __metadata: resolution: "@solarwinds-apm/examples@workspace:examples" dependencies: "@solarwinds-apm/eslint-config": "workspace:^" - eslint: "npm:^9.9.1" + eslint: "npm:^9.12.0" prettier: "npm:^3.3.3" typescript: "npm:~5.5.3" languageName: unknown @@ -1685,7 +1718,7 @@ __metadata: "@opentelemetry/sdk-metrics": "npm:~1.26.0" "@solarwinds-apm/eslint-config": "workspace:^" "@types/node": "npm:^18.19.0" - eslint: "npm:^9.9.1" + eslint: "npm:^9.12.0" prettier: "npm:^3.3.3" typescript: "npm:~5.5.3" languageName: unknown @@ -1743,10 +1776,10 @@ __metadata: "@opentelemetry/winston-transport": "npm:^0.6.0" "@solarwinds-apm/eslint-config": "workspace:^" "@solarwinds-apm/module": "workspace:^" - "@types/semver": "npm:^7.5.3" - eslint: "npm:^9.9.1" + "@types/semver": "npm:^7.5.8" + eslint: "npm:^9.12.0" prettier: "npm:^3.3.3" - semver: "npm:^7.5.4" + semver: "npm:^7.6.3" typescript: "npm:~5.5.3" peerDependencies: "@opentelemetry/api": ^1.3.0 @@ -1762,7 +1795,7 @@ __metadata: dependencies: "@solarwinds-apm/eslint-config": "workspace:^" "@types/node": "npm:^18.19.0" - eslint: "npm:^9.9.1" + eslint: "npm:^9.12.0" prettier: "npm:^3.3.3" typescript: "npm:~5.5.3" languageName: unknown @@ -1773,10 +1806,10 @@ __metadata: resolution: "@solarwinds-apm/proto@workspace:packages/proto" dependencies: "@solarwinds-apm/eslint-config": "workspace:^" - eslint: "npm:^9.9.1" + eslint: "npm:^9.12.0" prettier: "npm:^3.3.3" - protobufjs: "npm:^7.2.6" - protobufjs-cli: "npm:^1.1.2" + protobufjs: "npm:^7.4.0" + protobufjs-cli: "npm:^1.1.3" typescript: "npm:~5.5.3" languageName: unknown linkType: soft @@ -1791,7 +1824,7 @@ __metadata: "@solarwinds-apm/eslint-config": "workspace:^" "@solarwinds-apm/test": "workspace:^" "@types/node": "npm:^18.19.0" - eslint: "npm:^9.9.1" + eslint: "npm:^9.12.0" prettier: "npm:^3.3.3" typescript: "npm:~5.5.3" peerDependencies: @@ -1807,9 +1840,9 @@ __metadata: resolution: "@solarwinds-apm/scripts@workspace:scripts" dependencies: "@solarwinds-apm/eslint-config": "workspace:^" - archiver: "npm:^7.0.0" - bson: "npm:^6.1.0" - eslint: "npm:^9.9.1" + archiver: "npm:^7.0.1" + bson: "npm:^6.8.0" + eslint: "npm:^9.12.0" ora: "npm:^5.4.1" prettier: "npm:^3.3.3" typescript: "npm:~5.5.3" @@ -1820,10 +1853,10 @@ __metadata: version: 0.0.0-use.local resolution: "@solarwinds-apm/solarwinds-apm@workspace:." dependencies: - eslint: "npm:^9.9.1" - husky: "npm:^9.0.11" + eslint: "npm:^9.12.0" + husky: "npm:^9.1.6" prettier: "npm:^3.3.3" - turbo: "npm:^2.0.9" + turbo: "npm:^2.2.0" typescript: "npm:~5.5.3" languageName: unknown linkType: soft @@ -1837,19 +1870,20 @@ __metadata: "@opentelemetry/sdk-trace-base": "npm:~1.26.0" "@opentelemetry/sdk-trace-node": "npm:~1.26.0" "@solarwinds-apm/eslint-config": "workspace:^" - "@types/chai": "npm:^4.3.6" - "@types/chai-as-promised": "npm:^7.1.6" - "@types/mocha": "npm:^10.0.7" + "@types/chai": "npm:^4.3.20" + "@types/chai-as-promised": "npm:^7.1.8" + "@types/mocha": "npm:^10.0.9" "@types/node": "npm:^18.19.0" + "@types/semver": "npm:^7.5.8" c8: "npm:^10.1.2" - chai: "npm:^4.3.10" - chai-as-promised: "npm:^7.1.1" + chai: "npm:^4.5.0" + chai-as-promised: "npm:^7.1.2" dotenv: "npm:^16.4.5" - eslint: "npm:^9.9.1" + eslint: "npm:^9.12.0" globby: "npm:^11.1.0" - mocha: "npm:^10.3.0" + mocha: "npm:^10.7.3" prettier: "npm:^3.3.3" - semver: "npm:^7.5.4" + semver: "npm:^7.6.3" ts-node: "npm:^11.0.0-beta.1" typescript: "npm:~5.5.3" bin: @@ -1918,7 +1952,7 @@ __metadata: languageName: node linkType: hard -"@types/chai-as-promised@npm:^7.1.6": +"@types/chai-as-promised@npm:^7.1.8": version: 7.1.8 resolution: "@types/chai-as-promised@npm:7.1.8" dependencies: @@ -1927,13 +1961,20 @@ __metadata: languageName: node linkType: hard -"@types/chai@npm:*, @types/chai@npm:^4.3.6": +"@types/chai@npm:*": version: 4.3.16 resolution: "@types/chai@npm:4.3.16" checksum: 10c0/745d4a9be429d5d86a7ab26064610b8957fe12dd80e94dc7d0707cf3db1c889e3ffe0d73d69bb15e6d376bf4462a7a75e9d8fc1051750b5d656d6cfe459829b7 languageName: node linkType: hard +"@types/chai@npm:^4.3.20": + version: 4.3.20 + resolution: "@types/chai@npm:4.3.20" + checksum: 10c0/4601189d611752e65018f1ecadac82e94eed29f348e1d5430e5681a60b01e1ecf855d9bcc74ae43b07394751f184f6970fac2b5561fc57a1f36e93a0f5ffb6e8 + languageName: node + linkType: hard + "@types/connect@npm:3.4.36": version: 3.4.36 resolution: "@types/connect@npm:3.4.36" @@ -1943,6 +1984,13 @@ __metadata: languageName: node linkType: hard +"@types/estree@npm:^1.0.6": + version: 1.0.6 + resolution: "@types/estree@npm:1.0.6" + checksum: 10c0/cdfd751f6f9065442cd40957c07fd80361c962869aa853c1c2fd03e101af8b9389d8ff4955a43a6fcfa223dd387a089937f95be0f3eec21ca527039fd2d9859a + languageName: node + linkType: hard + "@types/istanbul-lib-coverage@npm:^2.0.1": version: 2.0.6 resolution: "@types/istanbul-lib-coverage@npm:2.0.6" @@ -1950,7 +1998,7 @@ __metadata: languageName: node linkType: hard -"@types/json-schema@npm:^7.0.12": +"@types/json-schema@npm:^7.0.15": version: 7.0.15 resolution: "@types/json-schema@npm:7.0.15" checksum: 10c0/a996a745e6c5d60292f36731dd41341339d4eeed8180bb09226e5c8d23759067692b1d88e5d91d72ee83dfc00d3aca8e7bd43ea120516c17922cbcb7c3e252db @@ -2004,10 +2052,10 @@ __metadata: languageName: node linkType: hard -"@types/mocha@npm:^10.0.7": - version: 10.0.7 - resolution: "@types/mocha@npm:10.0.7" - checksum: 10c0/48a2df4dd02b6e66a11129dca6a23cf0cc3995faf8525286eb851043685bd8b7444780f4bb29a1c42df7559ed63294e5308bfce3a6b862ad2e0359cb21c21329 +"@types/mocha@npm:^10.0.9": + version: 10.0.9 + resolution: "@types/mocha@npm:10.0.9" + checksum: 10c0/76dd782ac7e971ea159d4a7fd40c929afa051e040be3f41187ff03a2d7b3279e19828ddaa498ba1757b3e6b91316263bb7640db0e906938275b97a06e087b989 languageName: node linkType: hard @@ -2076,17 +2124,17 @@ __metadata: languageName: node linkType: hard -"@types/react@npm:^18.2.25": - version: 18.3.5 - resolution: "@types/react@npm:18.3.5" +"@types/react@npm:^18.3.11": + version: 18.3.11 + resolution: "@types/react@npm:18.3.11" dependencies: "@types/prop-types": "npm:*" csstype: "npm:^3.0.2" - checksum: 10c0/548b1d3d7c2f0242fbfdbbd658731b4ce69a134be072fa83e6ab516f2840402a3f20e3e7f72e95133b23d4880ef24a6d864050dc8e1f7c68f39fa87ca8445917 + checksum: 10c0/ce80512246ca5bda69db85b9f4f1835189334acfb6b2c4f3eda8cabff1ff1a3ea9ce4f3b895bdbc18c94140aa45592331aa3fdeb557f525c1b048de7ce84fc0e languageName: node linkType: hard -"@types/semver@npm:^7.5.0, @types/semver@npm:^7.5.3": +"@types/semver@npm:^7.5.8": version: 7.5.8 resolution: "@types/semver@npm:7.5.8" checksum: 10c0/8663ff927234d1c5fcc04b33062cb2b9fcfbe0f5f351ed26c4d1e1581657deebd506b41ff7fdf89e787e3d33ce05854bc01686379b89e9c49b564c4cfa988efa @@ -2116,15 +2164,15 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:8.4.0": - version: 8.4.0 - resolution: "@typescript-eslint/eslint-plugin@npm:8.4.0" +"@typescript-eslint/eslint-plugin@npm:8.10.0, @typescript-eslint/eslint-plugin@npm:^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0": + version: 8.10.0 + resolution: "@typescript-eslint/eslint-plugin@npm:8.10.0" dependencies: "@eslint-community/regexpp": "npm:^4.10.0" - "@typescript-eslint/scope-manager": "npm:8.4.0" - "@typescript-eslint/type-utils": "npm:8.4.0" - "@typescript-eslint/utils": "npm:8.4.0" - "@typescript-eslint/visitor-keys": "npm:8.4.0" + "@typescript-eslint/scope-manager": "npm:8.10.0" + "@typescript-eslint/type-utils": "npm:8.10.0" + "@typescript-eslint/utils": "npm:8.10.0" + "@typescript-eslint/visitor-keys": "npm:8.10.0" graphemer: "npm:^1.4.0" ignore: "npm:^5.3.1" natural-compare: "npm:^1.4.0" @@ -2135,162 +2183,66 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 10c0/c75e9bb176e9e0277c9f9c4c006bc2c31ac91984e555de1390a9bbe876e3b6787d59d96015b3f0cd083fd22c814aea4ed4858910d3afdd24d64ab79815da31e5 - languageName: node - linkType: hard - -"@typescript-eslint/eslint-plugin@npm:^5.4.2 || ^6.0.0 || 7.0.0 - 7.2.0": - version: 7.2.0 - resolution: "@typescript-eslint/eslint-plugin@npm:7.2.0" - dependencies: - "@eslint-community/regexpp": "npm:^4.5.1" - "@typescript-eslint/scope-manager": "npm:7.2.0" - "@typescript-eslint/type-utils": "npm:7.2.0" - "@typescript-eslint/utils": "npm:7.2.0" - "@typescript-eslint/visitor-keys": "npm:7.2.0" - debug: "npm:^4.3.4" - graphemer: "npm:^1.4.0" - ignore: "npm:^5.2.4" - natural-compare: "npm:^1.4.0" - semver: "npm:^7.5.4" - ts-api-utils: "npm:^1.0.1" - peerDependencies: - "@typescript-eslint/parser": ^7.0.0 - eslint: ^8.56.0 - peerDependenciesMeta: - typescript: - optional: true - checksum: 10c0/8725c2193a16cc103a697d6e408c515a7618df3902dc504cf69999f60634dac79ce14a5bd942f0388ba7547caba44ac40e01097cda1106aa3912e2303dada8ab + checksum: 10c0/4b77ba9c865a2a14e238cd330b5901f0274b8ce1c13324fccd0339b8eea82a50a4709394c903fd8cd5bd0d3aebace0761ff9a4a19fa20b00bb61349b7671c035 languageName: node linkType: hard -"@typescript-eslint/parser@npm:8.4.0": - version: 8.4.0 - resolution: "@typescript-eslint/parser@npm:8.4.0" +"@typescript-eslint/parser@npm:8.10.0, @typescript-eslint/parser@npm:^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0": + version: 8.10.0 + resolution: "@typescript-eslint/parser@npm:8.10.0" dependencies: - "@typescript-eslint/scope-manager": "npm:8.4.0" - "@typescript-eslint/types": "npm:8.4.0" - "@typescript-eslint/typescript-estree": "npm:8.4.0" - "@typescript-eslint/visitor-keys": "npm:8.4.0" + "@typescript-eslint/scope-manager": "npm:8.10.0" + "@typescript-eslint/types": "npm:8.10.0" + "@typescript-eslint/typescript-estree": "npm:8.10.0" + "@typescript-eslint/visitor-keys": "npm:8.10.0" debug: "npm:^4.3.4" peerDependencies: eslint: ^8.57.0 || ^9.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 10c0/19f3358e5bc4bbad693183eefe1a90ea64be054a934bc2c8a972ff4738b94580b55ad4955af5797db42298628caa59b3ba3f9fd960582b5fc2c836da3a4578a5 + checksum: 10c0/7becb2457c085c239838d301796074b790f46dd38c9fbc14ec1dec8e993c7115cd8a66cdc07983c3a68a2dd92e24e8acc49d69a4ebcc29e9869957eb52d1cb74 languageName: node linkType: hard -"@typescript-eslint/parser@npm:^5.4.2 || ^6.0.0 || 7.0.0 - 7.2.0": - version: 7.2.0 - resolution: "@typescript-eslint/parser@npm:7.2.0" - dependencies: - "@typescript-eslint/scope-manager": "npm:7.2.0" - "@typescript-eslint/types": "npm:7.2.0" - "@typescript-eslint/typescript-estree": "npm:7.2.0" - "@typescript-eslint/visitor-keys": "npm:7.2.0" - debug: "npm:^4.3.4" - peerDependencies: - eslint: ^8.56.0 - peerDependenciesMeta: - typescript: - optional: true - checksum: 10c0/11ce36c68212fdbf98fc6fd32ba0977d46b645fd669a3f4fdb8be2036225f86ad005b31a66f97097e90517c44c92cf9cc5fb1d6e9647ee2fa125c4af21cdb477 - languageName: node - linkType: hard - -"@typescript-eslint/scope-manager@npm:7.2.0": - version: 7.2.0 - resolution: "@typescript-eslint/scope-manager@npm:7.2.0" - dependencies: - "@typescript-eslint/types": "npm:7.2.0" - "@typescript-eslint/visitor-keys": "npm:7.2.0" - checksum: 10c0/4d088c127e6ba1a7de8567f70684779083be24b48746c3b4a86a0ec7062bca58693ee08482349ad6572a17ada8aa6f26b74d1c7139c8fcf7101fa09a572e0ea6 - languageName: node - linkType: hard - -"@typescript-eslint/scope-manager@npm:8.4.0": - version: 8.4.0 - resolution: "@typescript-eslint/scope-manager@npm:8.4.0" +"@typescript-eslint/scope-manager@npm:8.10.0": + version: 8.10.0 + resolution: "@typescript-eslint/scope-manager@npm:8.10.0" dependencies: - "@typescript-eslint/types": "npm:8.4.0" - "@typescript-eslint/visitor-keys": "npm:8.4.0" - checksum: 10c0/95188c663df7db106529c6b93c4c7c61647ed34ab6dd48114e41ddf49140ff606c5501ce2ae451a988ec49b5d3874ea96ff212fc102802327b10affd2ff80a37 + "@typescript-eslint/types": "npm:8.10.0" + "@typescript-eslint/visitor-keys": "npm:8.10.0" + checksum: 10c0/b8bb8635c4d6c00a3578d6265e3ee0f5d96d0c9dee534ed588aa411c3f4497fd71cce730c3ae7571e52453d955b191bc9edcc47c9af21a20c90e9a20f2371108 languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:7.2.0": - version: 7.2.0 - resolution: "@typescript-eslint/type-utils@npm:7.2.0" +"@typescript-eslint/type-utils@npm:8.10.0": + version: 8.10.0 + resolution: "@typescript-eslint/type-utils@npm:8.10.0" dependencies: - "@typescript-eslint/typescript-estree": "npm:7.2.0" - "@typescript-eslint/utils": "npm:7.2.0" - debug: "npm:^4.3.4" - ts-api-utils: "npm:^1.0.1" - peerDependencies: - eslint: ^8.56.0 - peerDependenciesMeta: - typescript: - optional: true - checksum: 10c0/069b65ef327e1bfa1e59009504c8307f88f3673ebcc23d17ad370452ece107013c9dc321876092673d2c02ddd35104f67231b31b0e4f7d5ca6fbf95b43f828b2 - languageName: node - linkType: hard - -"@typescript-eslint/type-utils@npm:8.4.0": - version: 8.4.0 - resolution: "@typescript-eslint/type-utils@npm:8.4.0" - dependencies: - "@typescript-eslint/typescript-estree": "npm:8.4.0" - "@typescript-eslint/utils": "npm:8.4.0" + "@typescript-eslint/typescript-estree": "npm:8.10.0" + "@typescript-eslint/utils": "npm:8.10.0" debug: "npm:^4.3.4" ts-api-utils: "npm:^1.3.0" peerDependenciesMeta: typescript: optional: true - checksum: 10c0/ae51100594d9ca61c7577b5aed0bd10c1959725df5c38cd9653eed1fd3dbdfff9146b6e48f3409994b4c8d781b9d95025c36b30f73a5a1b3dbdee6d142cecc87 - languageName: node - linkType: hard - -"@typescript-eslint/types@npm:7.2.0": - version: 7.2.0 - resolution: "@typescript-eslint/types@npm:7.2.0" - checksum: 10c0/135aae061720185855bea61ea6cfd33f4801d2de57f65e50079bbdb505100f844632aa4e4bdeec9e9e79d29aaddad949178d0e918e41867da6ab4b1390820e33 + checksum: 10c0/1af8fce8394279e6ac7bcef449a132072ee36e374c8d557564246ffe7150230844901ca0305e29525bf37c87010e03bf8bedec76fccbfe1e41931cb4f274e208 languageName: node linkType: hard -"@typescript-eslint/types@npm:8.4.0": - version: 8.4.0 - resolution: "@typescript-eslint/types@npm:8.4.0" - checksum: 10c0/15e09ced84827c349553530a31822f06ae5bad456c03d561b7d0c64b6ad9b5d7ca795e030bd93e65d5a2cd41bfde36ed08dcd2ff9feaa8b60a67080827f47ecb +"@typescript-eslint/types@npm:8.10.0": + version: 8.10.0 + resolution: "@typescript-eslint/types@npm:8.10.0" + checksum: 10c0/f27dd43c8383e02e914a254257627e393dfc0f08b0f74a253c106813ae361f090271b2f3f2ef588fa3ca1329897d873da595bb5641fe8e3091b25eddca24b5d2 languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:7.2.0": - version: 7.2.0 - resolution: "@typescript-eslint/typescript-estree@npm:7.2.0" +"@typescript-eslint/typescript-estree@npm:8.10.0": + version: 8.10.0 + resolution: "@typescript-eslint/typescript-estree@npm:8.10.0" dependencies: - "@typescript-eslint/types": "npm:7.2.0" - "@typescript-eslint/visitor-keys": "npm:7.2.0" - debug: "npm:^4.3.4" - globby: "npm:^11.1.0" - is-glob: "npm:^4.0.3" - minimatch: "npm:9.0.3" - semver: "npm:^7.5.4" - ts-api-utils: "npm:^1.0.1" - peerDependenciesMeta: - typescript: - optional: true - checksum: 10c0/2730bb17730e6f3ca4061f00688a70386a808f5d174fdeb757c3cfa92c455373f69080df33237c1a8970e818af0cea0ae5a083970ed8ba493f3b04458c6f9271 - languageName: node - linkType: hard - -"@typescript-eslint/typescript-estree@npm:8.4.0": - version: 8.4.0 - resolution: "@typescript-eslint/typescript-estree@npm:8.4.0" - dependencies: - "@typescript-eslint/types": "npm:8.4.0" - "@typescript-eslint/visitor-keys": "npm:8.4.0" + "@typescript-eslint/types": "npm:8.10.0" + "@typescript-eslint/visitor-keys": "npm:8.10.0" debug: "npm:^4.3.4" fast-glob: "npm:^3.3.2" is-glob: "npm:^4.0.3" @@ -2300,58 +2252,31 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 10c0/170702b024121cff9268f53de8054796b0ce025f9a78d6f2bc850a360e5f3f7032ba3ee9d4b7392726308273a5f3ade5ab31b1788b504b514bc15afc07302b37 + checksum: 10c0/535a740fe25be0e28fe68c41e3264273d1e5169c9f938e08cc0e3415c357726f43efa44621960108c318fc3305c425d29f3223b6e731d44d67f84058a8947304 languageName: node linkType: hard -"@typescript-eslint/utils@npm:7.2.0": - version: 7.2.0 - resolution: "@typescript-eslint/utils@npm:7.2.0" +"@typescript-eslint/utils@npm:8.10.0": + version: 8.10.0 + resolution: "@typescript-eslint/utils@npm:8.10.0" dependencies: "@eslint-community/eslint-utils": "npm:^4.4.0" - "@types/json-schema": "npm:^7.0.12" - "@types/semver": "npm:^7.5.0" - "@typescript-eslint/scope-manager": "npm:7.2.0" - "@typescript-eslint/types": "npm:7.2.0" - "@typescript-eslint/typescript-estree": "npm:7.2.0" - semver: "npm:^7.5.4" - peerDependencies: - eslint: ^8.56.0 - checksum: 10c0/37944e1a4038820da82b51ac4756e09cff31851d9d957d3fd67a3b6fd2cf6c0e87767161eaeb8b6e63de418e513bb2570a6ee3fa986ba77f6d451d66a538f753 - languageName: node - linkType: hard - -"@typescript-eslint/utils@npm:8.4.0": - version: 8.4.0 - resolution: "@typescript-eslint/utils@npm:8.4.0" - dependencies: - "@eslint-community/eslint-utils": "npm:^4.4.0" - "@typescript-eslint/scope-manager": "npm:8.4.0" - "@typescript-eslint/types": "npm:8.4.0" - "@typescript-eslint/typescript-estree": "npm:8.4.0" + "@typescript-eslint/scope-manager": "npm:8.10.0" + "@typescript-eslint/types": "npm:8.10.0" + "@typescript-eslint/typescript-estree": "npm:8.10.0" peerDependencies: eslint: ^8.57.0 || ^9.0.0 - checksum: 10c0/8c9c36b3aa23f9bcc28cc4b10f0fa2996f1bc6cdd75135f08c2ef734baa30dbd2a8b92f344b90518e1fd07a486936734789fc7e90b780221a7707dad8e9c9364 - languageName: node - linkType: hard - -"@typescript-eslint/visitor-keys@npm:7.2.0": - version: 7.2.0 - resolution: "@typescript-eslint/visitor-keys@npm:7.2.0" - dependencies: - "@typescript-eslint/types": "npm:7.2.0" - eslint-visitor-keys: "npm:^3.4.1" - checksum: 10c0/2d7467495b2b76f3edb1b3047e97076c2242e7eca6d50bbbdd88219f9ff754dbcb9334a0568fe0ceb4c562823980938bd278aa2ba53da6343e7d99a167924f24 + checksum: 10c0/a21a2933517176abd00fcd5d8d80023e35dc3d89d5746bbac43790b4e984ab1f371117db08048bce7f42d54c64f4e0e35161149f8f34fd25a27bff9d1110fd16 languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:8.4.0": - version: 8.4.0 - resolution: "@typescript-eslint/visitor-keys@npm:8.4.0" +"@typescript-eslint/visitor-keys@npm:8.10.0": + version: 8.10.0 + resolution: "@typescript-eslint/visitor-keys@npm:8.10.0" dependencies: - "@typescript-eslint/types": "npm:8.4.0" + "@typescript-eslint/types": "npm:8.10.0" eslint-visitor-keys: "npm:^3.4.3" - checksum: 10c0/339199b7fbb9ac83b530d03ab25f6bc5ceb688c9cd0ae460112cd14ee78ca7284a845aef5620cdf70170980123475ec875e85ebf595c60255ba3c0d6fe48c714 + checksum: 10c0/14721c4ac939640d5fd1ee1b6eeb07604b11a6017e319e21dcc71e7aac2992341fc7ae1992d977bad4433b6a1d0d1c0c279e6927316b26245f6e333f922fa458 languageName: node linkType: hard @@ -2548,7 +2473,7 @@ __metadata: languageName: node linkType: hard -"archiver@npm:^7.0.0": +"archiver@npm:^7.0.1": version: 7.0.1 resolution: "archiver@npm:7.0.1" dependencies: @@ -2868,9 +2793,9 @@ __metadata: languageName: node linkType: hard -"body-parser@npm:1.20.2": - version: 1.20.2 - resolution: "body-parser@npm:1.20.2" +"body-parser@npm:1.20.3": + version: 1.20.3 + resolution: "body-parser@npm:1.20.3" dependencies: bytes: "npm:3.1.2" content-type: "npm:~1.0.5" @@ -2880,11 +2805,11 @@ __metadata: http-errors: "npm:2.0.0" iconv-lite: "npm:0.4.24" on-finished: "npm:2.4.1" - qs: "npm:6.11.0" + qs: "npm:6.13.0" raw-body: "npm:2.5.2" type-is: "npm:~1.6.18" unpipe: "npm:1.0.0" - checksum: 10c0/06f1438fff388a2e2354c96aa3ea8147b79bfcb1262dfcc2aae68ec13723d01d5781680657b74e9f83c808266d5baf52804032fbde2b7382b89bd8cdb273ace9 + checksum: 10c0/0a9a93b7518f222885498dcecaad528cf010dd109b071bf471c93def4bfe30958b83e03496eb9c1ad4896db543d999bb62be1a3087294162a88cfa1b42c16310 languageName: node linkType: hard @@ -2923,7 +2848,7 @@ __metadata: languageName: node linkType: hard -"bson@npm:^6.1.0": +"bson@npm:^6.8.0": version: 6.8.0 resolution: "bson@npm:6.8.0" checksum: 10c0/0503bb2a4ce2e183bd06151bdb983a623cfde05c76fbb5a34e941c594f3a681b52333d61b37c7933b8733b0ba14607b3599d94b46635d90bb96b1e7cec51aa8f @@ -3062,7 +2987,7 @@ __metadata: languageName: node linkType: hard -"chai-as-promised@npm:^7.1.1": +"chai-as-promised@npm:^7.1.2": version: 7.1.2 resolution: "chai-as-promised@npm:7.1.2" dependencies: @@ -3073,7 +2998,7 @@ __metadata: languageName: node linkType: hard -"chai@npm:^4.3.10": +"chai@npm:^4.5.0": version: 4.5.0 resolution: "chai@npm:4.5.0" dependencies: @@ -3281,9 +3206,9 @@ __metadata: languageName: node linkType: hard -"concurrently@npm:^9.0.0": - version: 9.0.0 - resolution: "concurrently@npm:9.0.0" +"concurrently@npm:^9.0.1": + version: 9.0.1 + resolution: "concurrently@npm:9.0.1" dependencies: chalk: "npm:^4.1.2" lodash: "npm:^4.17.21" @@ -3295,7 +3220,7 @@ __metadata: bin: conc: dist/bin/concurrently.js concurrently: dist/bin/concurrently.js - checksum: 10c0/65251009f4540c25eda0d5b2f367ba8755eac83db2ce562802132160e9241c5cd755228b18c330ea29ccd5b0a033302da8a670d724e89fe462c26253e3046f2e + checksum: 10c0/e2c3d3f3d1b1457ccd27e69f0d840ba4915d571fae4e1088498234ec1174fd547c127de0df6dbe5eb71b2df973b26a6fdc931a9e7e3658f25287ef2106bdb413 languageName: node linkType: hard @@ -3329,7 +3254,14 @@ __metadata: languageName: node linkType: hard -"cookie@npm:0.6.0, cookie@npm:^0.6.0": +"cookie@npm:0.7.1": + version: 0.7.1 + resolution: "cookie@npm:0.7.1" + checksum: 10c0/5de60c67a410e7c8dc8a46a4b72eb0fe925871d057c9a5d2c0e8145c4270a4f81076de83410c4d397179744b478e33cd80ccbcc457abf40a9409ad27dcd21dde + languageName: node + linkType: hard + +"cookie@npm:^0.6.0": version: 0.6.0 resolution: "cookie@npm:0.6.0" checksum: 10c0/f2318b31af7a31b4ddb4a678d024514df5e705f9be5909a192d7f116cfb6d45cbacf96a473fa733faa95050e7cff26e7832bb3ef94751592f1387b71c8956686 @@ -3589,6 +3521,13 @@ __metadata: languageName: node linkType: hard +"encodeurl@npm:~2.0.0": + version: 2.0.0 + resolution: "encodeurl@npm:2.0.0" + checksum: 10c0/5d317306acb13e6590e28e27924c754163946a2480de11865c991a3a7eed4315cd3fba378b543ca145829569eefe9b899f3d84bb09870f675ae60bc924b01ceb + languageName: node + linkType: hard + "encoding@npm:^0.1.13": version: 0.1.13 resolution: "encoding@npm:0.1.13" @@ -3802,14 +3741,14 @@ __metadata: languageName: node linkType: hard -"eslint-config-next@npm:^14.0.3": - version: 14.2.8 - resolution: "eslint-config-next@npm:14.2.8" +"eslint-config-next@npm:^14.2.15": + version: 14.2.15 + resolution: "eslint-config-next@npm:14.2.15" dependencies: - "@next/eslint-plugin-next": "npm:14.2.8" + "@next/eslint-plugin-next": "npm:14.2.15" "@rushstack/eslint-patch": "npm:^1.3.3" - "@typescript-eslint/eslint-plugin": "npm:^5.4.2 || ^6.0.0 || 7.0.0 - 7.2.0" - "@typescript-eslint/parser": "npm:^5.4.2 || ^6.0.0 || 7.0.0 - 7.2.0" + "@typescript-eslint/eslint-plugin": "npm:^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "npm:^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0" eslint-import-resolver-node: "npm:^0.3.6" eslint-import-resolver-typescript: "npm:^3.5.2" eslint-plugin-import: "npm:^2.28.1" @@ -3822,7 +3761,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 10c0/932538864965157d94e6ad32f674afee40fb72d81070550e29bce1b5c8c52f5221f9ddbf483622a29507c760b6317ee7c660590ad8454d23e232a31e6371cc0b + checksum: 10c0/8ecce0ebda73f7033a90fb1fa553853ca77d668584955c0be734d704bf2a69fea35522dce9930a06a9abeed4385c2967df8bc124688b03fed38ee614d4940daa languageName: node linkType: hard @@ -4000,13 +3939,13 @@ __metadata: languageName: node linkType: hard -"eslint-scope@npm:^8.0.2": - version: 8.0.2 - resolution: "eslint-scope@npm:8.0.2" +"eslint-scope@npm:^8.1.0": + version: 8.1.0 + resolution: "eslint-scope@npm:8.1.0" dependencies: esrecurse: "npm:^4.3.0" estraverse: "npm:^5.2.0" - checksum: 10c0/477f820647c8755229da913025b4567347fd1f0bf7cbdf3a256efff26a7e2e130433df052bd9e3d014025423dc00489bea47eb341002b15553673379c1a7dc36 + checksum: 10c0/ae1df7accae9ea90465c2ded70f7064d6d1f2962ef4cc87398855c4f0b3a5ab01063e0258d954bb94b184f6759febe04c3118195cab5c51978a7229948ba2875 languageName: node linkType: hard @@ -4024,6 +3963,13 @@ __metadata: languageName: node linkType: hard +"eslint-visitor-keys@npm:^4.1.0": + version: 4.1.0 + resolution: "eslint-visitor-keys@npm:4.1.0" + checksum: 10c0/5483ef114c93a136aa234140d7aa3bd259488dae866d35cb0d0b52e6a158f614760a57256ac8d549acc590a87042cb40f6951815caa821e55dc4fd6ef4c722eb + languageName: node + linkType: hard + "eslint@npm:^8.57.0": version: 8.57.0 resolution: "eslint@npm:8.57.0" @@ -4072,26 +4018,30 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^9.9.1": - version: 9.9.1 - resolution: "eslint@npm:9.9.1" +"eslint@npm:^9.12.0": + version: 9.12.0 + resolution: "eslint@npm:9.12.0" dependencies: "@eslint-community/eslint-utils": "npm:^4.2.0" "@eslint-community/regexpp": "npm:^4.11.0" "@eslint/config-array": "npm:^0.18.0" + "@eslint/core": "npm:^0.6.0" "@eslint/eslintrc": "npm:^3.1.0" - "@eslint/js": "npm:9.9.1" + "@eslint/js": "npm:9.12.0" + "@eslint/plugin-kit": "npm:^0.2.0" + "@humanfs/node": "npm:^0.16.5" "@humanwhocodes/module-importer": "npm:^1.0.1" - "@humanwhocodes/retry": "npm:^0.3.0" - "@nodelib/fs.walk": "npm:^1.2.8" + "@humanwhocodes/retry": "npm:^0.3.1" + "@types/estree": "npm:^1.0.6" + "@types/json-schema": "npm:^7.0.15" ajv: "npm:^6.12.4" chalk: "npm:^4.0.0" cross-spawn: "npm:^7.0.2" debug: "npm:^4.3.2" escape-string-regexp: "npm:^4.0.0" - eslint-scope: "npm:^8.0.2" - eslint-visitor-keys: "npm:^4.0.0" - espree: "npm:^10.1.0" + eslint-scope: "npm:^8.1.0" + eslint-visitor-keys: "npm:^4.1.0" + espree: "npm:^10.2.0" esquery: "npm:^1.5.0" esutils: "npm:^2.0.2" fast-deep-equal: "npm:^3.1.3" @@ -4101,14 +4051,11 @@ __metadata: ignore: "npm:^5.2.0" imurmurhash: "npm:^0.1.4" is-glob: "npm:^4.0.0" - is-path-inside: "npm:^3.0.3" json-stable-stringify-without-jsonify: "npm:^1.0.1" - levn: "npm:^0.4.1" lodash.merge: "npm:^4.6.2" minimatch: "npm:^3.1.2" natural-compare: "npm:^1.4.0" optionator: "npm:^0.9.3" - strip-ansi: "npm:^6.0.1" text-table: "npm:^0.2.0" peerDependencies: jiti: "*" @@ -4117,11 +4064,11 @@ __metadata: optional: true bin: eslint: bin/eslint.js - checksum: 10c0/5e71efda7c0a14ee95436d5cdfed04ee61dfb1d89d7a32b50a424de2e680af82849628ea6581950c2e0726491f786a3cfd0032ce013c1c5093786e475cfdfb33 + checksum: 10c0/67cf6ea3ea28dcda7dd54aac33e2d4028eb36991d13defb0d2339c3eaa877d5dddd12cd4416ddc701a68bcde9e0bb9e65524c2e4e9914992c724f5b51e949dda languageName: node linkType: hard -"espree@npm:^10.0.1, espree@npm:^10.1.0": +"espree@npm:^10.0.1": version: 10.1.0 resolution: "espree@npm:10.1.0" dependencies: @@ -4132,6 +4079,17 @@ __metadata: languageName: node linkType: hard +"espree@npm:^10.2.0": + version: 10.2.0 + resolution: "espree@npm:10.2.0" + dependencies: + acorn: "npm:^8.12.0" + acorn-jsx: "npm:^5.3.2" + eslint-visitor-keys: "npm:^4.1.0" + checksum: 10c0/2b6bfb683e7e5ab2e9513949879140898d80a2d9867ea1db6ff5b0256df81722633b60a7523a7c614f05a39aeea159dd09ad2a0e90c0e218732fc016f9086215 + languageName: node + linkType: hard + "espree@npm:^9.0.0, espree@npm:^9.6.0, espree@npm:^9.6.1": version: 9.6.1 resolution: "espree@npm:9.6.1" @@ -4220,42 +4178,42 @@ __metadata: languageName: node linkType: hard -"express@npm:^4.18.2": - version: 4.19.2 - resolution: "express@npm:4.19.2" +"express@npm:^4.21.1": + version: 4.21.1 + resolution: "express@npm:4.21.1" dependencies: accepts: "npm:~1.3.8" array-flatten: "npm:1.1.1" - body-parser: "npm:1.20.2" + body-parser: "npm:1.20.3" content-disposition: "npm:0.5.4" content-type: "npm:~1.0.4" - cookie: "npm:0.6.0" + cookie: "npm:0.7.1" cookie-signature: "npm:1.0.6" debug: "npm:2.6.9" depd: "npm:2.0.0" - encodeurl: "npm:~1.0.2" + encodeurl: "npm:~2.0.0" escape-html: "npm:~1.0.3" etag: "npm:~1.8.1" - finalhandler: "npm:1.2.0" + finalhandler: "npm:1.3.1" fresh: "npm:0.5.2" http-errors: "npm:2.0.0" - merge-descriptors: "npm:1.0.1" + merge-descriptors: "npm:1.0.3" methods: "npm:~1.1.2" on-finished: "npm:2.4.1" parseurl: "npm:~1.3.3" - path-to-regexp: "npm:0.1.7" + path-to-regexp: "npm:0.1.10" proxy-addr: "npm:~2.0.7" - qs: "npm:6.11.0" + qs: "npm:6.13.0" range-parser: "npm:~1.2.1" safe-buffer: "npm:5.2.1" - send: "npm:0.18.0" - serve-static: "npm:1.15.0" + send: "npm:0.19.0" + serve-static: "npm:1.16.2" setprototypeof: "npm:1.2.0" statuses: "npm:2.0.1" type-is: "npm:~1.6.18" utils-merge: "npm:1.0.1" vary: "npm:~1.1.2" - checksum: 10c0/e82e2662ea9971c1407aea9fc3c16d6b963e55e3830cd0ef5e00b533feda8b770af4e3be630488ef8a752d7c75c4fcefb15892868eeaafe7353cb9e3e269fdcb + checksum: 10c0/0c287867e5f6129d3def1edd9b63103a53c40d4dc8628839d4b6827e35eb8f0de5a4656f9d85f4457eba584f9871ebb2ad26c750b36bd75d9bbb8bcebdc4892c languageName: node linkType: hard @@ -4359,7 +4317,7 @@ __metadata: languageName: node linkType: hard -"fastify@npm:^4.23.2": +"fastify@npm:^4.28.1": version: 4.28.1 resolution: "fastify@npm:4.28.1" dependencies: @@ -4426,18 +4384,18 @@ __metadata: languageName: node linkType: hard -"finalhandler@npm:1.2.0": - version: 1.2.0 - resolution: "finalhandler@npm:1.2.0" +"finalhandler@npm:1.3.1": + version: 1.3.1 + resolution: "finalhandler@npm:1.3.1" dependencies: debug: "npm:2.6.9" - encodeurl: "npm:~1.0.2" + encodeurl: "npm:~2.0.0" escape-html: "npm:~1.0.3" on-finished: "npm:2.4.1" parseurl: "npm:~1.3.3" statuses: "npm:2.0.1" unpipe: "npm:~1.0.0" - checksum: 10c0/64b7e5ff2ad1fcb14931cd012651631b721ce657da24aedb5650ddde9378bf8e95daa451da43398123f5de161a81e79ff5affe4f9f2a6d2df4a813d6d3e254b7 + checksum: 10c0/d38035831865a49b5610206a3a9a9aae4e8523cbbcd01175d0480ffbf1278c47f11d89be3ca7f617ae6d94f29cf797546a4619cd84dd109009ef33f12f69019f languageName: node linkType: hard @@ -4921,12 +4879,12 @@ __metadata: languageName: node linkType: hard -"husky@npm:^9.0.11": - version: 9.1.5 - resolution: "husky@npm:9.1.5" +"husky@npm:^9.1.6": + version: 9.1.6 + resolution: "husky@npm:9.1.6" bin: husky: bin.js - checksum: 10c0/f42efb95a026303eb880898760f802d88409780dd72f17781d2dfc302177d4f80b641cf1f1694f53f6d97c536c7397684133d8c8fe4a4426f7460186a7d1c6b8 + checksum: 10c0/705673db4a247c1febd9c5df5f6a3519106cf0335845027bb50a15fba9b1f542cb2610932ede96fd08008f6d9f49db0f15560509861808b0031cdc0e7c798bac languageName: node linkType: hard @@ -4955,7 +4913,7 @@ __metadata: languageName: node linkType: hard -"ignore@npm:^5.2.0, ignore@npm:^5.2.4, ignore@npm:^5.3.1": +"ignore@npm:^5.2.0, ignore@npm:^5.3.1": version: 5.3.2 resolution: "ignore@npm:5.3.2" checksum: 10c0/f9f652c957983634ded1e7f02da3b559a0d4cc210fca3792cb67f1b153623c9c42efdc1c4121af171e295444459fc4a9201101fb041b1104a3c000bccb188337 @@ -5727,10 +5685,10 @@ __metadata: languageName: node linkType: hard -"lru-cache@npm:^8.0.0": - version: 8.0.5 - resolution: "lru-cache@npm:8.0.5" - checksum: 10c0/cd95a9c38497611c5a6453de39a881f6eb5865851a2a01b5f14104ff3fee515362a7b1e7de28606028f423802910ba05bdb8ae1aa7b0d54eae70c92f0cec10b2 +"lru.min@npm:^1.0.0": + version: 1.1.1 + resolution: "lru.min@npm:1.1.1" + checksum: 10c0/9bb1380dd9fdb155632122dfd2beb26e0c624ac141c4e95d551b66b5c523f2b7c4cdcc0b98a86419d59bc5d3af91c5699439ad06ec07f01b43d5aee51e1b34e8 languageName: node linkType: hard @@ -5817,10 +5775,10 @@ __metadata: languageName: node linkType: hard -"merge-descriptors@npm:1.0.1": - version: 1.0.1 - resolution: "merge-descriptors@npm:1.0.1" - checksum: 10c0/b67d07bd44cfc45cebdec349bb6e1f7b077ee2fd5beb15d1f7af073849208cb6f144fe403e29a36571baf3f4e86469ac39acf13c318381e958e186b2766f54ec +"merge-descriptors@npm:1.0.3": + version: 1.0.3 + resolution: "merge-descriptors@npm:1.0.3" + checksum: 10c0/866b7094afd9293b5ea5dcd82d71f80e51514bed33b4c4e9f516795dc366612a4cbb4dc94356e943a8a6914889a914530badff27f397191b9b75cda20b6bae93 languageName: node linkType: hard @@ -5887,15 +5845,6 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:9.0.3": - version: 9.0.3 - resolution: "minimatch@npm:9.0.3" - dependencies: - brace-expansion: "npm:^2.0.1" - checksum: 10c0/85f407dcd38ac3e180f425e86553911d101455ca3ad5544d6a7cec16286657e4f8a9aa6695803025c55e31e35a91a2252b5dc8e7d527211278b8b65b4dbd5eac - languageName: node - linkType: hard - "minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": version: 3.1.2 resolution: "minimatch@npm:3.1.2" @@ -6023,7 +5972,7 @@ __metadata: languageName: node linkType: hard -"mocha@npm:^10.3.0": +"mocha@npm:^10.7.3": version: 10.7.3 resolution: "mocha@npm:10.7.3" dependencies: @@ -6082,20 +6031,20 @@ __metadata: languageName: node linkType: hard -"mysql2@npm:^3.6.1": - version: 3.11.0 - resolution: "mysql2@npm:3.11.0" +"mysql2@npm:^3.11.3": + version: 3.11.3 + resolution: "mysql2@npm:3.11.3" dependencies: aws-ssl-profiles: "npm:^1.1.1" denque: "npm:^2.1.0" generate-function: "npm:^2.3.1" iconv-lite: "npm:^0.6.3" long: "npm:^5.2.1" - lru-cache: "npm:^8.0.0" + lru.min: "npm:^1.0.0" named-placeholders: "npm:^1.1.3" seq-queue: "npm:^0.0.5" sqlstring: "npm:^2.3.2" - checksum: 10c0/7cc408ecfce01cda0692e72879e9812855a91b03940ac4e8acb715c55f25f8d262a05df5fe25fe3b707a1f40a61e68cde5c3e00b6a81343b00f9595bd4adc790 + checksum: 10c0/5d4d72a6ea0db8fab29403bd87b5efb244e756badb29a6078fa8fda11a097bbf0634ccad891d9f5decdce8efb98ac13b9bcbc9a3ddce8a232ee140aaacc2c479 languageName: node linkType: hard @@ -6131,20 +6080,20 @@ __metadata: languageName: node linkType: hard -"next@npm:^14.0.3": - version: 14.2.8 - resolution: "next@npm:14.2.8" +"next@npm:^14.2.15": + version: 14.2.15 + resolution: "next@npm:14.2.15" dependencies: - "@next/env": "npm:14.2.8" - "@next/swc-darwin-arm64": "npm:14.2.8" - "@next/swc-darwin-x64": "npm:14.2.8" - "@next/swc-linux-arm64-gnu": "npm:14.2.8" - "@next/swc-linux-arm64-musl": "npm:14.2.8" - "@next/swc-linux-x64-gnu": "npm:14.2.8" - "@next/swc-linux-x64-musl": "npm:14.2.8" - "@next/swc-win32-arm64-msvc": "npm:14.2.8" - "@next/swc-win32-ia32-msvc": "npm:14.2.8" - "@next/swc-win32-x64-msvc": "npm:14.2.8" + "@next/env": "npm:14.2.15" + "@next/swc-darwin-arm64": "npm:14.2.15" + "@next/swc-darwin-x64": "npm:14.2.15" + "@next/swc-linux-arm64-gnu": "npm:14.2.15" + "@next/swc-linux-arm64-musl": "npm:14.2.15" + "@next/swc-linux-x64-gnu": "npm:14.2.15" + "@next/swc-linux-x64-musl": "npm:14.2.15" + "@next/swc-win32-arm64-msvc": "npm:14.2.15" + "@next/swc-win32-ia32-msvc": "npm:14.2.15" + "@next/swc-win32-x64-msvc": "npm:14.2.15" "@swc/helpers": "npm:0.5.5" busboy: "npm:1.6.0" caniuse-lite: "npm:^1.0.30001579" @@ -6185,16 +6134,16 @@ __metadata: optional: true bin: next: dist/bin/next - checksum: 10c0/ceead5258f80dc2a4e911cb3e8c224ce5487c726587a79ea0a510192305f2e66a17a002841c3c0b195fd568c9a35160f563042417d3807eb5f6538c7630615de + checksum: 10c0/45d02c5a42f70cdbb8fba7a91f602d1852119f85cf5886d01d17e839ef096d42986ac17fe6356ed6e481548035e4eabff13b12818bf3ee38c11f488df579a8b0 languageName: node linkType: hard -"node-addon-api@npm:^8.1.0": - version: 8.1.0 - resolution: "node-addon-api@npm:8.1.0" +"node-addon-api@npm:^8.2.1": + version: 8.2.1 + resolution: "node-addon-api@npm:8.2.1" dependencies: node-gyp: "npm:latest" - checksum: 10c0/b4009408ea4d0cdda9b59765e949422d464cdbb3e42b9330bddceda7829e0c3cdae7ae9dd1e4203ef731cd51f5a52b339afef581efb72c539f1f1a5464bb291b + checksum: 10c0/b722d8fc10d1d230a714fe6b9642fa3773f39ade44c6c8515aa9711d07009c278f09ecc2b636a8e5190d4b44e0c29eee59fbfa596745b748ef28e8758679bd24 languageName: node linkType: hard @@ -6515,10 +6464,10 @@ __metadata: languageName: node linkType: hard -"path-to-regexp@npm:0.1.7": - version: 0.1.7 - resolution: "path-to-regexp@npm:0.1.7" - checksum: 10c0/50a1ddb1af41a9e68bd67ca8e331a705899d16fb720a1ea3a41e310480948387daf603abb14d7b0826c58f10146d49050a1291ba6a82b78a382d1c02c0b8f905 +"path-to-regexp@npm:0.1.10": + version: 0.1.10 + resolution: "path-to-regexp@npm:0.1.10" + checksum: 10c0/34196775b9113ca6df88e94c8d83ba82c0e1a2063dd33bfe2803a980da8d49b91db8104f49d5191b44ea780d46b8670ce2b7f4a5e349b0c48c6779b653f1afe4 languageName: node linkType: hard @@ -6543,10 +6492,10 @@ __metadata: languageName: node linkType: hard -"pg-connection-string@npm:^2.6.4": - version: 2.6.4 - resolution: "pg-connection-string@npm:2.6.4" - checksum: 10c0/0d0b617df0fc6507bf6a94bdcd56c7a305788a1402d69bff9773350947c8f525d6d8136128065370749a3325e99658ae40fbdcce620fb8e60126181f0591a6a6 +"pg-connection-string@npm:^2.7.0": + version: 2.7.0 + resolution: "pg-connection-string@npm:2.7.0" + checksum: 10c0/50a1496a1c858f9495d78a2c7a66d93ef3602e718aff2953bb5738f3ea616d7f727f32fc20513c9bed127650cd14c1ddc7b458396f4000e689d4b64c65c5c51e languageName: node linkType: hard @@ -6564,22 +6513,29 @@ __metadata: languageName: node linkType: hard -"pg-pool@npm:^3.6.2": - version: 3.6.2 - resolution: "pg-pool@npm:3.6.2" +"pg-pool@npm:^3.7.0": + version: 3.7.0 + resolution: "pg-pool@npm:3.7.0" peerDependencies: pg: ">=8.0" - checksum: 10c0/14c524549490954b5e48457a4b808df8f619f6deeb3b395b0cd184a8f4ed65a9273fe0697ba0341a41d6745af197f1437eb1cf51fff0cbbf5b0fb3852ebe5392 + checksum: 10c0/9128673cf941f288c0cb1a74ca959a9b4f6075ef73b2cc7dece5d4db3dd7043784869e7c12bce2e69ca0df22132a419cc45c2050b4373632856fe8bae9eb94b5 languageName: node linkType: hard -"pg-protocol@npm:*, pg-protocol@npm:^1.6.1": +"pg-protocol@npm:*": version: 1.6.1 resolution: "pg-protocol@npm:1.6.1" checksum: 10c0/7eadef4010ac0a3925c460be7332ca4098a5c6d5181725a62193fcfa800000ae6632d98d814f3989b42cf5fdc3b45e34c714a1959d29174e81e30730e140ae5f languageName: node linkType: hard +"pg-protocol@npm:^1.7.0": + version: 1.7.0 + resolution: "pg-protocol@npm:1.7.0" + checksum: 10c0/c4af854d9b843c808231c0040fed89f2b9101006157df8da2bb2f62a7dde702de748d852228dc22df41cc7ffddfb526af3bcb34b278b581e9f76a060789186c1 + languageName: node + linkType: hard + "pg-types@npm:^2.1.0, pg-types@npm:^2.2.0": version: 2.2.0 resolution: "pg-types@npm:2.2.0" @@ -6608,14 +6564,14 @@ __metadata: languageName: node linkType: hard -"pg@npm:^8.11.3": - version: 8.12.0 - resolution: "pg@npm:8.12.0" +"pg@npm:^8.13.0": + version: 8.13.0 + resolution: "pg@npm:8.13.0" dependencies: pg-cloudflare: "npm:^1.1.1" - pg-connection-string: "npm:^2.6.4" - pg-pool: "npm:^3.6.2" - pg-protocol: "npm:^1.6.1" + pg-connection-string: "npm:^2.7.0" + pg-pool: "npm:^3.7.0" + pg-protocol: "npm:^1.7.0" pg-types: "npm:^2.1.0" pgpass: "npm:1.x" peerDependencies: @@ -6626,7 +6582,7 @@ __metadata: peerDependenciesMeta: pg-native: optional: true - checksum: 10c0/973e49b5e7327c42fc62806efa8c824159ab7a0b676cefe6eeb51a59b6e226587911ec27697f36c18d69e58a7f4f0b76d0829364087194d13ed431ab7c9c417a + checksum: 10c0/1521189063d2293d62f3fac61e797a3096a62a69668c223827d00b83c17a320805f31f0b5316feb80f8d9eed0c6c32f95146d8aca866af05816a66fd2ba8e32a languageName: node linkType: hard @@ -6663,6 +6619,15 @@ __metadata: languageName: node linkType: hard +"pino-abstract-transport@npm:^2.0.0": + version: 2.0.0 + resolution: "pino-abstract-transport@npm:2.0.0" + dependencies: + split2: "npm:^4.0.0" + checksum: 10c0/02c05b8f2ffce0d7c774c8e588f61e8b77de8ccb5f8125afd4a7325c9ea0e6af7fb78168999657712ae843e4462bb70ac550dfd6284f930ee57f17f486f25a9f + languageName: node + linkType: hard + "pino-std-serializers@npm:^7.0.0": version: 7.0.0 resolution: "pino-std-serializers@npm:7.0.0" @@ -6691,6 +6656,27 @@ __metadata: languageName: node linkType: hard +"pino@npm:^9.5.0": + version: 9.5.0 + resolution: "pino@npm:9.5.0" + dependencies: + atomic-sleep: "npm:^1.0.0" + fast-redact: "npm:^3.1.1" + on-exit-leak-free: "npm:^2.1.0" + pino-abstract-transport: "npm:^2.0.0" + pino-std-serializers: "npm:^7.0.0" + process-warning: "npm:^4.0.0" + quick-format-unescaped: "npm:^4.0.3" + real-require: "npm:^0.2.0" + safe-stable-stringify: "npm:^2.3.1" + sonic-boom: "npm:^4.0.1" + thread-stream: "npm:^3.0.0" + bin: + pino: bin.js + checksum: 10c0/b06590c5f4da43df59905af1aac344432b43154c4c1569ebea168e7ae7fd0a4181ccabb769a6568cf3e781e1d1b9df13d65b3603e25ebb05539bcb02ea04215e + languageName: node + linkType: hard + "possible-typed-array-names@npm:^1.0.0": version: 1.0.0 resolution: "possible-typed-array-names@npm:1.0.0" @@ -6799,18 +6785,18 @@ __metadata: languageName: node linkType: hard -"prisma@npm:^5.4.1": - version: 5.19.1 - resolution: "prisma@npm:5.19.1" +"prisma@npm:^5.21.1": + version: 5.21.1 + resolution: "prisma@npm:5.21.1" dependencies: - "@prisma/engines": "npm:5.19.1" + "@prisma/engines": "npm:5.21.1" fsevents: "npm:2.3.3" dependenciesMeta: fsevents: optional: true bin: prisma: build/index.js - checksum: 10c0/efbe4966fc5450e8c3c7e09f8e9950c2068e90f44b1cbb3584f4e48d7188a4d5230ec8fb12c3b9ba75fa7407fe45c0527123579e121a31ef652512f39c29c2d9 + checksum: 10c0/14a276fb1891e1fec832da1632a4c3c9ae6909a094067d1ba94012fe2063b80f44680a0a373fc86e0e73b8a81455f20374303f70d93451060e06b93f0983b82b languageName: node linkType: hard @@ -6877,7 +6863,7 @@ __metadata: languageName: node linkType: hard -"protobufjs-cli@npm:^1.1.2": +"protobufjs-cli@npm:^1.1.3": version: 1.1.3 resolution: "protobufjs-cli@npm:1.1.3" dependencies: @@ -6900,7 +6886,7 @@ __metadata: languageName: node linkType: hard -"protobufjs@npm:^7.2.5, protobufjs@npm:^7.2.6, protobufjs@npm:^7.3.0": +"protobufjs@npm:^7.2.5, protobufjs@npm:^7.3.0, protobufjs@npm:^7.4.0": version: 7.4.0 resolution: "protobufjs@npm:7.4.0" dependencies: @@ -6937,12 +6923,12 @@ __metadata: languageName: node linkType: hard -"qs@npm:6.11.0": - version: 6.11.0 - resolution: "qs@npm:6.11.0" +"qs@npm:6.13.0": + version: 6.13.0 + resolution: "qs@npm:6.13.0" dependencies: - side-channel: "npm:^1.0.4" - checksum: 10c0/4e4875e4d7c7c31c233d07a448e7e4650f456178b9dd3766b7cfa13158fdb24ecb8c4f059fa91e820dc6ab9f2d243721d071c9c0378892dcdad86e9e9a27c68f + side-channel: "npm:^1.0.6" + checksum: 10c0/62372cdeec24dc83a9fb240b7533c0fdcf0c5f7e0b83343edd7310f0ab4c8205a5e7c56406531f2e47e1b4878a3821d652be4192c841de5b032ca83619d8f860 languageName: node linkType: hard @@ -6995,7 +6981,7 @@ __metadata: languageName: node linkType: hard -"react-dom@npm:^18.2.0": +"react-dom@npm:^18.3.1": version: 18.3.1 resolution: "react-dom@npm:18.3.1" dependencies: @@ -7014,7 +7000,7 @@ __metadata: languageName: node linkType: hard -"react@npm:^18.2.0": +"react@npm:^18.3.1": version: 18.3.1 resolution: "react@npm:18.3.1" dependencies: @@ -7373,7 +7359,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.1.2, semver@npm:^7.3.5, semver@npm:^7.5.2, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0": +"semver@npm:^7.1.2, semver@npm:^7.3.5, semver@npm:^7.5.2, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.3": version: 7.6.3 resolution: "semver@npm:7.6.3" bin: @@ -7382,9 +7368,9 @@ __metadata: languageName: node linkType: hard -"send@npm:0.18.0": - version: 0.18.0 - resolution: "send@npm:0.18.0" +"send@npm:0.19.0": + version: 0.19.0 + resolution: "send@npm:0.19.0" dependencies: debug: "npm:2.6.9" depd: "npm:2.0.0" @@ -7399,7 +7385,7 @@ __metadata: on-finished: "npm:2.4.1" range-parser: "npm:~1.2.1" statuses: "npm:2.0.1" - checksum: 10c0/0eb134d6a51fc13bbcb976a1f4214ea1e33f242fae046efc311e80aff66c7a43603e26a79d9d06670283a13000e51be6e0a2cb80ff0942eaf9f1cd30b7ae736a + checksum: 10c0/ea3f8a67a8f0be3d6bf9080f0baed6d2c51d11d4f7b4470de96a5029c598a7011c497511ccc28968b70ef05508675cebff27da9151dd2ceadd60be4e6cf845e3 languageName: node linkType: hard @@ -7419,15 +7405,15 @@ __metadata: languageName: node linkType: hard -"serve-static@npm:1.15.0": - version: 1.15.0 - resolution: "serve-static@npm:1.15.0" +"serve-static@npm:1.16.2": + version: 1.16.2 + resolution: "serve-static@npm:1.16.2" dependencies: - encodeurl: "npm:~1.0.2" + encodeurl: "npm:~2.0.0" escape-html: "npm:~1.0.3" parseurl: "npm:~1.3.3" - send: "npm:0.18.0" - checksum: 10c0/fa9f0e21a540a28f301258dfe1e57bb4f81cd460d28f0e973860477dd4acef946a1f41748b5bd41c73b621bea2029569c935faa38578fd34cd42a9b4947088ba + send: "npm:0.19.0" + checksum: 10c0/528fff6f5e12d0c5a391229ad893910709bc51b5705962b09404a1d813857578149b8815f35d3ee5752f44cd378d0f31669d4b1d7e2d11f41e08283d5134bd1f languageName: node linkType: hard @@ -7501,7 +7487,7 @@ __metadata: languageName: node linkType: hard -"side-channel@npm:^1.0.4": +"side-channel@npm:^1.0.4, side-channel@npm:^1.0.6": version: 1.0.6 resolution: "side-channel@npm:1.0.6" dependencies: @@ -7575,7 +7561,7 @@ __metadata: version: 0.0.0-use.local resolution: "solarwinds-apm@workspace:packages/solarwinds-apm" dependencies: - "@grpc/grpc-js": "npm:^1.10.6" + "@grpc/grpc-js": "npm:^1.12.2" "@opentelemetry/api": "npm:^1.3.0" "@opentelemetry/api-logs": "npm:~0.53.0" "@opentelemetry/core": "npm:~1.26.0" @@ -7600,12 +7586,12 @@ __metadata: "@solarwinds-apm/test": "workspace:^" "@types/json-stringify-safe": "npm:^5.0.3" "@types/node": "npm:^18.19.0" - eslint: "npm:^9.9.1" + eslint: "npm:^9.12.0" json-stringify-safe: "npm:^5.0.1" node-releases: "npm:^2.0.18" prettier: "npm:^3.3.3" typescript: "npm:~5.5.3" - zod: "npm:^3.22.4" + zod: "npm:^3.23.8" peerDependencies: "@opentelemetry/api": ^1.3.0 peerDependenciesMeta: @@ -7984,7 +7970,7 @@ __metadata: languageName: node linkType: hard -"ts-api-utils@npm:^1.0.1, ts-api-utils@npm:^1.3.0": +"ts-api-utils@npm:^1.3.0": version: 1.3.0 resolution: "ts-api-utils@npm:1.3.0" peerDependencies: @@ -8047,58 +8033,58 @@ __metadata: languageName: node linkType: hard -"turbo-darwin-64@npm:2.1.1": - version: 2.1.1 - resolution: "turbo-darwin-64@npm:2.1.1" +"turbo-darwin-64@npm:2.2.0": + version: 2.2.0 + resolution: "turbo-darwin-64@npm:2.2.0" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"turbo-darwin-arm64@npm:2.1.1": - version: 2.1.1 - resolution: "turbo-darwin-arm64@npm:2.1.1" +"turbo-darwin-arm64@npm:2.2.0": + version: 2.2.0 + resolution: "turbo-darwin-arm64@npm:2.2.0" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"turbo-linux-64@npm:2.1.1": - version: 2.1.1 - resolution: "turbo-linux-64@npm:2.1.1" +"turbo-linux-64@npm:2.2.0": + version: 2.2.0 + resolution: "turbo-linux-64@npm:2.2.0" conditions: os=linux & cpu=x64 languageName: node linkType: hard -"turbo-linux-arm64@npm:2.1.1": - version: 2.1.1 - resolution: "turbo-linux-arm64@npm:2.1.1" +"turbo-linux-arm64@npm:2.2.0": + version: 2.2.0 + resolution: "turbo-linux-arm64@npm:2.2.0" conditions: os=linux & cpu=arm64 languageName: node linkType: hard -"turbo-windows-64@npm:2.1.1": - version: 2.1.1 - resolution: "turbo-windows-64@npm:2.1.1" +"turbo-windows-64@npm:2.2.0": + version: 2.2.0 + resolution: "turbo-windows-64@npm:2.2.0" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"turbo-windows-arm64@npm:2.1.1": - version: 2.1.1 - resolution: "turbo-windows-arm64@npm:2.1.1" +"turbo-windows-arm64@npm:2.2.0": + version: 2.2.0 + resolution: "turbo-windows-arm64@npm:2.2.0" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"turbo@npm:^2.0.9": - version: 2.1.1 - resolution: "turbo@npm:2.1.1" - dependencies: - turbo-darwin-64: "npm:2.1.1" - turbo-darwin-arm64: "npm:2.1.1" - turbo-linux-64: "npm:2.1.1" - turbo-linux-arm64: "npm:2.1.1" - turbo-windows-64: "npm:2.1.1" - turbo-windows-arm64: "npm:2.1.1" +"turbo@npm:^2.2.0": + version: 2.2.0 + resolution: "turbo@npm:2.2.0" + dependencies: + turbo-darwin-64: "npm:2.2.0" + turbo-darwin-arm64: "npm:2.2.0" + turbo-linux-64: "npm:2.2.0" + turbo-linux-arm64: "npm:2.2.0" + turbo-windows-64: "npm:2.2.0" + turbo-windows-arm64: "npm:2.2.0" dependenciesMeta: turbo-darwin-64: optional: true @@ -8114,7 +8100,7 @@ __metadata: optional: true bin: turbo: bin/turbo - checksum: 10c0/16ba5214d14404993bf2a1c411ba5e6bd297c0f5c2c6c42fb3d7f5a5169bd673307c540684432d2a962377068c26c8bce5e759c3bd3b87f3234d321bbbef9eaf + checksum: 10c0/19d25f55ef2483f7948dc61bbcd79c718565b4e96a48c494cfda8628e861ef686810ec456ea8d652fa4a6d498d5e6af0ff1e75d74a69efda3638c7423d2faa39 languageName: node linkType: hard @@ -8212,17 +8198,17 @@ __metadata: languageName: node linkType: hard -"typescript-eslint@npm:^8.3.0": - version: 8.4.0 - resolution: "typescript-eslint@npm:8.4.0" +"typescript-eslint@npm:^8.10.0": + version: 8.10.0 + resolution: "typescript-eslint@npm:8.10.0" dependencies: - "@typescript-eslint/eslint-plugin": "npm:8.4.0" - "@typescript-eslint/parser": "npm:8.4.0" - "@typescript-eslint/utils": "npm:8.4.0" + "@typescript-eslint/eslint-plugin": "npm:8.10.0" + "@typescript-eslint/parser": "npm:8.10.0" + "@typescript-eslint/utils": "npm:8.10.0" peerDependenciesMeta: typescript: optional: true - checksum: 10c0/266ef73fdc1f7fa19228b8653d61ad143261ccd35f7d5d647092ed0e1512de2d4e3d1b9e1f2520658708cc0c1d7925c4ec97f23440c180a3bf1716e81d65123f + checksum: 10c0/9eca1bfdea4e108bea06f0053b57f8a9eaeb43bf3316a39c6d29631bd3217ec67611e46d361417c48a5f6eeb99c4a7fc81c020734b1b47d7b8e42fa67d74ea0f languageName: node linkType: hard @@ -8461,9 +8447,9 @@ __metadata: languageName: node linkType: hard -"winston@npm:^3.10.0": - version: 3.14.2 - resolution: "winston@npm:3.14.2" +"winston@npm:^3.15.0": + version: 3.15.0 + resolution: "winston@npm:3.15.0" dependencies: "@colors/colors": "npm:^1.6.0" "@dabh/diagnostics": "npm:^2.0.2" @@ -8476,7 +8462,7 @@ __metadata: stack-trace: "npm:0.0.x" triple-beam: "npm:^1.3.0" winston-transport: "npm:^4.7.0" - checksum: 10c0/3f8fe505ea18310982e60452f335dd2b22fdbc9b25839b6ad882971b2416d5adc94a1f1a46e24cb37d967ad01dfe5499adaf5e53575626b5ebb2a25ff30f4e1d + checksum: 10c0/ed987e48fdfdd3f27974107f96e5a84688747d9a2be341e6838c5be4c76ebba1a11cc20320b8def4d907981b7268ebccaa6326b1ed75c50f549ee81c211e1b4d languageName: node linkType: hard @@ -8639,7 +8625,7 @@ __metadata: languageName: node linkType: hard -"zod@npm:^3.22.4": +"zod@npm:^3.23.8": version: 3.23.8 resolution: "zod@npm:3.23.8" checksum: 10c0/8f14c87d6b1b53c944c25ce7a28616896319d95bc46a9660fe441adc0ed0a81253b02b5abdaeffedbeb23bdd25a0bf1c29d2c12dd919aef6447652dd295e3e69 From 42ad2148346d7dd64aab121e56e04220144091ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Th=C3=A9riault?= Date: Fri, 18 Oct 2024 16:19:53 -0400 Subject: [PATCH 05/15] upgrade typescrupt --- examples/next-prisma/package.json | 2 +- examples/package.json | 2 +- package.json | 2 +- packages/bindings/package.json | 2 +- packages/compat/package.json | 2 +- packages/dependencies/package.json | 2 +- packages/eslint-config/package.json | 2 +- packages/histogram/package.json | 2 +- packages/instrumentations/package.json | 2 +- packages/module/package.json | 2 +- packages/proto/package.json | 2 +- packages/sampling/package.json | 2 +- packages/solarwinds-apm/package.json | 2 +- packages/test/package.json | 2 +- scripts/package.json | 2 +- turbo.json | 23 ++--- yarn.lock | 126 ++++++------------------- 17 files changed, 55 insertions(+), 124 deletions(-) diff --git a/examples/next-prisma/package.json b/examples/next-prisma/package.json index c2477077..cb87d846 100644 --- a/examples/next-prisma/package.json +++ b/examples/next-prisma/package.json @@ -21,6 +21,6 @@ "eslint": "^8.57.0", "eslint-config-next": "^14.2.15", "prisma": "^5.21.1", - "typescript": "~5.5.3" + "typescript": "~5.6.3" } } diff --git a/examples/package.json b/examples/package.json index 9b59b804..b7f0febf 100644 --- a/examples/package.json +++ b/examples/package.json @@ -10,6 +10,6 @@ "@solarwinds-apm/eslint-config": "workspace:^", "eslint": "^9.12.0", "prettier": "^3.3.3", - "typescript": "~5.5.3" + "typescript": "~5.6.3" } } diff --git a/package.json b/package.json index dbab0650..40b1f1c2 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,6 @@ "husky": "^9.1.6", "prettier": "^3.3.3", "turbo": "^2.2.0", - "typescript": "~5.5.3" + "typescript": "~5.6.3" } } diff --git a/packages/bindings/package.json b/packages/bindings/package.json index b16311d7..d76e46c4 100644 --- a/packages/bindings/package.json +++ b/packages/bindings/package.json @@ -51,7 +51,7 @@ "eslint": "^9.12.0", "node-addon-api": "^8.2.1", "prettier": "^3.3.3", - "typescript": "~5.5.3", + "typescript": "~5.6.3", "zig-build": "^0.3.0" }, "engines": { diff --git a/packages/compat/package.json b/packages/compat/package.json index d76ae8cd..8fc70859 100644 --- a/packages/compat/package.json +++ b/packages/compat/package.json @@ -49,7 +49,7 @@ "@types/node": "^18.19.0", "eslint": "^9.12.0", "prettier": "^3.3.3", - "typescript": "~5.5.3" + "typescript": "~5.6.3" }, "engines": { "node": "^18.19.0 || ^20.8.0 || >=22.0.0" diff --git a/packages/dependencies/package.json b/packages/dependencies/package.json index c4803efd..cb9cf97c 100644 --- a/packages/dependencies/package.json +++ b/packages/dependencies/package.json @@ -43,7 +43,7 @@ "@types/node": "^18.19.0", "eslint": "^9.12.0", "prettier": "^3.3.3", - "typescript": "~5.5.3" + "typescript": "~5.6.3" }, "engines": { "node": "^18.19.0 || ^20.8.0 || >=22.0.0" diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index 92e85651..3c6f2d92 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -56,6 +56,6 @@ "devDependencies": { "eslint": "^9.12.0", "prettier": "^3.3.3", - "typescript": "~5.5.3" + "typescript": "~5.6.3" } } diff --git a/packages/histogram/package.json b/packages/histogram/package.json index 47ba430d..8cf677c1 100644 --- a/packages/histogram/package.json +++ b/packages/histogram/package.json @@ -40,7 +40,7 @@ "@types/node": "^18.19.0", "eslint": "^9.12.0", "prettier": "^3.3.3", - "typescript": "~5.5.3" + "typescript": "~5.6.3" }, "engines": { "node": "^18.19.0 || ^20.8.0 || >=22.0.0" diff --git a/packages/instrumentations/package.json b/packages/instrumentations/package.json index e07e0d24..f70bb143 100644 --- a/packages/instrumentations/package.json +++ b/packages/instrumentations/package.json @@ -96,7 +96,7 @@ "eslint": "^9.12.0", "prettier": "^3.3.3", "semver": "^7.6.3", - "typescript": "~5.5.3" + "typescript": "~5.6.3" }, "engines": { "node": "^18.19.0 || ^20.8.0 || >=22.0.0" diff --git a/packages/module/package.json b/packages/module/package.json index 2ca9860c..db69d8e5 100644 --- a/packages/module/package.json +++ b/packages/module/package.json @@ -38,7 +38,7 @@ "@types/node": "^18.19.0", "eslint": "^9.12.0", "prettier": "^3.3.3", - "typescript": "~5.5.3" + "typescript": "~5.6.3" }, "engines": { "node": "^18.19.0 || ^20.8.0 || >=22.0.0" diff --git a/packages/proto/package.json b/packages/proto/package.json index db311baa..64a55ac4 100644 --- a/packages/proto/package.json +++ b/packages/proto/package.json @@ -41,7 +41,7 @@ "eslint": "^9.12.0", "prettier": "^3.3.3", "protobufjs-cli": "^1.1.3", - "typescript": "~5.5.3" + "typescript": "~5.6.3" }, "engines": { "node": "^18.19.0 || ^20.8.0 || >=22.0.0" diff --git a/packages/sampling/package.json b/packages/sampling/package.json index 45c739b8..919a9034 100644 --- a/packages/sampling/package.json +++ b/packages/sampling/package.json @@ -53,7 +53,7 @@ "@types/node": "^18.19.0", "eslint": "^9.12.0", "prettier": "^3.3.3", - "typescript": "~5.5.3" + "typescript": "~5.6.3" }, "engines": { "node": "^18.19.0 || ^20.8.0 || >=22.0.0" diff --git a/packages/solarwinds-apm/package.json b/packages/solarwinds-apm/package.json index e5971fcb..8b0a0412 100644 --- a/packages/solarwinds-apm/package.json +++ b/packages/solarwinds-apm/package.json @@ -95,7 +95,7 @@ "@types/node": "^18.19.0", "eslint": "^9.12.0", "prettier": "^3.3.3", - "typescript": "~5.5.3" + "typescript": "~5.6.3" }, "engines": { "node": "^18.19.0 || ^20.8.0 || >=22.0.0" diff --git a/packages/test/package.json b/packages/test/package.json index ad9e0b65..bee57986 100644 --- a/packages/test/package.json +++ b/packages/test/package.json @@ -64,7 +64,7 @@ "@types/semver": "^7.5.8", "eslint": "^9.12.0", "prettier": "^3.3.3", - "typescript": "~5.5.3" + "typescript": "~5.6.3" }, "engines": { "node": "^18.19.0 || ^20.8.0 || >=22.0.0" diff --git a/scripts/package.json b/scripts/package.json index e3c9e5da..90c9deeb 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -14,6 +14,6 @@ "eslint": "^9.12.0", "ora": "^5.4.1", "prettier": "^3.3.3", - "typescript": "~5.5.3" + "typescript": "~5.6.3" } } diff --git a/turbo.json b/turbo.json index 14d6802d..f0364626 100644 --- a/turbo.json +++ b/turbo.json @@ -18,25 +18,20 @@ ] }, "lint": { - "dependsOn": ["^build"], - "outputs": [] + "dependsOn": ["^build"] }, "lint:fix": { - "dependsOn": ["^build"], - "outputs": [] + "dependsOn": ["^build"] }, "release": { - "dependsOn": ["^release"], - "outputs": [] + "dependsOn": ["^release"] }, "start": { - "dependsOn": ["build"], - "outputs": [] + "dependsOn": ["build"] }, "test": { "dependsOn": ["@solarwinds-apm/test#build", "build"], - "inputs": ["package.json", "tsconfig.json", "src/**", "test/**"], - "outputs": [] + "inputs": ["package.json", "tsconfig.json", "src/**", "test/**"] } }, "globalDependencies": [ @@ -48,5 +43,11 @@ "yarn.lock", "packages/eslint-config/index.js" ], - "globalPassThroughEnv": ["SW_APM_*", "OTEL_*", "NODE_ENV", "GITHUB_TOKEN"] + "globalPassThroughEnv": [ + "SW_APM_*", + "OTEL_*", + "AWS_LAMBDA_*", + "NODE_ENV", + "GITHUB_TOKEN" + ] } diff --git a/yarn.lock b/yarn.lock index 09d6bf6b..127d7994 100644 --- a/yarn.lock +++ b/yarn.lock @@ -302,14 +302,7 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/retry@npm:^0.3.0": - version: 0.3.0 - resolution: "@humanwhocodes/retry@npm:0.3.0" - checksum: 10c0/7111ec4e098b1a428459b4e3be5a5d2a13b02905f805a2468f4fa628d072f0de2da26a27d04f65ea2846f73ba51f4204661709f05bfccff645e3cedef8781bb6 - languageName: node - linkType: hard - -"@humanwhocodes/retry@npm:^0.3.1": +"@humanwhocodes/retry@npm:^0.3.0, @humanwhocodes/retry@npm:^0.3.1": version: 0.3.1 resolution: "@humanwhocodes/retry@npm:0.3.1" checksum: 10c0/f0da1282dfb45e8120480b9e2e275e2ac9bbe1cf016d046fdad8e27cc1285c45bb9e711681237944445157b430093412b4446c1ab3fc4bb037861b5904101d3b @@ -1552,7 +1545,7 @@ __metadata: eslint: "npm:^9.12.0" node-addon-api: "npm:^8.2.1" prettier: "npm:^3.3.3" - typescript: "npm:~5.5.3" + typescript: "npm:~5.6.3" zig-build: "npm:^0.3.0" dependenciesMeta: "@solarwinds-apm/bindings-linux-arm64-gnu": @@ -1577,7 +1570,7 @@ __metadata: "@types/node": "npm:^18.19.0" eslint: "npm:^9.12.0" prettier: "npm:^3.3.3" - typescript: "npm:~5.5.3" + typescript: "npm:~5.6.3" peerDependencies: "@opentelemetry/api": ^1.3.0 peerDependenciesMeta: @@ -1596,7 +1589,7 @@ __metadata: "@types/node": "npm:^18.19.0" eslint: "npm:^9.12.0" prettier: "npm:^3.3.3" - typescript: "npm:~5.5.3" + typescript: "npm:~5.6.3" languageName: unknown linkType: soft @@ -1610,7 +1603,7 @@ __metadata: eslint-plugin-notice: "npm:^1.0.0" eslint-plugin-simple-import-sort: "npm:^12.1.1" prettier: "npm:^3.3.3" - typescript: "npm:~5.5.3" + typescript: "npm:~5.6.3" typescript-eslint: "npm:^8.10.0" peerDependencies: eslint: ^9.0.0 @@ -1695,7 +1688,7 @@ __metadata: react: "npm:^18.3.1" react-dom: "npm:^18.3.1" solarwinds-apm: "workspace:^" - typescript: "npm:~5.5.3" + typescript: "npm:~5.6.3" languageName: unknown linkType: soft @@ -1706,7 +1699,7 @@ __metadata: "@solarwinds-apm/eslint-config": "workspace:^" eslint: "npm:^9.12.0" prettier: "npm:^3.3.3" - typescript: "npm:~5.5.3" + typescript: "npm:~5.6.3" languageName: unknown linkType: soft @@ -1720,7 +1713,7 @@ __metadata: "@types/node": "npm:^18.19.0" eslint: "npm:^9.12.0" prettier: "npm:^3.3.3" - typescript: "npm:~5.5.3" + typescript: "npm:~5.6.3" languageName: unknown linkType: soft @@ -1780,7 +1773,7 @@ __metadata: eslint: "npm:^9.12.0" prettier: "npm:^3.3.3" semver: "npm:^7.6.3" - typescript: "npm:~5.5.3" + typescript: "npm:~5.6.3" peerDependencies: "@opentelemetry/api": ^1.3.0 peerDependenciesMeta: @@ -1797,7 +1790,7 @@ __metadata: "@types/node": "npm:^18.19.0" eslint: "npm:^9.12.0" prettier: "npm:^3.3.3" - typescript: "npm:~5.5.3" + typescript: "npm:~5.6.3" languageName: unknown linkType: soft @@ -1810,7 +1803,7 @@ __metadata: prettier: "npm:^3.3.3" protobufjs: "npm:^7.4.0" protobufjs-cli: "npm:^1.1.3" - typescript: "npm:~5.5.3" + typescript: "npm:~5.6.3" languageName: unknown linkType: soft @@ -1826,7 +1819,7 @@ __metadata: "@types/node": "npm:^18.19.0" eslint: "npm:^9.12.0" prettier: "npm:^3.3.3" - typescript: "npm:~5.5.3" + typescript: "npm:~5.6.3" peerDependencies: "@opentelemetry/api": ^1.3.0 peerDependenciesMeta: @@ -1845,7 +1838,7 @@ __metadata: eslint: "npm:^9.12.0" ora: "npm:^5.4.1" prettier: "npm:^3.3.3" - typescript: "npm:~5.5.3" + typescript: "npm:~5.6.3" languageName: unknown linkType: soft @@ -1857,7 +1850,7 @@ __metadata: husky: "npm:^9.1.6" prettier: "npm:^3.3.3" turbo: "npm:^2.2.0" - typescript: "npm:~5.5.3" + typescript: "npm:~5.6.3" languageName: unknown linkType: soft @@ -1885,7 +1878,7 @@ __metadata: prettier: "npm:^3.3.3" semver: "npm:^7.6.3" ts-node: "npm:^11.0.0-beta.1" - typescript: "npm:~5.5.3" + typescript: "npm:~5.6.3" bin: swtest: ./dist/bin.js languageName: unknown @@ -1961,14 +1954,7 @@ __metadata: languageName: node linkType: hard -"@types/chai@npm:*": - version: 4.3.16 - resolution: "@types/chai@npm:4.3.16" - checksum: 10c0/745d4a9be429d5d86a7ab26064610b8957fe12dd80e94dc7d0707cf3db1c889e3ffe0d73d69bb15e6d376bf4462a7a75e9d8fc1051750b5d656d6cfe459829b7 - languageName: node - linkType: hard - -"@types/chai@npm:^4.3.20": +"@types/chai@npm:*, @types/chai@npm:^4.3.20": version: 4.3.20 resolution: "@types/chai@npm:4.3.20" checksum: 10c0/4601189d611752e65018f1ecadac82e94eed29f348e1d5430e5681a60b01e1ecf855d9bcc74ae43b07394751f184f6970fac2b5561fc57a1f36e93a0f5ffb6e8 @@ -3956,13 +3942,6 @@ __metadata: languageName: node linkType: hard -"eslint-visitor-keys@npm:^4.0.0": - version: 4.0.0 - resolution: "eslint-visitor-keys@npm:4.0.0" - checksum: 10c0/76619f42cf162705a1515a6868e6fc7567e185c7063a05621a8ac4c3b850d022661262c21d9f1fc1d144ecf0d5d64d70a3f43c15c3fc969a61ace0fb25698cf5 - languageName: node - linkType: hard - "eslint-visitor-keys@npm:^4.1.0": version: 4.1.0 resolution: "eslint-visitor-keys@npm:4.1.0" @@ -4068,18 +4047,7 @@ __metadata: languageName: node linkType: hard -"espree@npm:^10.0.1": - version: 10.1.0 - resolution: "espree@npm:10.1.0" - dependencies: - acorn: "npm:^8.12.0" - acorn-jsx: "npm:^5.3.2" - eslint-visitor-keys: "npm:^4.0.0" - checksum: 10c0/52e6feaa77a31a6038f0c0e3fce93010a4625701925b0715cd54a2ae190b3275053a0717db698697b32653788ac04845e489d6773b508d6c2e8752f3c57470a0 - languageName: node - linkType: hard - -"espree@npm:^10.2.0": +"espree@npm:^10.0.1, espree@npm:^10.2.0": version: 10.2.0 resolution: "espree@npm:10.2.0" dependencies: @@ -6522,14 +6490,7 @@ __metadata: languageName: node linkType: hard -"pg-protocol@npm:*": - version: 1.6.1 - resolution: "pg-protocol@npm:1.6.1" - checksum: 10c0/7eadef4010ac0a3925c460be7332ca4098a5c6d5181725a62193fcfa800000ae6632d98d814f3989b42cf5fdc3b45e34c714a1959d29174e81e30730e140ae5f - languageName: node - linkType: hard - -"pg-protocol@npm:^1.7.0": +"pg-protocol@npm:*, pg-protocol@npm:^1.7.0": version: 1.7.0 resolution: "pg-protocol@npm:1.7.0" checksum: 10c0/c4af854d9b843c808231c0040fed89f2b9101006157df8da2bb2f62a7dde702de748d852228dc22df41cc7ffddfb526af3bcb34b278b581e9f76a060789186c1 @@ -6609,16 +6570,6 @@ __metadata: languageName: node linkType: hard -"pino-abstract-transport@npm:^1.2.0": - version: 1.2.0 - resolution: "pino-abstract-transport@npm:1.2.0" - dependencies: - readable-stream: "npm:^4.0.0" - split2: "npm:^4.0.0" - checksum: 10c0/b4ab59529b7a91f488440147fc58ee0827a6c1c5ca3627292339354b1381072c1a6bfa9b46d03ad27872589e8477ecf74da12cf286e1e6b665ac64a3b806bf07 - languageName: node - linkType: hard - "pino-abstract-transport@npm:^2.0.0": version: 2.0.0 resolution: "pino-abstract-transport@npm:2.0.0" @@ -6635,28 +6586,7 @@ __metadata: languageName: node linkType: hard -"pino@npm:^9.0.0": - version: 9.4.0 - resolution: "pino@npm:9.4.0" - dependencies: - atomic-sleep: "npm:^1.0.0" - fast-redact: "npm:^3.1.1" - on-exit-leak-free: "npm:^2.1.0" - pino-abstract-transport: "npm:^1.2.0" - pino-std-serializers: "npm:^7.0.0" - process-warning: "npm:^4.0.0" - quick-format-unescaped: "npm:^4.0.3" - real-require: "npm:^0.2.0" - safe-stable-stringify: "npm:^2.3.1" - sonic-boom: "npm:^4.0.1" - thread-stream: "npm:^3.0.0" - bin: - pino: bin.js - checksum: 10c0/12a3d74968964d92b18ca7d6095a3c5b86478dc22264a37486d64e102085ed08820fcbe75e640acc3542fdf2937a34e5050b624f98e6ac62dd10f5e1328058a2 - languageName: node - linkType: hard - -"pino@npm:^9.5.0": +"pino@npm:^9.0.0, pino@npm:^9.5.0": version: 9.5.0 resolution: "pino@npm:9.5.0" dependencies: @@ -7590,7 +7520,7 @@ __metadata: json-stringify-safe: "npm:^5.0.1" node-releases: "npm:^2.0.18" prettier: "npm:^3.3.3" - typescript: "npm:~5.5.3" + typescript: "npm:~5.6.3" zod: "npm:^3.23.8" peerDependencies: "@opentelemetry/api": ^1.3.0 @@ -8212,23 +8142,23 @@ __metadata: languageName: node linkType: hard -"typescript@npm:~5.5.3": - version: 5.5.4 - resolution: "typescript@npm:5.5.4" +"typescript@npm:~5.6.3": + version: 5.6.3 + resolution: "typescript@npm:5.6.3" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/422be60f89e661eab29ac488c974b6cc0a660fb2228003b297c3d10c32c90f3bcffc1009b43876a082515a3c376b1eefcce823d6e78982e6878408b9a923199c + checksum: 10c0/44f61d3fb15c35359bc60399cb8127c30bae554cd555b8e2b46d68fa79d680354b83320ad419ff1b81a0bdf324197b29affe6cc28988cd6a74d4ac60c94f9799 languageName: node linkType: hard -"typescript@patch:typescript@npm%3A~5.5.3#optional!builtin": - version: 5.5.4 - resolution: "typescript@patch:typescript@npm%3A5.5.4#optional!builtin::version=5.5.4&hash=b45daf" +"typescript@patch:typescript@npm%3A~5.6.3#optional!builtin": + version: 5.6.3 + resolution: "typescript@patch:typescript@npm%3A5.6.3#optional!builtin::version=5.6.3&hash=b45daf" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/10dd9881baba22763de859e8050d6cb6e2db854197495c6f1929b08d1eb2b2b00d0b5d9b0bcee8472f1c3f4a7ef6a5d7ebe0cfd703f853aa5ae465b8404bc1ba + checksum: 10c0/ac8307bb06bbfd08ae7137da740769b7d8c3ee5943188743bb622c621f8ad61d244767480f90fbd840277fbf152d8932aa20c33f867dea1bb5e79b187ca1a92f languageName: node linkType: hard From 44ea6c0ea7347295e9c1242cfc62f055aa6f5a32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Th=C3=A9riault?= Date: Fri, 18 Oct 2024 16:30:28 -0400 Subject: [PATCH 06/15] update fastify --- examples/fastify-postgres/index.js | 2 + examples/fastify-postgres/package.json | 4 +- examples/next-prisma/package.json | 2 +- packages/eslint-config/package.json | 2 +- yarn.lock | 293 ++++++++++++------------- 5 files changed, 144 insertions(+), 159 deletions(-) diff --git a/examples/fastify-postgres/index.js b/examples/fastify-postgres/index.js index a206790e..9b1c0b2e 100644 --- a/examples/fastify-postgres/index.js +++ b/examples/fastify-postgres/index.js @@ -74,6 +74,7 @@ app.get( params: { type: "object", properties: { id: { type: "integer", minimum: 0 } }, + required: ["id"], }, }, }, @@ -96,6 +97,7 @@ app.patch( params: { type: "object", properties: { id: { type: "integer", minimum: 0 } }, + required: ["id"], }, body: { type: "object", diff --git a/examples/fastify-postgres/package.json b/examples/fastify-postgres/package.json index c6f454cb..47a484a1 100644 --- a/examples/fastify-postgres/package.json +++ b/examples/fastify-postgres/package.json @@ -6,9 +6,9 @@ "start": "node --import solarwinds-apm index.js" }, "dependencies": { - "@fastify/postgres": "^5.2.0", + "@fastify/postgres": "^6.0.1", "@opentelemetry/api": "^1.3.0", - "fastify": "^4.28.1", + "fastify": "^5.0.0", "pg": "^8.13.0", "pino": "^9.5.0", "solarwinds-apm": "workspace:^" diff --git a/examples/next-prisma/package.json b/examples/next-prisma/package.json index cb87d846..08b12d9c 100644 --- a/examples/next-prisma/package.json +++ b/examples/next-prisma/package.json @@ -18,7 +18,7 @@ "devDependencies": { "@types/node": "^18.19.0", "@types/react": "^18.3.11", - "eslint": "^8.57.0", + "eslint": "^8.57.1", "eslint-config-next": "^14.2.15", "prisma": "^5.21.1", "typescript": "~5.6.3" diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index 3c6f2d92..d86c1560 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -31,7 +31,7 @@ "release": "node ../../scripts/publish.js" }, "dependencies": { - "@eslint/js": "^9.12.0", + "@eslint/js": "^9.13.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-notice": "^1.0.0", "eslint-plugin-simple-import-sort": "^12.1.1", diff --git a/yarn.lock b/yarn.lock index 127d7994..a9a5eed5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -159,20 +159,27 @@ __metadata: languageName: node linkType: hard -"@eslint/js@npm:8.57.0": - version: 8.57.0 - resolution: "@eslint/js@npm:8.57.0" - checksum: 10c0/9a518bb8625ba3350613903a6d8c622352ab0c6557a59fe6ff6178bf882bf57123f9d92aa826ee8ac3ee74b9c6203fe630e9ee00efb03d753962dcf65ee4bd94 +"@eslint/js@npm:8.57.1": + version: 8.57.1 + resolution: "@eslint/js@npm:8.57.1" + checksum: 10c0/b489c474a3b5b54381c62e82b3f7f65f4b8a5eaaed126546520bf2fede5532a8ed53212919fed1e9048dcf7f37167c8561d58d0ba4492a4244004e7793805223 languageName: node linkType: hard -"@eslint/js@npm:9.12.0, @eslint/js@npm:^9.12.0": +"@eslint/js@npm:9.12.0": version: 9.12.0 resolution: "@eslint/js@npm:9.12.0" checksum: 10c0/325650a59a1ce3d97c69441501ebaf415607248bacbe8c8ca35adc7cb73b524f592f266a75772f496b06f3239e3ee1996722a242148085f0ee5fb3dd7065897c languageName: node linkType: hard +"@eslint/js@npm:^9.13.0": + version: 9.13.0 + resolution: "@eslint/js@npm:9.13.0" + checksum: 10c0/672257bffe17777b8a98bd80438702904cc7a0b98b9c2e426a8a10929198b3553edf8a3fc20feed4133c02e7c8f7331a0ef1b23e5dab8e4469f7f1791beff1e0 + languageName: node + linkType: hard + "@eslint/object-schema@npm:^2.1.4": version: 2.1.4 resolution: "@eslint/object-schema@npm:2.1.4" @@ -189,34 +196,34 @@ __metadata: languageName: node linkType: hard -"@fastify/ajv-compiler@npm:^3.5.0": - version: 3.5.0 - resolution: "@fastify/ajv-compiler@npm:3.5.0" +"@fastify/ajv-compiler@npm:^4.0.0": + version: 4.0.1 + resolution: "@fastify/ajv-compiler@npm:4.0.1" dependencies: - ajv: "npm:^8.11.0" - ajv-formats: "npm:^2.1.1" - fast-uri: "npm:^2.0.0" - checksum: 10c0/d10df76b7016984bf70bc6aca99962468ec43e0be5772d4aa3a7735ae78be44fdbcb2c078fe0cfdffec076080dfb7cbdbf4b729e52b168039477126f9d023af0 + ajv: "npm:^8.12.0" + ajv-formats: "npm:^3.0.1" + fast-uri: "npm:^3.0.0" + checksum: 10c0/178d06e799e6ea19d4b579cc90e11ef50babda9fc2828d85edbd7b08aaa5a63dad2a42ba92e07e9c1e5da78e4382854bb1e99a6f2f5e61da67c670dc3572842e languageName: node linkType: hard -"@fastify/error@npm:^3.3.0, @fastify/error@npm:^3.4.0": - version: 3.4.1 - resolution: "@fastify/error@npm:3.4.1" - checksum: 10c0/1f1a0faa8c86639afb6f4bd47a9cdc1f0f20ce0d6944340fbdec8218aaba91dc9cae9ed78e24e61bceb782a867efda2b9a6320091f00dcbb896d9c8a9bdf5f96 +"@fastify/error@npm:^4.0.0": + version: 4.0.0 + resolution: "@fastify/error@npm:4.0.0" + checksum: 10c0/074b8a6c350c29a8fc8314298d9457fe0c1ba6e7f160e9ae6ba0e18853f1ec7427d768f966700cbf67a4694f3a9a593c6a23e42ce3ed62e40fecdf8026040d9a languageName: node linkType: hard -"@fastify/fast-json-stringify-compiler@npm:^4.3.0": - version: 4.3.0 - resolution: "@fastify/fast-json-stringify-compiler@npm:4.3.0" +"@fastify/fast-json-stringify-compiler@npm:^5.0.0": + version: 5.0.1 + resolution: "@fastify/fast-json-stringify-compiler@npm:5.0.1" dependencies: - fast-json-stringify: "npm:^5.7.0" - checksum: 10c0/513ef296f5ed682f7a460cfa6c5fb917a32fc540111b873c9937f944558e021492b18f30f9fd8dd20db252381a4428adbcc9f03a077f16c86d02f081eb490c7b + fast-json-stringify: "npm:^6.0.0" + checksum: 10c0/dc294c24684fe900b9190f3b4d8e52b6438bf9e737dbd2b3b202d906f71ef1fb406c031c40fc34f52c61f4f00e1a0d5753ce5a88064de371248fb4116c02066b languageName: node linkType: hard -"@fastify/merge-json-schemas@npm:^0.1.0": +"@fastify/merge-json-schemas@npm:^0.1.1": version: 0.1.1 resolution: "@fastify/merge-json-schemas@npm:0.1.1" dependencies: @@ -225,14 +232,14 @@ __metadata: languageName: node linkType: hard -"@fastify/postgres@npm:^5.2.0": - version: 5.2.2 - resolution: "@fastify/postgres@npm:5.2.2" +"@fastify/postgres@npm:^6.0.1": + version: 6.0.1 + resolution: "@fastify/postgres@npm:6.0.1" dependencies: - fastify-plugin: "npm:^4.0.0" + fastify-plugin: "npm:^5.0.0" peerDependencies: pg: ">=6.0.0" - checksum: 10c0/65471b1dc5dd04ed89b87c90935d416cbb104103c63de44e644ef62fe5c30f35473a60deb87ee4753cc494742aed2565e26bd93da251a1da7ec13d4a68cfd8f7 + checksum: 10c0/9ddc5a856e40b7c4dbd57d627b0a82de24aeb61af4570a947f8db7d420f0f37be5240016e96e9733c251e386c7b0c4780ff04c3e0bb41084f011d8c0ab8bbc10 languageName: node linkType: hard @@ -277,14 +284,14 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/config-array@npm:^0.11.14": - version: 0.11.14 - resolution: "@humanwhocodes/config-array@npm:0.11.14" +"@humanwhocodes/config-array@npm:^0.13.0": + version: 0.13.0 + resolution: "@humanwhocodes/config-array@npm:0.13.0" dependencies: - "@humanwhocodes/object-schema": "npm:^2.0.2" + "@humanwhocodes/object-schema": "npm:^2.0.3" debug: "npm:^4.3.1" minimatch: "npm:^3.0.5" - checksum: 10c0/66f725b4ee5fdd8322c737cb5013e19fac72d4d69c8bf4b7feb192fcb83442b035b92186f8e9497c220e58b2d51a080f28a73f7899bc1ab288c3be172c467541 + checksum: 10c0/205c99e756b759f92e1f44a3dc6292b37db199beacba8f26c2165d4051fe73a4ae52fdcfd08ffa93e7e5cb63da7c88648f0e84e197d154bbbbe137b2e0dd332e languageName: node linkType: hard @@ -295,7 +302,7 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/object-schema@npm:^2.0.2": +"@humanwhocodes/object-schema@npm:^2.0.3": version: 2.0.3 resolution: "@humanwhocodes/object-schema@npm:2.0.3" checksum: 10c0/80520eabbfc2d32fe195a93557cef50dfe8c8905de447f022675aaf66abc33ae54098f5ea78548d925aa671cd4ab7c7daa5ad704fe42358c9b5e7db60f80696c @@ -1597,7 +1604,7 @@ __metadata: version: 0.0.0-use.local resolution: "@solarwinds-apm/eslint-config@workspace:packages/eslint-config" dependencies: - "@eslint/js": "npm:^9.12.0" + "@eslint/js": "npm:^9.13.0" eslint: "npm:^9.12.0" eslint-config-prettier: "npm:^9.1.0" eslint-plugin-notice: "npm:^1.0.0" @@ -1635,9 +1642,9 @@ __metadata: version: 0.0.0-use.local resolution: "@solarwinds-apm/example-fastify-postgres@workspace:examples/fastify-postgres" dependencies: - "@fastify/postgres": "npm:^5.2.0" + "@fastify/postgres": "npm:^6.0.1" "@opentelemetry/api": "npm:^1.3.0" - fastify: "npm:^4.28.1" + fastify: "npm:^5.0.0" pg: "npm:^8.13.0" pino: "npm:^9.5.0" solarwinds-apm: "workspace:^" @@ -1681,7 +1688,7 @@ __metadata: "@prisma/instrumentation": "npm:^5.21.1" "@types/node": "npm:^18.19.0" "@types/react": "npm:^18.3.11" - eslint: "npm:^8.57.0" + eslint: "npm:^8.57.1" eslint-config-next: "npm:^14.2.15" next: "npm:^14.2.15" prisma: "npm:^5.21.1" @@ -2359,9 +2366,9 @@ __metadata: languageName: node linkType: hard -"ajv-formats@npm:^2.1.1": - version: 2.1.1 - resolution: "ajv-formats@npm:2.1.1" +"ajv-formats@npm:^3.0.1": + version: 3.0.1 + resolution: "ajv-formats@npm:3.0.1" dependencies: ajv: "npm:^8.0.0" peerDependencies: @@ -2369,7 +2376,7 @@ __metadata: peerDependenciesMeta: ajv: optional: true - checksum: 10c0/e43ba22e91b6a48d96224b83d260d3a3a561b42d391f8d3c6d2c1559f9aa5b253bfb306bc94bbeca1d967c014e15a6efe9a207309e95b3eaae07fcbcdc2af662 + checksum: 10c0/168d6bca1ea9f163b41c8147bae537e67bd963357a5488a1eaf3abe8baa8eec806d4e45f15b10767e6020679315c7e1e5e6803088dfb84efa2b4e9353b83dd0a languageName: node linkType: hard @@ -2385,15 +2392,15 @@ __metadata: languageName: node linkType: hard -"ajv@npm:^8.0.0, ajv@npm:^8.10.0, ajv@npm:^8.11.0": - version: 8.12.0 - resolution: "ajv@npm:8.12.0" +"ajv@npm:^8.0.0, ajv@npm:^8.12.0": + version: 8.17.1 + resolution: "ajv@npm:8.17.1" dependencies: - fast-deep-equal: "npm:^3.1.1" + fast-deep-equal: "npm:^3.1.3" + fast-uri: "npm:^3.0.1" json-schema-traverse: "npm:^1.0.0" require-from-string: "npm:^2.0.2" - uri-js: "npm:^4.2.2" - checksum: 10c0/ac4f72adf727ee425e049bc9d8b31d4a57e1c90da8d28bcd23d60781b12fcd6fc3d68db5df16994c57b78b94eed7988f5a6b482fd376dc5b084125e20a0a622e + checksum: 10c0/ec3ba10a573c6b60f94639ffc53526275917a2df6810e4ab5a6b959d87459f9ef3f00d5e7865b82677cb7d21590355b34da14d1d0b9c32d75f95a187e76fff35 languageName: node linkType: hard @@ -2474,13 +2481,6 @@ __metadata: languageName: node linkType: hard -"archy@npm:^1.0.0": - version: 1.0.0 - resolution: "archy@npm:1.0.0" - checksum: 10c0/200c849dd1c304ea9914827b0555e7e1e90982302d574153e28637db1a663c53de62bad96df42d50e8ce7fc18d05e3437d9aa8c4b383803763755f0956c7d308 - languageName: node - linkType: hard - "arg@npm:^4.1.0": version: 4.1.3 resolution: "arg@npm:4.1.3" @@ -2691,15 +2691,13 @@ __metadata: languageName: node linkType: hard -"avvio@npm:^8.3.0": - version: 8.3.0 - resolution: "avvio@npm:8.3.0" +"avvio@npm:^9.0.0": + version: 9.1.0 + resolution: "avvio@npm:9.1.0" dependencies: - "@fastify/error": "npm:^3.3.0" - archy: "npm:^1.0.0" - debug: "npm:^4.0.0" + "@fastify/error": "npm:^4.0.0" fastq: "npm:^1.17.1" - checksum: 10c0/ae171bd977302c3720c9cab8a8e1acedba34d23d44fa4f2914953b02c34c81bd332b4f5713912ce9405c4eb5317fdc6e794b0134d3f680f28858d7a0efadfbc6 + checksum: 10c0/bdc294a7e8f38e1e21f9d338d97d7240025db54f1005fc419cfe0499a35edf2276ab1fe91135739faa3a9437358ec6912d5a56f23361b061880333cb4f1c7884 languageName: node linkType: hard @@ -3247,10 +3245,10 @@ __metadata: languageName: node linkType: hard -"cookie@npm:^0.6.0": - version: 0.6.0 - resolution: "cookie@npm:0.6.0" - checksum: 10c0/f2318b31af7a31b4ddb4a678d024514df5e705f9be5909a192d7f116cfb6d45cbacf96a473fa733faa95050e7cff26e7832bb3ef94751592f1387b71c8956686 +"cookie@npm:^0.7.0": + version: 0.7.2 + resolution: "cookie@npm:0.7.2" + checksum: 10c0/9596e8ccdbf1a3a88ae02cf5ee80c1c50959423e1022e4e60b91dd87c622af1da309253d8abdb258fb5e3eacb4f08e579dc58b4897b8087574eee0fd35dfa5d2 languageName: node linkType: hard @@ -3314,7 +3312,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.4, debug@npm:^4.3.5": +"debug@npm:4, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.4, debug@npm:^4.3.5": version: 4.3.5 resolution: "debug@npm:4.3.5" dependencies: @@ -3949,15 +3947,15 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^8.57.0": - version: 8.57.0 - resolution: "eslint@npm:8.57.0" +"eslint@npm:^8.57.1": + version: 8.57.1 + resolution: "eslint@npm:8.57.1" dependencies: "@eslint-community/eslint-utils": "npm:^4.2.0" "@eslint-community/regexpp": "npm:^4.6.1" "@eslint/eslintrc": "npm:^2.1.4" - "@eslint/js": "npm:8.57.0" - "@humanwhocodes/config-array": "npm:^0.11.14" + "@eslint/js": "npm:8.57.1" + "@humanwhocodes/config-array": "npm:^0.13.0" "@humanwhocodes/module-importer": "npm:^1.0.1" "@nodelib/fs.walk": "npm:^1.2.8" "@ungap/structured-clone": "npm:^1.2.0" @@ -3993,7 +3991,7 @@ __metadata: text-table: "npm:^0.2.0" bin: eslint: bin/eslint.js - checksum: 10c0/00bb96fd2471039a312435a6776fe1fd557c056755eaa2b96093ef3a8508c92c8775d5f754768be6b1dddd09fdd3379ddb231eeb9b6c579ee17ea7d68000a529 + checksum: 10c0/1fd31533086c1b72f86770a4d9d7058ee8b4643fd1cfd10c7aac1ecb8725698e88352a87805cf4b2ce890aa35947df4b4da9655fb7fdfa60dbb448a43f6ebcf1 languageName: node linkType: hard @@ -4185,13 +4183,6 @@ __metadata: languageName: node linkType: hard -"fast-content-type-parse@npm:^1.1.0": - version: 1.1.0 - resolution: "fast-content-type-parse@npm:1.1.0" - checksum: 10c0/882bf990fa5d64be1825ce183818db43900ece0d7ef184cb9409bae8ed1001acbe536a657b1496382cb3e308e71ab39cc399bbdae70cba1745eecaeca4e55384 - languageName: node - linkType: hard - "fast-decode-uri-component@npm:^1.0.1": version: 1.0.1 resolution: "fast-decode-uri-component@npm:1.0.1" @@ -4233,18 +4224,18 @@ __metadata: languageName: node linkType: hard -"fast-json-stringify@npm:^5.7.0, fast-json-stringify@npm:^5.8.0": - version: 5.12.0 - resolution: "fast-json-stringify@npm:5.12.0" +"fast-json-stringify@npm:^6.0.0": + version: 6.0.0 + resolution: "fast-json-stringify@npm:6.0.0" dependencies: - "@fastify/merge-json-schemas": "npm:^0.1.0" - ajv: "npm:^8.10.0" - ajv-formats: "npm:^2.1.1" + "@fastify/merge-json-schemas": "npm:^0.1.1" + ajv: "npm:^8.12.0" + ajv-formats: "npm:^3.0.1" fast-deep-equal: "npm:^3.1.3" - fast-uri: "npm:^2.1.0" + fast-uri: "npm:^2.3.0" json-schema-ref-resolver: "npm:^1.0.1" rfdc: "npm:^1.2.0" - checksum: 10c0/5d6ecb4326acddfd0247cd65901f5584ffc2ed821b47e85cf3aa66474b5bb0f5cf2617e947f9b66fd0baf93caaee7c039952993dc1eda9f72d4920713a36a182 + checksum: 10c0/590bbb284df45972822773ebc41c8592c412cc8c2d123d43a41579c9972ff8004d1aea7d0c7cffaebf246ee28be964d605ad9d52bb96c26d8dc5fa4e225c1998 languageName: node linkType: hard @@ -4271,41 +4262,47 @@ __metadata: languageName: node linkType: hard -"fast-uri@npm:^2.0.0, fast-uri@npm:^2.1.0": - version: 2.3.0 - resolution: "fast-uri@npm:2.3.0" - checksum: 10c0/72844622c8b9d92dbb783723628d1069c999b31bfaa74af9e9afae0e0c22faf18c988a0ce55e775dce4c404f4cca75fa43e1f0ab07075342cff99796f4920945 +"fast-uri@npm:^2.3.0": + version: 2.4.0 + resolution: "fast-uri@npm:2.4.0" + checksum: 10c0/300453cfe2f7d5ec16be0f2c8dc5b280edbaca59440b2deb4ab56ac0f584637179e9ee7539d0b70ef0fce9608245ebfa75307c84fa4829b1065c3b7ef7dcf706 languageName: node linkType: hard -"fastify-plugin@npm:^4.0.0": - version: 4.5.1 - resolution: "fastify-plugin@npm:4.5.1" - checksum: 10c0/f58f79cd9d3c88fd7f79a3270276c6339fc57bbe72ef14d20b73779193c404e317ac18e8eae2c5071b3909ebee45d7eb6871da4e65464ac64ed0d9746b4e9b9f +"fast-uri@npm:^3.0.0, fast-uri@npm:^3.0.1": + version: 3.0.3 + resolution: "fast-uri@npm:3.0.3" + checksum: 10c0/4b2c5ce681a062425eae4f15cdc8fc151fd310b2f69b1f96680677820a8b49c3cd6e80661a406e19d50f0c40a3f8bffdd458791baf66f4a879d80be28e10a320 languageName: node linkType: hard -"fastify@npm:^4.28.1": - version: 4.28.1 - resolution: "fastify@npm:4.28.1" +"fastify-plugin@npm:^5.0.0": + version: 5.0.1 + resolution: "fastify-plugin@npm:5.0.1" + checksum: 10c0/c5e5932e7b8c5713ff881adeade3e8ee8fc288e8249d79cd193a2a2438eef1ad58ae5814f12835acbf04025dbddf2628787cd845f3e550dee847f494a08f7c5b + languageName: node + linkType: hard + +"fastify@npm:^5.0.0": + version: 5.0.0 + resolution: "fastify@npm:5.0.0" dependencies: - "@fastify/ajv-compiler": "npm:^3.5.0" - "@fastify/error": "npm:^3.4.0" - "@fastify/fast-json-stringify-compiler": "npm:^4.3.0" + "@fastify/ajv-compiler": "npm:^4.0.0" + "@fastify/error": "npm:^4.0.0" + "@fastify/fast-json-stringify-compiler": "npm:^5.0.0" abstract-logging: "npm:^2.0.1" - avvio: "npm:^8.3.0" - fast-content-type-parse: "npm:^1.1.0" - fast-json-stringify: "npm:^5.8.0" - find-my-way: "npm:^8.0.0" - light-my-request: "npm:^5.11.0" + avvio: "npm:^9.0.0" + fast-json-stringify: "npm:^6.0.0" + find-my-way: "npm:^9.0.0" + light-my-request: "npm:^6.0.0" pino: "npm:^9.0.0" - process-warning: "npm:^3.0.0" + process-warning: "npm:^4.0.0" proxy-addr: "npm:^2.0.7" - rfdc: "npm:^1.3.0" + rfdc: "npm:^1.3.1" secure-json-parse: "npm:^2.7.0" - semver: "npm:^7.5.4" - toad-cache: "npm:^3.3.0" - checksum: 10c0/9c212e9a72c42a27ebc9b0bc7fda8f94ff208250158093374942b0e156a3f55fa848c926921f99bdf7f38f6f8103ac28ecc72cc507f33893cd121ce4f3eda069 + semver: "npm:^7.6.0" + toad-cache: "npm:^3.7.0" + checksum: 10c0/566e0948f7fd40c74e847d8bdcd320abd9d086e82020fd1fdd6a95f5b8bdf8d8c793873f6232893361afebe6e62d1687218860097cc3c502c403b15f93f3ce07 languageName: node linkType: hard @@ -4367,14 +4364,14 @@ __metadata: languageName: node linkType: hard -"find-my-way@npm:^8.0.0": - version: 8.1.0 - resolution: "find-my-way@npm:8.1.0" +"find-my-way@npm:^9.0.0": + version: 9.1.0 + resolution: "find-my-way@npm:9.1.0" dependencies: fast-deep-equal: "npm:^3.1.3" fast-querystring: "npm:^1.0.0" - safe-regex2: "npm:^2.0.0" - checksum: 10c0/f0f6a01953e4bc1789fdae1e861b0a0b1cb930f0c9c8c03e21fc27664a0cb50c22a56218e7b3738791aa6a01a452f73ee5a02063837fcab96988c3c63dcb8e43 + safe-regex2: "npm:^4.0.0" + checksum: 10c0/ddde633673b512940f8d183c8684f1441d623464364f931af979a71baa0cb5b774ed574a80eaddba40fc605c7d35bc1c74c9469732eaf381a1c4a3e59611686f languageName: node linkType: hard @@ -5538,14 +5535,14 @@ __metadata: languageName: node linkType: hard -"light-my-request@npm:^5.11.0": - version: 5.11.1 - resolution: "light-my-request@npm:5.11.1" +"light-my-request@npm:^6.0.0": + version: 6.1.0 + resolution: "light-my-request@npm:6.1.0" dependencies: - cookie: "npm:^0.6.0" - process-warning: "npm:^2.0.0" - set-cookie-parser: "npm:^2.4.1" - checksum: 10c0/98f980f1de8a9d2ef195a3732fac9427368d3f926b7a08a88283c960d4e30e33ce1a1b8990a05a0f32150fe8ada3fd20d8fdcd5a27754737b6194f2570efb35f + cookie: "npm:^0.7.0" + process-warning: "npm:^4.0.0" + set-cookie-parser: "npm:^2.6.0" + checksum: 10c0/f5d4349eae32ec261e452b4ae56a0ac94507ccdbb51ff0fbdea55174ca12510108e1114ab9cbc5248be31bea04f5f27d2d4424f6d6809e16318e0509e8aeee5b languageName: node linkType: hard @@ -6744,20 +6741,6 @@ __metadata: languageName: node linkType: hard -"process-warning@npm:^2.0.0": - version: 2.3.2 - resolution: "process-warning@npm:2.3.2" - checksum: 10c0/6bccf187f604dd63067ae8b5a08f658d1cc5df4948a51525691a564ad9250575802c094dd5d1b69f015934fe5df6d925f2e607d7a589918069129b07a777aa7b - languageName: node - linkType: hard - -"process-warning@npm:^3.0.0": - version: 3.0.0 - resolution: "process-warning@npm:3.0.0" - checksum: 10c0/60f3c8ddee586f0706c1e6cb5aa9c86df05774b9330d792d7c8851cf0031afd759d665404d07037e0b4901b55c44a423f07bdc465c63de07d8d23196bb403622 - languageName: node - linkType: hard - "process-warning@npm:^4.0.0": version: 4.0.0 resolution: "process-warning@npm:4.0.0" @@ -7147,10 +7130,10 @@ __metadata: languageName: node linkType: hard -"ret@npm:~0.2.0": - version: 0.2.2 - resolution: "ret@npm:0.2.2" - checksum: 10c0/1a41e543913cda851abb1dae4852efa97bb693ce58fde3b51cc1cae94e2599dd70b91ad6268a4a07fc238305be06fed91723ef6d08863c48a0d02e0a74b943cd +"ret@npm:~0.5.0": + version: 0.5.0 + resolution: "ret@npm:0.5.0" + checksum: 10c0/220868b194f87bf1998e32e409086eec6b39e860c052bf267f8ad4d0131706a9773d45fd3f91acfb1a7c928fce002b694ab86fdba90bc8d4b8df68fa8645c5cc languageName: node linkType: hard @@ -7168,10 +7151,10 @@ __metadata: languageName: node linkType: hard -"rfdc@npm:^1.2.0, rfdc@npm:^1.3.0": - version: 1.3.1 - resolution: "rfdc@npm:1.3.1" - checksum: 10c0/69f65e3ed30970f8055fac9fbbef9ce578800ca19554eab1dcbffe73a4b8aef536bc4248313889cf25e3b4e38b212c721eabe30856575bf2b2bc3d90f8ba93ef +"rfdc@npm:^1.2.0, rfdc@npm:^1.3.1": + version: 1.4.1 + resolution: "rfdc@npm:1.4.1" + checksum: 10c0/4614e4292356cafade0b6031527eea9bc90f2372a22c012313be1dcc69a3b90c7338158b414539be863fa95bfcb2ddcd0587be696841af4e6679d85e62c060c7 languageName: node linkType: hard @@ -7241,12 +7224,12 @@ __metadata: languageName: node linkType: hard -"safe-regex2@npm:^2.0.0": - version: 2.0.0 - resolution: "safe-regex2@npm:2.0.0" +"safe-regex2@npm:^4.0.0": + version: 4.0.0 + resolution: "safe-regex2@npm:4.0.0" dependencies: - ret: "npm:~0.2.0" - checksum: 10c0/f499e4fc69caafd7dd8023759e69a32991baa66e90bec5e2a7777b907943b27068dbff4e7a32cc8231f1354fcb779142f419e85498ae1e37384dc60619509c27 + ret: "npm:~0.5.0" + checksum: 10c0/faebf910036228868e83b4a33a84405b04e8e89f01283efe847e17e96b6b4658cc65c6560cef11de3bd5aef3b28b58dffac48744df67ca2ae46e073f668cb71d languageName: node linkType: hard @@ -7347,10 +7330,10 @@ __metadata: languageName: node linkType: hard -"set-cookie-parser@npm:^2.4.1": - version: 2.6.0 - resolution: "set-cookie-parser@npm:2.6.0" - checksum: 10c0/739da029f0e56806a103fcd5501d9c475e19e77bd8274192d7ae5c374ae714a82bba9a7ac00b0330a18227c5644b08df9e442240527be578f5a6030f9bb2bb80 +"set-cookie-parser@npm:^2.6.0": + version: 2.7.0 + resolution: "set-cookie-parser@npm:2.7.0" + checksum: 10c0/5ccb2d0389bda27631d57e44644319f0b77200e7c8bd1515824eb83dbd2d351864a29581f7e7f977a5aeb83c3ec9976e69b706a80ac654152fd26353011ffef4 languageName: node linkType: hard @@ -7870,7 +7853,7 @@ __metadata: languageName: node linkType: hard -"toad-cache@npm:^3.3.0": +"toad-cache@npm:^3.7.0": version: 3.7.0 resolution: "toad-cache@npm:3.7.0" checksum: 10c0/7dae2782ee20b22c9798bb8b71dec7ec6a0091021d2ea9dd6e8afccab6b65b358fdba49a02209fac574499702e2c000660721516c87c2538d1b2c0ba03e8c0c3 From b104af0549609c9d18eb86835711a631d16b3f55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Th=C3=A9riault?= Date: Fri, 18 Oct 2024 16:38:20 -0400 Subject: [PATCH 07/15] test on windows and macos --- .github/workflows/checks.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 1227cf03..aaad8561 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -6,7 +6,13 @@ on: jobs: checks: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-latest + - windows-latest + - macos-latest steps: - uses: actions/checkout@v4 with: @@ -46,7 +52,7 @@ jobs: # we can force it to be the root of the repo by including an empty file present at the root # see https://github.com/actions/upload-artifact#upload-using-multiple-paths-and-exclusions - run: touch .root - - if: github.event_name == 'pull_request' + - if: matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request' uses: actions/upload-artifact@v4 with: name: build From 8f91c11caa55112c0b0289b8817cb4e02d89c998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Th=C3=A9riault?= Date: Fri, 18 Oct 2024 16:44:33 -0400 Subject: [PATCH 08/15] just test on windows actually --- .github/workflows/checks.yml | 43 +++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index aaad8561..7eac8690 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -6,13 +6,7 @@ on: jobs: checks: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: - - ubuntu-latest - - windows-latest - - macos-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: @@ -52,7 +46,7 @@ jobs: # we can force it to be the root of the repo by including an empty file present at the root # see https://github.com/actions/upload-artifact#upload-using-multiple-paths-and-exclusions - run: touch .root - - if: matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request' + - if: github.event_name == 'pull_request' uses: actions/upload-artifact@v4 with: name: build @@ -88,7 +82,7 @@ jobs: - run: yarn version check - tests: + linux: if: github.event_name == 'pull_request' needs: - checks @@ -135,7 +129,36 @@ jobs: - uses: actions/checkout@v4 with: lfs: true - submodules: true + - uses: actions/download-artifact@v4 + with: + name: build + path: ./ + + - uses: actions/cache@v4 + with: + path: .yarn/cache + key: yarn-${{ hashFiles('yarn.lock') }} + restore-keys: | + yarn- + + - run: yarn install --immutable + - run: yarn test --only + env: + SW_APM_COLLECTOR: ${{ secrets.SW_APM_COLLECTOR }} + SW_APM_SERVICE_KEY: ${{ secrets.SW_APM_SERVICE_KEY }} + + windows: + if: github.event_name == 'pull_request' + needs: + - checks + runs-on: windows-latest + env: + YARN_IGNORE_NODE: 1 + + steps: + - uses: actions/checkout@v4 + with: + lfs: true - uses: actions/download-artifact@v4 with: name: build From c2198f8d2ff363fedf588831449c0790edeb0f8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Th=C3=A9riault?= Date: Fri, 18 Oct 2024 16:53:48 -0400 Subject: [PATCH 09/15] fix sampler test --- packages/solarwinds-apm/test/sampling/grpc.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/solarwinds-apm/test/sampling/grpc.test.ts b/packages/solarwinds-apm/test/sampling/grpc.test.ts index 79ae16f1..3ae96705 100644 --- a/packages/solarwinds-apm/test/sampling/grpc.test.ts +++ b/packages/solarwinds-apm/test/sampling/grpc.test.ts @@ -46,7 +46,7 @@ describe("GrpcSampler", () => { before(async () => { const config = { collector: COLLECTOR, - token, + serviceKey: { token }, serviceName, } as unknown as Configuration @@ -78,7 +78,7 @@ describe("GrpcSampler", () => { before(async () => { const config = { collector: COLLECTOR, - token: "woops", + serviceKey: { token: "woops" }, serviceName, } as unknown as Configuration @@ -104,7 +104,7 @@ describe("GrpcSampler", () => { before(async () => { const config = { collector: "woops", - token, + serviceKey: { token }, serviceName, } as unknown as Configuration From 6390732e0b063736c6d644d4f5a11a31aceb9d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Th=C3=A9riault?= Date: Fri, 18 Oct 2024 17:07:42 -0400 Subject: [PATCH 10/15] misc fixes --- examples/next-prisma/next.config.js | 2 +- examples/next-prisma/package.json | 2 +- lambda/package.json | 2 +- package.json | 2 +- packages/module/package.json | 1 + yarn.lock | 4 ++-- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/next-prisma/next.config.js b/examples/next-prisma/next.config.js index a934eb9e..ef098993 100644 --- a/examples/next-prisma/next.config.js +++ b/examples/next-prisma/next.config.js @@ -8,7 +8,7 @@ module.exports = { // it is not necessary to include in your own config webpack: (config) => { config.externals.push({ - "solarwinds-apm": "commonjs solarwinds-apm", + "solarwinds-apm": "module solarwinds-apm", }) return config }, diff --git a/examples/next-prisma/package.json b/examples/next-prisma/package.json index 08b12d9c..02d6f363 100644 --- a/examples/next-prisma/package.json +++ b/examples/next-prisma/package.json @@ -2,7 +2,7 @@ "name": "@solarwinds-apm/example-next-prisma", "private": true, "scripts": { - "build:skip": "prisma generate && prisma migrate deploy && next build", + "build": "prisma generate && prisma migrate deploy && next build", "lint": "next lint", "start": "prisma generate && prisma migrate deploy && next start" }, diff --git a/lambda/package.json b/lambda/package.json index c8cc188f..7a3f7d48 100644 --- a/lambda/package.json +++ b/lambda/package.json @@ -1,7 +1,7 @@ { "name": "@solarwinds-apm/lambda-shim", "private": true, - "packageManager": "yarn@4.1.1", + "packageManager": "yarn@4.5.1", "dependencies": { "{{name}}": "{{version}}", "@opentelemetry/api": "{{api-version}}", diff --git a/package.json b/package.json index 40b1f1c2..d97baf54 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@solarwinds-apm/solarwinds-apm", "private": true, "license": "Apache-2.0", - "packageManager": "yarn@4.3.0", + "packageManager": "yarn@4.5.1", "workspaces": [ "examples", "examples/*", diff --git a/packages/module/package.json b/packages/module/package.json index db69d8e5..905c15f4 100644 --- a/packages/module/package.json +++ b/packages/module/package.json @@ -19,6 +19,7 @@ "import": "./dist/index.js" } }, + "main": "./dist/index.js", "files": [ "./src/", "./dist/" diff --git a/yarn.lock b/yarn.lock index a9a5eed5..37cf8b10 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8137,11 +8137,11 @@ __metadata: "typescript@patch:typescript@npm%3A~5.6.3#optional!builtin": version: 5.6.3 - resolution: "typescript@patch:typescript@npm%3A5.6.3#optional!builtin::version=5.6.3&hash=b45daf" + resolution: "typescript@patch:typescript@npm%3A5.6.3#optional!builtin::version=5.6.3&hash=8c6c40" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/ac8307bb06bbfd08ae7137da740769b7d8c3ee5943188743bb622c621f8ad61d244767480f90fbd840277fbf152d8932aa20c33f867dea1bb5e79b187ca1a92f + checksum: 10c0/7c9d2e07c81226d60435939618c91ec2ff0b75fbfa106eec3430f0fcf93a584bc6c73176676f532d78c3594fe28a54b36eb40b3d75593071a7ec91301533ace7 languageName: node linkType: hard From 95a27ec073acef8b05d58673fe07182552ac69f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Th=C3=A9riault?= Date: Fri, 18 Oct 2024 17:13:49 -0400 Subject: [PATCH 11/15] cache generated version file --- .github/workflows/checks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 7eac8690..6aef5321 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -53,6 +53,7 @@ jobs: path: | .root packages/**/dist/ + packages/solarwinds-apm/src/version.ts packages/bindings/npm/*/*.node packages/bindings/npm/*/liboboe.so retention-days: 1 From ba43fc72aca9a8f70dab5e0b2bee0b0e4790b879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Th=C3=A9riault?= Date: Fri, 18 Oct 2024 17:19:36 -0400 Subject: [PATCH 12/15] fix windows tests --- .github/workflows/checks.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 6aef5321..82ad8c76 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -153,6 +153,12 @@ jobs: needs: - checks runs-on: windows-latest + strategy: + matrix: + node: + - 18 + - 20 + - 22 env: YARN_IGNORE_NODE: 1 @@ -164,6 +170,10 @@ jobs: with: name: build path: ./ + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - run: corepack enable - uses: actions/cache@v4 with: From 143b75d59f6874cb7b3c8e532dd4dde69b541325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Th=C3=A9riault?= Date: Fri, 18 Oct 2024 20:03:06 -0400 Subject: [PATCH 13/15] fix windows i think --- packages/test/src/bin.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/test/src/bin.ts b/packages/test/src/bin.ts index b8559f5f..d5462b78 100644 --- a/packages/test/src/bin.ts +++ b/packages/test/src/bin.ts @@ -95,7 +95,11 @@ argv = [ ] const envs = [] -for (let dir = process.cwd(); dir !== "/"; dir = path.dirname(dir)) { +for ( + let dir = process.cwd(); + dir !== path.dirname(dir); + dir = path.dirname(dir) +) { envs.push(`${dir}/.env`) } dotenv.configDotenv({ path: envs }) From b3ed2b570fc1b64be3698fb3c019583583e33537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Th=C3=A9riault?= Date: Fri, 18 Oct 2024 20:15:31 -0400 Subject: [PATCH 14/15] use pathToFileURL --- packages/module/src/index.ts | 4 ++-- packages/solarwinds-apm/src/config.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/module/src/index.ts b/packages/module/src/index.ts index 600773f8..53f54220 100644 --- a/packages/module/src/index.ts +++ b/packages/module/src/index.ts @@ -16,8 +16,8 @@ limitations under the License. import { env } from "node:process" -export async function load(file: string): Promise { - const imported = (await import(file)) as object +export async function load(url: string): Promise { + const imported = (await import(url)) as object const hasDefault = "default" in imported const keyCount = Object.keys(imported).length diff --git a/packages/solarwinds-apm/src/config.ts b/packages/solarwinds-apm/src/config.ts index 20bbfbfc..5326c29b 100644 --- a/packages/solarwinds-apm/src/config.ts +++ b/packages/solarwinds-apm/src/config.ts @@ -17,6 +17,7 @@ limitations under the License. import * as fs from "node:fs/promises" import * as path from "node:path" import * as process from "node:process" +import { pathToFileURL } from "node:url" import { DiagLogLevel } from "@opentelemetry/api" import { getEnvWithoutDefaults } from "@opentelemetry/core" @@ -233,7 +234,7 @@ export async function read(): Promise { const read: unknown = path.extname(option) === ".json" ? JSON.parse(await fs.readFile(option, { encoding: "utf-8" })) - : await load(option) + : await load(pathToFileURL(option).href) if (typeof read !== "object" || read === null) { throw new Error(`Expected config object, got ${typeof read}.`) From 9b5c5f754215bbb6f566022dc5731bf2b4cb9d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Th=C3=A9riault?= Date: Fri, 18 Oct 2024 20:26:25 -0400 Subject: [PATCH 15/15] improve flaky test --- .github/workflows/checks.yml | 1 + packages/sampling/test/token-bucket.test.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 82ad8c76..761f18e8 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -159,6 +159,7 @@ jobs: - 18 - 20 - 22 + fail-fast: false env: YARN_IGNORE_NODE: 1 diff --git a/packages/sampling/test/token-bucket.test.ts b/packages/sampling/test/token-bucket.test.ts index f4e22f36..8c00d2ea 100644 --- a/packages/sampling/test/token-bucket.test.ts +++ b/packages/sampling/test/token-bucket.test.ts @@ -72,7 +72,7 @@ describe("TokenBucket", () => { bucket.start() bucket.update({ rate: 2, interval: 5 }) - await setTimeout(50) + await setTimeout(100) bucket.stop() expect(bucket.consume(8)).to.be.true })