Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

trackjs-node

TrackJs28.4kSEE LICENSE IN LICENSE.md1.3.0TypeScript support: included

TrackJS Error Tracking agent for NodeJS

error-tracking, error-monitoring, error-reporting, error-handling, logging, javascript, nodejs, debugging, debugger, debugging-tool, error, trackjs, trackjs-node, trackjs-agent

readme


TrackJS Agent for NodeJS

Reference

Usage

To use the Agent, call TrackJS.install(options) as soon as possible in your code. It will install the monitors into the environment.

// ES5
const TrackJS = require("trackjs-node").TrackJS;
// ES6
import { TrackJS } from "trackjs-node";

TrackJS.install({
  token: "YOUR_TOKEN"
  /* other options */
});

To add more context to your errors, add context and metadata through the agent.

TrackJS.configure({
  sessionId: "session",
  version: "1.0.0",
  userId: "frank@gmail.com"
});

// or add arbitrary keys for whatever you think is important
TrackJS.addMetadata({
  foo: "bar"
});

TrackJS will automatically gather Telemetry and send errors. If you want to trigger these events yourself, you can.

TrackJS.addLogTelemetry("warn", [
  "a warning message",
  {
    /*state object*/
  }
]);

TrackJS.track(new Error("everything has gone wrong!"));

changelog

Changelog

1.3.0

  • Added installation options for network.enabled and network.error to control whether network telemetry and errors are captured.
  • Fixed wrapping of http.get and https.get to add telemetry events.

1.2.0

  • Added TrackJS.console function for parity with the browser agent.

1.1.0

  • Update NetworkWatcher to instrument the request method instead of the private _http_agent method, which breaks on some platforms.

1.0.2

Update packages and verify new node version

  • Upgraded internal dev tools
  • Upgraded Typescript
  • Verified compatibility with node 18 LTS

1.0.1

Fixes required for Node 14 and 15.

  • Fixed express errors in async code would not be attributed to the request.
  • Fixed rejected promises not recorded in Node 15 due to serialization of strings.
  • Fixed error correlation was always being reset.

1.0.0

  • Stable Release.

0.0.12

  • Fixed issue where we could not discover modules (dependencies) in restrictive cloud environments.

0.0.11

  • Added Access-Control-Expose-Headers header for correlation header sharing.

0.0.6

Updates from initial beta and configuring UI.

  • Updated capture URLs
  • Sending applicationPlatform
  • Using "real" entry values
  • Default metadata for hostname, username, and cwd
  • Stamping captured errors with a TrackJS key so customer can cross-reference
  • Optionally send correlation header to client-side

0.0.5

Initial creation of the NodeJS Agent. Key differences with the Browser Agent:

  • No helper functions, attempt, watch, or watchAll.
  • No Visitor or Navigation Telemetry.
  • Fewer options to configure environment integration. (Wait until we need them)
  • No ability to customize the serializer. I think this is unused.