Skip to content

Commit

Permalink
prepare for 15.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael-theriault-swi committed Dec 2, 2024
1 parent 7f13936 commit 672ba77
Show file tree
Hide file tree
Showing 16 changed files with 85 additions and 47 deletions.
2 changes: 1 addition & 1 deletion examples/express-mysql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"start": "node --import solarwinds-apm index.js"
},
"dependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/api": "^1.9.0",
"express": "^4.21.1",
"mysql2": "^3.11.3",
"solarwinds-apm": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion examples/fastify-postgres/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"dependencies": {
"@fastify/postgres": "^6.0.1",
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/api": "^1.9.0",
"fastify": "^5.0.0",
"pg": "^8.13.0",
"pino": "^9.5.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/hello-distributed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"start": "concurrently \"node --import solarwinds-apm external.js\" \"node --import solarwinds-apm internal.js\""
},
"dependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/api": "^1.9.0",
"solarwinds-apm": "workspace:^"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/hello-manual/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"start": "node --import solarwinds-apm index.js"
},
"dependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/api": "^1.9.0",
"solarwinds-apm": "workspace:^"
}
}
2 changes: 1 addition & 1 deletion examples/hello/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"start": "node --import solarwinds-apm index.js"
},
"dependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/api": "^1.9.0",
"solarwinds-apm": "workspace:^"
}
}
2 changes: 1 addition & 1 deletion examples/next-prisma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "prisma generate && prisma migrate deploy && next start"
},
"dependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/api": "^1.9.0",
"@prisma/client": "^6.0.1",
"@prisma/instrumentation": "^5.21.1",
"next": "^14.2.15",
Expand Down
4 changes: 2 additions & 2 deletions packages/compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
"test": "swtest -p test/tsconfig.json -c src"
},
"peerDependencies": {
"@opentelemetry/api": "^1.3.0"
"@opentelemetry/api": "^1.9.0"
},
"peerDependenciesMeta": {
"@opentelemetry/api": {
"optional": false
}
},
"devDependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/semantic-conventions": "~1.28.0",
"@solarwinds-apm/eslint-config": "workspace:^",
"@solarwinds-apm/test": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion packages/histogram/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"scan": "node ../../scripts/scan.js"
},
"devDependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/sdk-metrics": "~1.28.0",
"@solarwinds-apm/eslint-config": "workspace:^",
"@types/node": "^18.19.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/instrumentations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@
"@solarwinds-apm/module": "workspace:^"
},
"peerDependencies": {
"@opentelemetry/api": "^1.3.0"
"@opentelemetry/api": "^1.9.0"
},
"peerDependenciesMeta": {
"@opentelemetry/api": {
"optional": false
}
},
"devDependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/api": "^1.9.0",
"@solarwinds-apm/eslint-config": "workspace:^",
"@solarwinds-apm/test": "workspace:^",
"@types/semver": "^7.5.8",
Expand Down
4 changes: 2 additions & 2 deletions packages/sampling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@
"@opentelemetry/sdk-trace-base": "~1.28.0"
},
"peerDependencies": {
"@opentelemetry/api": "^1.3.0"
"@opentelemetry/api": "^1.9.0"
},
"peerDependenciesMeta": {
"@opentelemetry/api": {
"optional": false
}
},
"devDependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/sdk-metrics": "~1.28.0",
"@solarwinds-apm/eslint-config": "workspace:^",
"@solarwinds-apm/test": "workspace:^",
Expand Down
40 changes: 38 additions & 2 deletions packages/solarwinds-apm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,51 @@
# [15.0.0](https://github.com/solarwinds/apm-js/releases/tag/v15.0.0)

## Breaking changes

- `@opentelemetry/api` dependency upgraded to `^1.9.0`.
- Removed support for initialisation via `--require` and `--loader` flags. The only supported initialisation method is now `--import`.
- Removed support for Node.js 16. The supported versions are now 18 (`^18.19.0`), 20 (`^20.8.0`), 22 and future LTS releases.
- `waitUntilReady` changed to return a promise.

