Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.x #3528

Merged
merged 43 commits into from
Sep 1, 2023
Merged

4.x #3528

merged 43 commits into from
Sep 1, 2023

Conversation

trentm
Copy link
Member

@trentm trentm commented Jul 31, 2023

This is a major version bump, primarily to move the min supported Node.js to v14.5.0 (from v8.6).

Prep checklist:

Ready to go steps/checklist (to be done in order):

  • update "3.x" to the current HEAD commit on "main"
  • merge the "dev/4.x" PR to main
  • Do a first pass attempt at updating deps. See tracking delayed dep updates because of old Node support #2760 for the full list. Minimally it would be nice to update async-cache and string-similarity to avoid the "deprecated" warnings on npm install elastic-apm-node.
  • (wait for Monday)
  • make a "4.0.0" release PR and publish 4.0.0
  • Do a "3.50.0" PR targetting the "3.x" branch. Be very sure to follow the "If this is a new major release, then:" steps in CONTRIBUTING.md -- the set --tag=latest-3 and --latest=false appropriately in the release steps. (Note: I want to do a 3.x release after the 4.0.0 release to see if the npm dist-tag stuff works properly. 4.0.0 should still be "latest" after this release.)
  • Open an issue on the robots to add branch protection for the "3.x" branch (because releases will be done from it now).

