@appsignal/nodejs
Advanced tools
Changelog
3.0.25
ab7f3c7 patch - Add initializeOpentelemetrySdk
configuration option. This allows those who
would rather take control of how OpenTelemetry is initialised in their
application to skip AppSignal's initialization of the OpenTelemetry SDK.
Additionally, add an opentelemetryInstrumentations
method on the client,
which returns AppSignal's default OpenTelemetry instrumentations, already
configured to work correctly with AppSignal. The provided list of
instrumentations will follow the additionalInstrumentations
and
disableDefaultInstrumentations
config options, if those are set.
This is not the recommended way to use AppSignal for Node.js. Only use this config option and this method if you're really sure that you know what you're doing.
When initialising OpenTelemetry, it is necessary to add the AppSignal span processor in order for data to be sent to AppSignal. For example, using the OpenTelemetry SDK:
import { SpanProcessor, Appsignal } from "@appsignal/nodejs";
// or: const { SpanProcessor, Appsignal } = require("@appsignal/nodejs")
const sdk = new NodeSDK({
spanProcessor: new SpanProcessor(Appsignal.client)
instrumentations: Appsignal.client.opentelemetryInstrumentations()
});
sdk.start()
The above snippet assumes that the AppSignal client has been initialised beforehand.
When making use of this config option, the OpenTelemetry instrumentations
must be configured in the same way as it is done in the AppSignal integration.
In the above snippet, the instrumentations
property in the OpenTelemetry SDK
is set to the AppSignal client's list of OpenTelemetry instrumentations, which
are configured to work correctly with AppSignal.
daa8982 patch - Add the setSqlBody
tracing helper to set the body attribute on a span that contains a SQL query. When using this helper the given SQL query will be sanitized, reducing the chances of sending sensitive data to AppSignal.
import { setSqlBody } from "@appsignal/nodejs";
// Must be used in an instrumented context -- e.g. an Express route
setSqlBody("SELECT * FROM users WHERE 'password' = 'secret'");
// Will be stored as: "SELECT * FROM users WHERE 'password' = ?"
When the setBody
helper is also used, the setSqlBody
overwrites the setBody
attribute.
More information about our tracing helpers can be found in our documentation.
33bce2e patch - Bump agent to b604345.
running_in_container
to agent diagnose report, to be used primarily by the Python package as a way to detect if an app's host is a container or not.Bump agent to 8260fa1.
appsignal.sql_body
magic span attribute for OpenTelemetry spans. When this attribute is detected, we store the value as the span/event body. This span is sanitized beforehand so it doesn't contain any sensitive data and helps to group events in our backend. When used in combination with the appsignal.body
attribute, the new appsignal.sql_body
attribute is leading.More information on AppSignal OpenTelemetry span attributes can be found in our docs.
285f89e patch - Print more path details in the diagnose CLI output. It will now print details like if a path exists, the ownership of a path and if it's writable or not to help debug issues locally.
3204cdd patch - Bump agent to 1dd2a18.
Changelog
3.0.24
2eb17b0 patch - Bump agent to e8207c1.
memory_in_percentages
and swap_in_percentages
host metrics that represents metrics in percentages./snap/
disk mountpoints.037fcaa patch - Update Fastify dependency to make it compatible with Fastify 5
Changelog
3.0.21
Changelog
3.0.17
state
tag value on the cpu
metric called total_usage
, which reports the VM's total CPU usage in percentages.702d4df patch - Bump agent to 6bec691.
sql_lexer
to v0.9.5. It adds sanitization support for the THEN
and ELSE
logical operators.Changelog
3.0.16
statsdPort
option.RENDER_GIT_COMMIT
environment variable as revision if no revision is specified.bindAddress
config option. This is by default set to 127.0.0.1
, which only makes it accessible from the same host. If you want it to be accessible from other machines, use 0.0.0.0
or a specific IP address.6afc890 patch - Bump agent to fd8ee9e.
c2f7b2b patch - Bump agent to 32590eb.
.tar.gz
file, reducing the overall app size.