## New features and improvements

- Added support for exporting logs.
- Added support for non-Linux platforms (Windows, macOS, etc).

## Internal changes

- Upgraded liboboe to `15.0.2`.
- Use OTLP as default export protocol.

# [14.1.0](https://github.com/solarwinds/apm-js/releases/tag/v14.1.0)

## New features and improvements

- Support ESM handlers in AWS Lambda.

## Fixes

- Do not insert invalid trace context in prepared PostgreSQL statements.
- Properly handle custom gauge metrics.

# [14.0.4](https://github.com/solarwinds/apm-js/releases/tag/v14.0.3)

## Fixes

- Update `import-in-the-middle` transitive dependency to fix ESM loader issues.

# [14.0.3](https://github.com/solarwinds/apm-js/releases/tag/v14.0.3)

## Fixes

- Properly support user-provided `@opentelemetry/api` in Lambda.

# [14.0.2](https://github.com/solarwinds/apm-js/releases/tag/v14.0.2)
# [14.0.0](https://github.com/solarwinds/apm-js/releases/tag/v14.0.0)

## Breaking changes

- This is a completely new version of the instrumentation library built upon OpenTelemetry.
- The library now requires the `@opentelemetry/api` package to be installed alongside it, with the version range `^1.3.0`.
- The library now requires the `@opentelemetry/api` package to be installed alongside it, with the version range `^1.9.0`.
- The public API surface of the library has been greatly reduced. The `@opentelemetry/api` package can instead be used for all custom instrumentation needs.
- The configuration file name has changed and some options have been renamed or altered. Check out [the configuration guide](./CONFIGURATION.md) for more details.
- The list of instrumented libraries has changed as the library now uses OpenTelemetry instrumentation. Custom instrumentations can now also be provided by the user. See [the updated list of bundled instrumentations](../instrumentations/COMPATIBILITY.md) for more details.
Expand Down
2 changes: 1 addition & 1 deletion packages/solarwinds-apm/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ All configuration options are optional except for the service key which is alway
When required, the package will look for the file in the current working directory under three possible formats, in the following order:

- `solarwinds.apm.config.ts` - TypeScript config, supports all options, requires a TypeScript loader such as `ts-node` or `tsx`
- `solarwinds.apm.config.js` - JavaScript config, supports all options, `.cjs` extension also accepted
- `solarwinds.apm.config.js` - JavaScript config, supports all options, `.cjs` and `.mjs` extensions also accepted
- `solarwinds.apm.config.json` - JSON config, doesn't support option settings such as functions or custom classes since only valid JSON syntax is accepted

It's also possible to use a custom name for the configuration file using the `SW_APM_CONFIG_FILE` environment variable. The file must have one of the three supported extensions or it will be ignored.
Expand Down
24 changes: 13 additions & 11 deletions packages/solarwinds-apm/README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
# solarwinds-apm

The new OpenTelemetry-based SolarWinds APM Node.js library. Currently supports Node.js 16 LTS, 18 LTS and 20.
The new OpenTelemetry-based SolarWinds APM Node.js library. Currently supports Node.js `^18.19.0`, `^20.8.0` and `22` or any later LTS release.

This library automatically instruments a wide set of frameworks and libraries, see the [Module Compatibility table](../instrumentations/COMPATIBILITY.md) for details.

## Installation and Setup

```sh
npm install --save "solarwinds-apm" "@opentelemetry/api@^1.3.0"
npm install --save "solarwinds-apm" "@opentelemetry/api@^1.9.0"
```

Install using your package manager then follow the [configuration guide](./CONFIGURATION.md). Make sure to install the matching version of `@opentelmetry/api` as it is required for the library to work. The two packages should be updated at the same time and kept in sync.

The library can then be initialised either from the command line or the environment. Depending on the Node version the `--loader solarwinds-apm/loader` (<`18.19.0` | <`20.6.0`) or `--import solarwinds-apm` (>=`18.19.0` | >=`20.6.0`) flag should be used.
The library can then be initialised either from the command line or the environment.

