@appsignal/nodejs
Advanced tools
Changelog
3.0.0
Welcome to AppSignal for Node.js version 3.0.0.!
In this release, we have switched to using OpenTelemetry internally for tracing. (We do not yet support OpenTelemetry for metrics and logging, but do continue to support metrics through our own metrics system.) The AppSignal instrumentation packages @appsignal/express
, @appsignal/koa
, @appsignal/nextjs
and @appsignal/apollo-server
should no longer be used. Some official OpenTelemetry instrumentation packages are bundled with our package as dependencies and instrumented automatically. Other supported instrumentation packages can be added and configured manually.
We strongly recommend following the [migration guide] while upgrading. Instrumentation from package version 2 is not compatible with version 3. Custom instrumentation will need to be set up using OpenTelemetry instrumentation.
If you run into any issues upgrading to this new version, please contact us at [support@appsignal.com][support] for help.
@appsignal/*
instrumentation packages.Changelog
3.0.0-beta.2
23192ef patch - Bump agent to v-de2dd6e.
http.route
attribute to always
build the incident action name. This should avoid new incidents with
HTTP POST
-like naming.Changelog
3.0.0-beta.1
@appsignal/<package name>
instrumentation packages are not compatible. Please remove them before upgrading.d452b46 patch - Support OpenTelemetry root spans in SpanProcessor. This change makes AppSignal instrumentation (like Express/Koa.js/Next.js) no longer a requirement. In fact you will need to use the OpenTelemetry instrumentation for those libraries from now on.
60428c8 patch - Bump agent to v-d573c9b
appsignal_create_opentelemetry_span
function to create spans for further modification, rather than only import them.a1d947c patch - Remove the mysql2 package peer dependency. It's not only present as a development dependency for the package.
54491fa patch - Bump agent to 06391fb
log_level
config option.debug
config option. This has been replaced with logLevel
set to debug
.apiKey
config option. This has been renamed to pushApiKey
.Changelog
2.4.2
b7382d7 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.
7a7bc9b 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()
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
.@opentelemetry/sdk-trace-base
package runtime dependency. Our OpenTelemetry SpanProcessor needs this package at runtime, not just at compile time.Changelog
2.4.1
tracer.wrapEmitter
to wrap an event emitter, it was not possible to remove
any listeners that were added after the event emitter was wrapped.Changelog
2.4.0
60d7980 minor - Add OpenTelemetry span processor for the mysql and mysql2 packages. These are experimental integrations and require additional set up to integrate with OpenTelemetry.
9cd1c8b patch - Add config options for disabling default instrumentation like HTTP, HTTPS, PostgreSQL (pg package) and Redis (node-redis package).
The following configuration options have been added:
instrumentHttp
instrumentPg
instrumentRedis
By default these configuration options are set to true
, which means the instrumentation is active by default. If you want to disable one of these instrumentations, configure it by setting the configuration option to false
.
// appsignal.js
// Brief example, see our docs for a full example
const appsignal = new Appsignal({
instrumentRedis: false // Disables the node-redis package instrumentation
});
3959858 patch - Add OpenTelemetry node-redis and ioredis query sanitizers. We recommend using these sanitizers to ensure no sensitive data is sent in query statements. Add the sanitizer to the dbStatementSerializer
config as demonstrated below.
// tracing.js
// Add the RedisDbStatementSerializer import
const { RedisDbStatementSerializer } = require("@appsignal/nodejs");
const { RedisInstrumentation } = require("@opentelemetry/instrumentation-redis");
const sdk = new opentelemetry.NodeSDK({
instrumentations: [
new RedisInstrumentation({
// Configure the AppSignal RedisDbStatementSerializer to sanitize queries
dbStatementSerializer: RedisDbStatementSerializer
})
]
});
The same can be done for the ioredis instrumentation:
// tracing.js
// Add the IORedisDbStatementSerializer import
const { IORedisDbStatementSerializer } = require('@appsignal/nodejs');
const { IORedisInstrumentation } = require('@opentelemetry/instrumentation-ioredis');
const sdk = new opentelemetry.NodeSDK({
instrumentations: [
// Add the IORedisInstrumentation
new IORedisInstrumentation({
// Configure the AppSignal IORedisDbStatementSerializer to sanitize queries
dbStatementSerializer: IORedisDbStatementSerializer
})
]
});
ee1ea8b patch - Use the OpenTelemetry SpanProcessor interface to build our own SpanProcessor. We previously copied the SpanProcessor code into our package, but instead we now use the OpenTelemetry interface directly. This should make our processor match the expected type better.
4e58a73 patch - Bump agent to v-0b43802.
01c25d3 patch - Bump agent to v-1a8ac46
ScopeManager.active()
function returning closed spans.ScopeManager.active()
and ScopeManager.root()
to make sure the span is not already closed, also make sure it's not closed when transferring spans around between async contexts.Changelog
2.3.6
createRootSpan
function to the Tracer to allow explicit creation of RootSpans even if another RootSpan already exists and is tracked as the current RootSpan. Make sure to not forget about the previous RootSpan, and close it as well at some point when using this function.Changelog
2.3.5
host
property from the request options if the hostname
property is not present. This fixes a bug where outgoing HTTP request hosts would be shown as http://localhost
.Changelog
2.3.4
9.0.0
. This drops compatibility with Python 2.7 for the extension install, but it makes it compatible with the latest Python 3 version, which should be more accessible to users going forward.tracer.withSpan
could cause the root span for a given scope to be forgotten.