Documentation forSolarWinds Observability SaaS

Azure App Service instrumentation for Node.js

Supported for App Service hosting plans on Linux only.

Use the APM Node.js Library to instrument your Azure App Service to gain insights into the application process at code-level. SolarWinds Observability supports the App Service runtime with APM Node.js library version 16.3.0 or later.

Install

For the typical App Service deployment scenario where build automation is enabled (SCM_DO_BUILD_DURING_DEPLOYMENT=true), add solarwinds-apm and its @opentelemetry/api dependency to your project. Example from Install the Node.js Library:

npm install --save "solarwinds-apm" "@opentelemetry/api@^1.9.0"

For a deployment scenario where build automation is disabled, for example, deploying via custom container image, your application must include all the installed dependencies in the container or deployable artifact.

Configure

Environment variables supported by APM Node.js can be set as app settings, in the Azure portal this is under Settings > Environment variables > App settings. These are the required settings:

Name Value
SW_APM_SERVICE_KEY The service name portion, that is, the string after :, is ignored and the App Service app name (WEBSITE_SITE_NAME) is used as the SolarWinds Observability service name. To override with an explicit service name, set the OTEL_SERVICE_NAME variable.
SW_APM_COLLECTOR

Determine based on your data center, for example:

apm.collector.na-01.cloud.solarwinds.com:443

Enable

Same as described in Load the library. An app setting NODE_OPTIONS with value --import solarwinds-apm can be added, or the package.json start script command can be updated as shown below:

"scripts": {
  "start": "node --import solarwinds-apm app.js"
}