```sh
# <18.19.0 | <20.6.0
node --loader solarwinds-apm/loader script.js
# >=18.19.0 | >=20.6.0
node --import solarwinds-apm script.js
```

```sh
# <18.19.0 | <20.6.0
export NODE_OPTIONS="--loader solarwinds-apm/loader"
# >=18.19.0 | >=20.6.0
export NODE_OPTIONS="--import solarwinds-apm"

npm start
```

## Legacy mode

With the 15.0.0 release, major parts of the library were rewritten in pure JavaScript to replace the previously used native library. The new codebase makes it possible to run the library on platforms other than Linux, however it is not compatible with AppOptics and some niche features might be unimplemented. The legacy code can be turned back on manually by setting the `SW_APM_LEGACY` environment variable to `true`.

## Custom Instrumentation and Metrics

Unlike previous non-OpenTelemetry version, all manual instrumentation and metrics collection are handled through the OpenTelemetry API using the `@opentelemetry/api` packages. The [OpenTelemetry JS documentation](https://opentelemetry.io/docs/instrumentation/js/manual/) for manual instrumentation provides instructions (note that `solarwinds-apm` takes care of the initial registration of all components), and the [SDK docs](https://open-telemetry.github.io/opentelemetry-js/modules/_opentelemetry_api.html) are available to see all that the API provides.
Expand All @@ -46,7 +44,7 @@ import { waitUntilReady } from "solarwinds-apm"
const { waitUntilReady } = require("solarwinds-apm")

// wait up to 10 seconds
waitUntilReady(10_000)
await waitUntilReady(10_000)
```

## Custom Transaction Names
Expand All @@ -63,9 +61,13 @@ function calledFromWithinTransaction() {
}
```

## Migrating from 14.x.x

Any use of the `--require solarwinds-apm` or `--loader solarwinds-apm/loader` flags must be replaced by `--import solarwinds-apm`. The `waitUntilReady` function now returns a promise instead of blocking, which might require code which uses it to be refactored.

## Migrating from legacy versions

When migrating from older versions not built on top of OTel, `@opentelemetry/api@^1.3.0` must be added as an extra dependency. The config file will also need to be renamed and updated as some of the fields have changed, see the [configuration guide](./CONFIGURATION.md) for details. Manual instrumentation and metrics will also need to be migrated to use the OTel API, except for the `instrument` and `pInstrument` methods which are provided by the `@solarwinds-apm/compat` package to facilitate migrating.
When migrating from older versions not built on top of OTel, `@opentelemetry/api@^1.9.0` must be added as an extra dependency. The config file will also need to be renamed and updated as some of the fields have changed, see the [configuration guide](./CONFIGURATION.md) for details. Manual instrumentation and metrics will also need to be migrated to use the OTel API, except for the `instrument` and `pInstrument` methods which are provided by the `@solarwinds-apm/compat` package to facilitate migrating.

```diff
- const { instrument, pInstrument } = require("solarwinds-apm")
Expand Down
4 changes: 2 additions & 2 deletions packages/solarwinds-apm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@
"zod": "^3.23.8"
},
"peerDependencies": {
"@opentelemetry/api": "^1.3.0"
"@opentelemetry/api": "^1.9.0"
},
"peerDependenciesMeta": {
"@opentelemetry/api": {
"optional": false
}
},
"devDependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/api": "^1.9.0",
"@solarwinds-apm/eslint-config": "workspace:^",
"@solarwinds-apm/test": "workspace:^",
"@types/json-stringify-safe": "^5.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"ts-node": "^11.0.0-beta.1"
},
"devDependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/sdk-metrics": "~1.28.0",
"@opentelemetry/sdk-trace-base": "~1.28.0",
"@opentelemetry/sdk-trace-node": "~1.28.0",
Expand Down
Loading

0 comments on commit 672ba77

Please sign in to comment.