diff --git a/.ci/Makefile b/.ci/Makefile index ea871d2c53..f941dc8bf7 100644 --- a/.ci/Makefile +++ b/.ci/Makefile @@ -97,12 +97,7 @@ create-arn-file: validate-release-notes-url @RELEASE_NOTES_URL=$(RELEASE_NOTES_URL) ./scripts/create-arn-table.sh github-release: validate-ref-name - @gh release list - @gh \ - release \ - create $(GITHUB_REF_NAME) \ - --title '$(GITHUB_REF_NAME)' \ - --notes-file $(AWS_FOLDER)/$(SUFFIX_ARN_FILE) + ../dev-utils/github-release.sh "$(GITHUB_REF_NAME)" "$(AWS_FOLDER)/$(SUFFIX_ARN_FILE)" validate-version: ifndef AGENT_VERSION diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d92d4195ee..d4eac639ff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,7 +69,7 @@ jobs: - name: npm publish run: |- echo "//registry.npmjs.org/:_authToken=${{ env.NPMJS_TOKEN }}" > .npmrc - npm publish --otp=${{ env.TOTP_CODE }} + npm publish --tag="latest-3" --otp=${{ env.TOTP_CODE }} - if: always() uses: elastic/apm-pipeline-library/.github/actions/notify-build-status@current diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f072156206..29c11fbd3b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ on: workflow_dispatch: push: branches: - - main + - 3.x paths-ignore: - '**/*.md' - '**/*.asciidoc' @@ -13,7 +13,7 @@ on: - 'examples/**' pull_request: branches: - - main + - 3.x paths-ignore: - '**/*.md' - '**/*.asciidoc' diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index d581ec255e..8e38b2b3cf 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -31,8 +31,14 @@ Notes: [[release-notes-3.x]] === Node.js Agent version 3.x -[float] -===== Breaking changes +NOTE: "3.x" releases are now maintenance releases. +See https://www.elastic.co/guide/en/apm/agent/nodejs/current/release-notes-4.x.html[the 4.x release notes] +for the latest (4.x) releases. The 3.x branch will be maintained until +2024-03-07 (6 months after the 4.0.0 release). + + +[[release-notes-3.50.0]] +==== 3.50.0 - 2023/09/07 [float] ===== Features diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 62f0c68a79..6ee1dff27e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -218,7 +218,6 @@ A release involves the following published artifacts: If this is a new major release, then: - [Create an issue](https://github.com/elastic/website-requests/issues/new) to request an update of the [EOL table](https://www.elastic.co/support/eol). -- Update the "Active release branches" section of the main README. +- Update the "Active release branches" section of the main "README.md". - Update the "release.yml" for the new "N.x" *maintenance* branch as follows: - The `npm publish ...` call must include a `--tag=latest-` option. - - The `gh release create ...` call must include a `--latest=false` option. diff --git a/README.md b/README.md index 1bd68d3de9..0c6815dc89 100644 --- a/README.md +++ b/README.md @@ -28,23 +28,23 @@ Server (which receives APM data from the APM agent running in your application), Elasticsearch (the database that stores all APM data), and Kibana (the application that provides the interface to visualize and analyze the data). If you do not already have an Elastic deployment to use, follow [this APM Quick -Start guide](https://www.elastic.co/guide/en/apm/guide/current/apm-quick-start.html) +Start guide](https://www.elastic.co/guide/en/apm/guide/3.x/apm-quick-start.html) to create a free trial on Elastic's cloud. From this deployment you will need the APM **`serverUrl`** and **`secretToken`** (or a configured `apiKey`) to use for configuring the APM agent. Next, the best and easiest way to see how to install and start the APM agent is to follow -[one of the "Get started" guides](https://www.elastic.co/guide/en/apm/agent/nodejs/current/set-up.html) +[one of the "Get started" guides](https://www.elastic.co/guide/en/apm/agent/nodejs/3.x/set-up.html) for the web framework or technology that you are using: -- [Get started with Express](https://www.elastic.co/guide/en/apm/agent/nodejs/current/express.html) -- [Get started with Fastify](https://www.elastic.co/guide/en/apm/agent/nodejs/current/fastify.html) -- [Get started with Koa](https://www.elastic.co/guide/en/apm/agent/nodejs/current/koa.html) -- [Get started with hapi](https://www.elastic.co/guide/en/apm/agent/nodejs/current/hapi.html) -- [Get started with Restify](https://www.elastic.co/guide/en/apm/agent/nodejs/current/restify.html) -- [Get started with AWS Lambda](https://www.elastic.co/guide/en/apm/agent/nodejs/current/lambda.html) -- [Get started with Azure Functions](https://www.elastic.co/guide/en/apm/agent/nodejs/current/azure-functions.html) -- [Get started with TypeScript](https://www.elastic.co/guide/en/apm/agent/nodejs/current/typescript.html) +- [Get started with Express](https://www.elastic.co/guide/en/apm/agent/nodejs/3.x/express.html) +- [Get started with Fastify](https://www.elastic.co/guide/en/apm/agent/nodejs/3.x/fastify.html) +- [Get started with Koa](https://www.elastic.co/guide/en/apm/agent/nodejs/3.x/koa.html) +- [Get started with hapi](https://www.elastic.co/guide/en/apm/agent/nodejs/3.x/hapi.html) +- [Get started with Restify](https://www.elastic.co/guide/en/apm/agent/nodejs/3.x/restify.html) +- [Get started with AWS Lambda](https://www.elastic.co/guide/en/apm/agent/nodejs/3.x/lambda.html) +- [Get started with Azure Functions](https://www.elastic.co/guide/en/apm/agent/nodejs/3.x/azure-functions.html) +- [Get started with TypeScript](https://www.elastic.co/guide/en/apm/agent/nodejs/3.x/typescript.html) Typically, the quick start steps are: @@ -63,34 +63,35 @@ Typically, the quick start steps are: require('elastic-apm-node').start({ serverUrl: '', secretToken: '' - serviceName: '...', // https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuration.html#service-name - environment: '...', // https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuration.html#environment + serviceName: '...', // https://www.elastic.co/guide/en/apm/agent/nodejs/3.x/configuration.html#service-name + environment: '...', // https://www.elastic.co/guide/en/apm/agent/nodejs/3.x/configuration.html#environment }); ``` There are other ways to start the APM agent: for example, to support starting the APM agent without having to change application code; or to avoid certain surprises when using TypeScript or other transpilers like Babel or esbuild. See -[Starting the agent](https://www.elastic.co/guide/en/apm/agent/nodejs/current/starting-the-agent.html) +[Starting the agent](https://www.elastic.co/guide/en/apm/agent/nodejs/3.x/starting-the-agent.html) for a reference of all ways to start the agent and for details on gotchas with transpilers and bundlers (like Webpack and esbuild). -If your application is using ES modules, please see [ECMAScript module support](https://www.elastic.co/guide/en/apm/agent/nodejs/current/esm.html) +If your application is using ES modules, please see [ECMAScript module support](https://www.elastic.co/guide/en/apm/agent/nodejs/3.x/esm.html) for the current *experimental* support. ## Documentation -The full [Node.js APM agent documentation is here](https://www.elastic.co/guide/en/apm/agent/nodejs/current/intro.html). +The full [Node.js APM agent 3.x documentation is here](https://www.elastic.co/guide/en/apm/agent/nodejs/3.x/intro.html). Some important links: -- [Supported Technologies](https://www.elastic.co/guide/en/apm/agent/nodejs/current/supported-technologies.html) describes the supported Node.js versions, which modules (and version ranges) are automatically traced, and other technologies. -- [Configuring the agent](https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuring-the-agent.html) describes the different ways to configure the APM agent (via options to `apm.start(...)`, environment variables, or other mechanisms). -- [Configuration options](https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuration.html) is a full configuration reference. -- [Troubleshooting](https://www.elastic.co/guide/en/apm/agent/nodejs/current/troubleshooting.html) describes some common issues and a way to get debugging output from the APM agent for bug reports. -- [Upgrading](https://www.elastic.co/guide/en/apm/agent/nodejs/current/upgrading.html) includes a guide for upgrading from each past major version of the APM agent. -- [Metrics](https://www.elastic.co/guide/en/apm/agent/nodejs/current/metrics.html) describes the metrics that the APM agent automatically collects. -- The APM agent includes an [OpenTelemetry Bridge](https://www.elastic.co/guide/en/apm/agent/nodejs/current/opentelemetry-bridge.html) that allows one to use the vendor-agnostic OpenTelemetry API for manual instrumentation in your application, should you require manual instrumentation. +- [Release notes](https://www.elastic.co/guide/en/apm/agent/nodejs/3.x/release-notes.html) +- [Supported Technologies](https://www.elastic.co/guide/en/apm/agent/nodejs/3.x/supported-technologies.html) describes the supported Node.js versions, which modules (and version ranges) are automatically traced, and other technologies. +- [Configuring the agent](https://www.elastic.co/guide/en/apm/agent/nodejs/3.x/configuring-the-agent.html) describes the different ways to configure the APM agent (via options to `apm.start(...)`, environment variables, or other mechanisms). +- [Configuration options](https://www.elastic.co/guide/en/apm/agent/nodejs/3.x/configuration.html) is a full configuration reference. +- [Troubleshooting](https://www.elastic.co/guide/en/apm/agent/nodejs/3.x/troubleshooting.html) describes some common issues and a way to get debugging output from the APM agent for bug reports. +- [Upgrading](https://www.elastic.co/guide/en/apm/agent/nodejs/3.x/upgrading.html) includes a guide for upgrading from each past major version of the APM agent. +- [Metrics](https://www.elastic.co/guide/en/apm/agent/nodejs/3.x/metrics.html) describes the metrics that the APM agent automatically collects. +- The APM agent includes an [OpenTelemetry Bridge](https://www.elastic.co/guide/en/apm/agent/nodejs/3.x/opentelemetry-bridge.html) that allows one to use the vendor-agnostic OpenTelemetry API for manual instrumentation in your application, should you require manual instrumentation. ## Active release branches @@ -98,7 +99,7 @@ Some important links: The following git branches are active: - The ["main" branch](https://github.com/elastic/apm-agent-nodejs/tree/main) is being used for **4.x releases**. -- The ["3.x" branch](https://github.com/elastic/apm-agent-nodejs/tree/3.x) is being used for **3.x maintenance releases**. The 3.x line will be [supported for 6 months](https://www.elastic.co/support/eol) after the release of v4.0.0. +- The ["3.x" branch](https://github.com/elastic/apm-agent-nodejs/tree/3.x) is being used for **3.x maintenance releases**. The 3.x line will be [supported until 2024-03-07](https://www.elastic.co/support/eol) -- for 6 months after the release of v4.0.0. ## Contributing diff --git a/dev-utils/github-release.sh b/dev-utils/github-release.sh new file mode 100755 index 0000000000..3a7be560c5 --- /dev/null +++ b/dev-utils/github-release.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +# Create a GitHub release. If the given tag name is the *latest* version, and +# is not a pre-release, then the GH release will be marked as the latest. +# (This is typically only run from the release.yml CI workflow.) +# +# Usage: +# ./dev-utils/github-release.sh TAG_NAME RELEASE_NOTES_FILE +# Example: +# ./dev-utils/github-release.sh v3.49.1 ../build/aws/arn-file.md +# +# - For auth, this expects the 'GH_TOKEN' envvar to have been set. +# - The 'TAG_NAME' is typically from the 'GITHUB_REF_NAME' variable +# (https://docs.github.com/en/actions/learn-github-actions/variables) +# from a GitHub Actions workflow run. +# - The 'RELEASE_NOTES_FILE' is a path to an already built file to use as +# the release notes (using GitHub-flavored Markdown). + +set -euo pipefail + +readonly TAG_NAME="$1" +readonly RELEASE_NOTES_FILE="$2" + +echo "INFO: List current GitHub releases" +gh release list + +# The latest (by semver version ordering) git version tag, excluding pre-releases. +readonly LATEST_GIT_TAG=$(git tag --list --sort=version:refname "v*" | grep -v - | tail -n1) +if [[ "$TAG_NAME" == "$LATEST_GIT_TAG" ]]; then + IS_LATEST=true +else + IS_LATEST=false +fi + +echo "INFO: Create '$TAG_NAME' GitHub release (latest=$IS_LATEST)." +gh release create "$TAG_NAME" \ + --title "$TAG_NAME" \ + --notes-file "$RELEASE_NOTES_FILE" \ + --latest=$IS_LATEST diff --git a/package-lock.json b/package-lock.json index 0b797d6622..e43918e132 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "elastic-apm-node", - "version": "3.49.1", + "version": "3.50.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "elastic-apm-node", - "version": "3.49.1", + "version": "3.50.0", "license": "BSD-2-Clause", "dependencies": { "@elastic/ecs-pino-format": "^1.2.0", diff --git a/package.json b/package.json index 29a880dcf1..4d7cdbf4c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "elastic-apm-node", - "version": "3.49.1", + "version": "3.50.0", "description": "The official Elastic APM agent for Node.js", "main": "index.js", "types": "index.d.ts",