Skip to content

Latest commit

 

History

History

error-tracking

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Error Tracking Plugin

Interact with Error Tracking directly from your build system.

Table of content

Configuration

errorTracking?: {
    enable?: boolean;
    sourcemaps?:
        | {
              bailOnError?: boolean;
              debugId: true;
              dryRun?: boolean;
              experimentalDuplicateCheck?: boolean;
              maxConcurrency?: number;
          }
        | {
              bailOnError?: boolean;
              debugId?: false;
              dryRun?: boolean;
              maxConcurrency?: number;
              minifiedPathPrefix: string;
              releaseVersion?: string;
              service: string;
          };
}

errorTracking.enable

default: true when an errorTracking config block is present, false otherwise.

Enable or disable the plugin without removing its configuration.

Must be a boolean. Non-boolean values are coerced today but will be rejected in a future major release.

Sourcemaps Upload

Upload JavaScript sourcemaps to Datadog to un-minify your errors.

For new debug ID configurations, use the top-level sourcemaps option:

datadogWebpackPlugin({
    auth: {
        apiKey: process.env.DATADOG_API_KEY,
    },
    sourcemaps: {
        debugId: true,
        upload: true,
    },
});

Existing errorTracking.sourcemaps configurations remain supported. Configure errorTracking.sourcemaps.debugId: true to upload by debug ID, or configure service, releaseVersion, and minifiedPathPrefix to use service/version matching. These two upload-matching strategies are mutually exclusive. RUM source code context may still include service and version alongside an injected debug ID because that metadata is independent of source-map matching.

Note

You can override the domain used in the request with the DATADOG_SITE environment variable or the auth.site options (eg. datadoghq.eu). You can override the full intake URL by setting the DATADOG_SOURCEMAP_INTAKE_URL environment variable (eg. https://sourcemap-intake.datadoghq.com/v1/input).

errorTracking.sourcemaps.bailOnError

default: false

Should the upload of sourcemaps fail the build on first error?

errorTracking.sourcemaps.debugId

default: false

Upload source maps using the debug IDs injected with rum.sourceCodeContext.debugId: true.

errorTracking.sourcemaps.dryRun

default: false

It will not upload the sourcemaps to Datadog, but will do everything else.

errorTracking.sourcemaps.experimentalDuplicateCheck

default: false

Only applies when errorTracking.sourcemaps.debugId is enabled.

Query the check_exists endpoint before upload and skip sourcemaps whose debug IDs already exist. If the check fails, upload proceeds as usual.

errorTracking.sourcemaps.maxConcurrency

default: 20

Number of concurrent upload to the API.

errorTracking.sourcemaps.minifiedPathPrefix

required

Should be a prefix common to all your JS source files, depending on the URL they are served from.

The prefix can be a full URL or an absolute path.

Example: if you're uploading dist/file.js to https://example.com/static/file.js, you can use minifiedPathPrefix: 'https://example.com/static/' or minifiedPathPrefix: '/static/'.minifiedPathPrefix: '/' is a valid input when you upload JS at the root directory of the server.

errorTracking.sourcemaps.releaseVersion

required (or set via metadata.version)

Is similar and will be used to match the version tag set on the RUM SDK.

If omitted, the plugin falls back to the shared top-level metadata.version. At least one of the two must be set.

errorTracking.sourcemaps.service

required

Should be set as the name of the service you're uploading sourcemaps for, and Datadog will use this service name to find the corresponding sourcemaps based on the service tag set on the RUM SDK.

Note

If you get the error Error: No git remotes available, you can disable the git integration via the enableGit configuration at the root. It will also remove any usage of git for additional information on your files.