Packages

@appsignal/nodejs

3.9.5 · 11 Nov 2026MIT24.2k / weekRepositoryHomepagenpmAtom feed

Your version

2.4.2

8 Jun 2022Where it was published
npm marks 2.4.2 as deprecated: Appsignal for Node.js 2.x is deprecated. Upgrade to @appsignal/nodejs@3

In short

3 fixed2 changed

Release note

Changed

  • Patch - Do not restore closed spans from within the withSpan helper. If a previously active span gets closed while withSpan has another span as currently active, do not restore the closed span when the callback has finished.

  • Patch - Do not restore root span after withSpan callback has finished. Previously the root span was restored to the original root span before the withSpan helper was called. This has been changed, because the withSpan helper is only about changing the active span, not the root span. If a new root span has been set within a withSpan helper callback, the root span will no longer be restored. We recommend setting a new root span before calling withSpan instead.

    const rootSpan = tracer.rootSpan()
    const span = tracer.createSpan(...)
    tracer.withSpan(span, function(span) {
      tracer.createRootSpan(...)
    });
    // No longer match
    rootSpan != tracer.rootSpan()

Fixed

  • Patch - Only allow open root spans to be set as root. This avoids closed root spans to be reused in child contexts.

  • Patch - Don't return closed spans in withSpan helper. If a closed span was given to the witSpan helper it would temporarily overwrite the context with a closed span that cannot be modified. Instead it will return the current active span, if any. If no span was active it will return a NoopSpan.

  • Patch - Add @opentelemetry/sdk-trace-base package runtime dependency. Our OpenTelemetry SpanProcessor needs this package at runtime, not just at compile time.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.