This is a start at a major version bump, primarily to move the min
supported Node.js to v14 (from v8.6).
@github-actions github-actions bot added the agent-nodejs Make available for APM Agents project planning. label Jul 31, 2023
trentm and others added 25 commits July 31, 2023 16:35
….0 (#3536)

This starts an "Upgrade to 4.x" guide.

Bumping the min Node.js to 14.5.0 means we will be able to rely on
AsyncLocalStorage support.

Closes: #2661
Refs: #3529
…t started (#3554)

This also removes `| null` from the retval type of `.startTransaction()`.

Co-authored-by: Trent Mick <trent.mick@elastic.co>
Closes: #2429
…3555)

This means no more 'elastic-apm-traceparent' header by default.

Co-authored-by: Trent Mick <trent.mick@elastic.co>
Closes: #3510
…xLength` usage (#3553)

Closes: #2121
Closes: #2314
Co-authored-by: Trent Mick <trent.mick@elastic.co>
By making it async now users can `await` it to make sure any 
OTel MeterProvider shutdown has completed.

Closes: #3222
Co-authored-by: Trent Mick <trent.mick@elastic.co>
The "patch" context manager was deprecated in v3.37.0 and it
was long obsolete before that.

Closes: #3529
This impacts using those properties directly on a Transaction,
some calling forms for apm.startTransaction(...), and
transaction.setType(...).

These properties were deprecated in v3.23.0.

Closes: #2357
trentm and others added 10 commits August 14, 2023 15:31
This doesn't change current behaviour, but makes the intent explicit.
…test v16

using >=v16.20.1 avoids an EBADENGINE warning from installing mongodb@6.0.0
@trentm
Copy link
Member Author

trentm commented Sep 1, 2023

Commit message:

feat!: the start of v4.x

Significant and breaking changes:
- Min supported Node.js is now 14.5.0 (up from 8.6).
- Drop support for the obsolete "patch" context manager, i.e. the
  `contextManager: "patch"` config option. This was a limited async context
  management that predated the preferred `AsyncLocalStorage` core Node.js
  mechanism for context tracking. (#3529)
- Config vars:
    - Remove `logUncaughtExceptions` config option, if the agent's
      `uncaughtException` handler is active it now *always* logs the error to
      the console. (#2412)
    - Remove `filterHttpHeaders` config option, see `sanitizeFieldNames`
      instead. (#3332)
    - Remove long deprecate `ELASTIC_APM_KUBERNETES_*` envvars, use
      `KUBERNETES_*` instead. (#2661)
    - The `useElasticTraceparentHeader` config option now defaults to `false`.
      This means the `elastic-apm-traceparent` HTTP header is now no longer
      sent by default. (#3555)
    - Drop erroneous `ELASTIC_SANITIZE_FIELD_NAMES` and
      `ELASTIC_IGNORE_MESSAGE_QUEUES` config envvars.
- Instrumentations:
    - Drop instrumentation for old `hapi`, the current `@hapi/hapi` is still
      instrumented. (#2691)
- APIs:
    - Ignore a `timer` option passed to `startTransaction()` and `startSpan()`
      APIs. (#2990)
    - Remove the deprecated `span.toString()` and `transaction.toString()` APIs.
      (#2348)
    - Change `apm.startTransaction()` API to return a noop transaction instead
      of null when the agent is not started. (#2429)
    - Remove `transaction.subtype` and `transaction.action` properties from the
      API. This also impacts <<apm-start-transaction>> and
      `transaction.setType(...)`, both of which now no longer accept `subtype`
      and `action` parameters. (#3557)

@trentm trentm marked this pull request as ready for review September 1, 2023 00:18
@trentm trentm requested a review from david-luna September 1, 2023 19:33
@@ -14,6 +14,7 @@ on:
pull_request:
branches:
- main
- dev/4.x
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you think it's necessary to add 3.x here to run tests when doing maintenance PRs for bug fixing and such?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, great point. I'll add that. And I guess we should remove dev/4.x before merging.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in commit 5ae4588.
(I'm not actually sure if instead we'll need this change to test.yml on the 3.x branch for it to be used for pushes and PR targetting 3.x. We shall see.)

@trentm
Copy link
Member Author

trentm commented Sep 1, 2023

  • update "3.x" to the current HEAD commit on "main"
% git branch -f 3.x main && git push origin 3.x
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
remote:
remote: GitHub found 3 vulnerabilities on elastic/apm-agent-nodejs's default branch (2 moderate, 1 low). To find out more, visit:
remote:      https://github.com/elastic/apm-agent-nodejs/security/dependabot
remote:
To github.com:elastic/apm-agent-nodejs.git
   f9f7ff21..7f8fd483  3.x -> 3.x

@trentm trentm merged commit c6cdaf9 into main Sep 1, 2023
@trentm trentm deleted the dev/4.x branch September 1, 2023 21:17
@trentm
Copy link
Member Author

trentm commented Sep 7, 2023

elastic/apm-aws-lambda#407 is required to get the elastic/apm-aws-lambda#402 fix on to the "8.9" branch, so that our apm-agent-nodejs 4.x docs build uses it. This will allow having a https://www.elastic.co/guide/en/apm/agent/nodejs/current/lambda.html doc page that uses the correct "latest version" Lambda layer, even if that is not the "latest in time" release (e.g. it'll point to a 4.0.0 release, even if there is a 3.50.0 release that comes later; or it'll point to 3.49.1 even if I do a later 4.0.0-rc.1 pre-release).

fpm-peter pushed a commit to fpm-git/apm-agent-nodejs that referenced this pull request Aug 20, 2024
feat!: the start of v4.x

Significant and breaking changes:
- Min supported Node.js is now 14.5.0 (up from 8.6).
- Drop support for the obsolete "patch" context manager, i.e. the
  `contextManager: "patch"` config option. This was a limited async context
  management that predated the preferred `AsyncLocalStorage` core Node.js
  mechanism for context tracking. (elastic#3529)
- Config vars:
    - Remove `logUncaughtExceptions` config option, if the agent's
      `uncaughtException` handler is active it now *always* logs the error to
      the console. (elastic#2412)
    - Remove `filterHttpHeaders` config option, see `sanitizeFieldNames`
      instead. (elastic#3332)
    - Remove long deprecate `ELASTIC_APM_KUBERNETES_*` envvars, use
      `KUBERNETES_*` instead. (elastic#2661)
    - The `useElasticTraceparentHeader` config option now defaults to `false`.
      This means the `elastic-apm-traceparent` HTTP header is now no longer
      sent by default. (elastic#3555)
    - Drop erroneous `ELASTIC_SANITIZE_FIELD_NAMES` and
      `ELASTIC_IGNORE_MESSAGE_QUEUES` config envvars.
- Instrumentations:
    - Drop instrumentation for old `hapi`, the current `@hapi/hapi` is still
      instrumented. (elastic#2691)
- APIs:
    - Ignore a `timer` option passed to `startTransaction()` and `startSpan()`
      APIs. (elastic#2990)
    - Remove the deprecated `span.toString()` and `transaction.toString()` APIs.
      (elastic#2348)
    - Change `apm.startTransaction()` API to return a noop transaction instead
      of null when the agent is not started. (elastic#2429)
    - Remove `transaction.subtype` and `transaction.action` properties from the
      API. This also impacts <<apm-start-transaction>> and
      `transaction.setType(...)`, both of which now no longer accept `subtype`
      and `action` parameters. (elastic#3557)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants