Public documentation

Documentation indexRead as Markdown

Node.js + Express

Configure collection for an existing CommonJS Express service on Linux/systemd. Setup installs instrumentation outside the application and adds a service drop-in; it does not install or start the sample Express application.

Existing server requirements

  • A running systemd service and the existing Express application directory.
  • Root-managed Node.js 24 or later and npm executables. NODE_BINARY and NPM_BINARY must select the runtime used by the service.
  • Root access and Python 3.10+ for the shared installer. No Python application environment is required for this Node integration.
  • No existing OTel SDK or telemetry preload in the app. Extend an existing SDK's exporter instead of installing a second provider. ESM loading and process managers with a separate daemon require their own startup integration.

Server changes

Set SYSTEMD_SERVICE, APP_DIR, NODE_BINARY, NPM_BINARY, OTEL_SERVICE_NAME, and INTEGRATION_ID in the server configuration. Setup installs the locked agent/ dependencies in /opt/corridora-otel/<id>/agent, then adds NODE_OPTIONS=--require=.../preload.cjs through a systemd environment file. Existing Node options are retained. Application source, package.json, and its lockfile are not rewritten.

The preload initializes one SDK before Express/HTTP imports. It records request traces and HTTP request metrics, and bridges supported Pino/Winston logs to OTLP. Plain console.log output is not automatically collected. Business counters and custom spans still belong in application code.

Pinned components include Node SDK/HTTP exporters 0.222.0, API 1.9.0, metrics/resources 2.11.0, Express instrumentation 0.70.0, Pino instrumentation 0.68.0, and Winston instrumentation 0.66.0 with OTLP transport 0.32.0. Application export to the local Collector uses HTTP/JSON; the Collector forwards over OTLP/HTTP to Corridora. The configured parent-based root sampling ratio defaults to 10%.

Set up collection

Clone the repository on the existing server:

git clone https://github.com/corridora/integrations.git
cd integrations/node-express
cp env.example "$HOME/corridora-node-express.env"
chmod 600 "$HOME/corridora-node-express.env"

Edit that private file to select the actual application directory, running service, runtime paths, and stable service name. The default ingest destination is https://ingest.corridora.ai; replace it only with the HTTPS ingest base URL supplied for your Corridora deployment. Do not append /v1/traces, /v1/logs, or /v1/metrics.

Load an active Corridora ingest key through your secret manager or a hidden prompt. The process environment overrides the configuration file:

export CORRIDORA_INGEST_KEY="$(python3 -c 'import getpass; print(getpass.getpass("Corridora ingest key: "))')"
sudo --preserve-env=CORRIDORA_INGEST_KEY bash setup.sh --config "$HOME/corridora-node-express.env" --dry-run
sudo --preserve-env=CORRIDORA_INGEST_KEY bash setup.sh --config "$HOME/corridora-node-express.env"

The first command inspects the server and prints the plan. The second installs collection, starts its Collector, and restarts the explicitly named application service. The script does not create an application, database, example site, or sample workload. It reads configuration as data and never sources it as shell code. It does not overwrite the input configuration file.

Keep the whole checkout: setup.sh invokes the shared lib/collection.py installer and uses this folder's agent/ files. The public source and this guide are mirrored; the old sample-launch --start and --verify modes have been removed.

Corridora delivery

The installed path is application → loopback OTLP/HTTP Collector → authenticated HTTPS Corridora ingestion. The Collector's only exporter is Corridora. There is no Jaeger, debug exporter, or optional alternate-backend mode.

Collector Contrib 0.160.0 is downloaded from the official release with a pinned SHA-256 checksum for Linux amd64 or arm64. It runs under a dedicated corridora-otel system account. The receiver and health endpoint bind only to 127.0.0.1; setup does not open firewall ports. Choose a free COLLECTOR_PORT and the following port for health checks. The default port differs between integration types.

The Collector adds X-CORRIDORA-KEY. The key is stored in its protected /etc/corridora-otel/<id>/collector.yaml, readable by root and the Collector's group. It is not placed in the application environment, PHP settings, command-line arguments, or repository files. TLS certificate verification stays enabled. Application exporters use the local receiver without that key; the generated startup settings clear stale signal-specific exporter overrides.

Traces and logs pass through an attribute processor that removes full SQL statements, query text, raw full URLs, and query strings before external export. Route/path attributes remain available. This does not replace the application's own log-message redaction policy. The Collector batches exports and uses a persistent retry queue under /var/lib/corridora-otel/<id>/queue.

Verify and operate

Generate traffic against the real application after setup. In Corridora, select its configured OTEL_SERVICE_NAME and the current time window, then inspect a request trace. Follow stored-data verification and the ingest reference. A running service or successful local export test does not establish remote storage or UI visibility.

Inspect the application and Collector services on the server:

sudo systemctl status YOUR_APPLICATION.service
sudo systemctl status corridora-otel-YOUR_INTEGRATION_ID.service
sudo journalctl -u corridora-otel-YOUR_INTEGRATION_ID.service --since '10 minutes ago'

Repeat setup with the same ID to reconcile the same installation. Existing managed files that were changed outside setup are rejected rather than overwritten. Changing an ID creates a different installation; do not use a new ID as an update shortcut. Ingest key rotation uses the same config/ID and restarts the Collector.

To restore saved startup configuration:

sudo bash setup.sh --config "$HOME/corridora-node-express.env" --rollback

Rollback disables this installation's Collector, restores the previous startup configuration, and restarts the affected service. Installed dependencies, the native PHP extension if installed, and queued data remain on disk. Configuration backups and installation state are root-only. Review the application's normal shutdown behavior: forced termination can lose an in-flight SDK batch.

Validation scope

The repository's server validation fixture exercises existing applications, installer filesystem changes, dry runs, repeated setup, native configuration validation, rollback, and real OTLP export through a Collector to an HTTPS Corridora-format receiver using synthetic credentials. systemctl is simulated in the unprivileged test container; these checks do not claim a production systemd rollout or ingestion into a real Corridora account.