Skip to content
Latchkey

datadog-ci sourcemaps upload for RUM Stack Traces

datadog-ci sourcemaps upload uploads JavaScript source maps tagged with a service and version so Datadog RUM can resolve minified error frames.

Datadog RUM groups front-end errors by service and version. Uploading the matching source maps from CI is what turns minified frames into real file and line references.

What it does

datadog-ci sourcemaps upload uploads .map files from a directory, tagging them with --service, --release-version, and the public path they map to (--minified-path-prefix). It uses DATADOG_API_KEY and DATADOG_SITE for auth and routing.

Common usage

Terminal
export DATADOG_API_KEY=...
export DATADOG_SITE=datadoghq.com
datadog-ci sourcemaps upload ./dist \
  --service web-app \
  --release-version "$GIT_SHA" \
  --minified-path-prefix https://app.example.com/static/

Options

Flag / envWhat it does
--service <name>RUM service the maps belong to (required)
--release-version <v>Version tag matching the deployed build (required)
--minified-path-prefix <url>Public URL prefix of the bundles (required)
DATADOG_API_KEYAPI key (required)
DATADOG_SITEDatadog site (datadoghq.eu, us3, etc.)
--dry-runValidate without uploading

In CI

The --release-version must equal the version your RUM SDK reports at runtime, or Datadog will not pair errors with the maps. Derive both from the same git SHA. Run with --dry-run first in a new pipeline to confirm the path prefix is right before consuming API quota.

Common errors in CI

"Missing API key. Please set DATADOG_API_KEY" means the secret is unset. "Invalid API key" / HTTP 403 means a wrong key or a site mismatch (EU key against the US site). A 400 on upload usually means a malformed --minified-path-prefix (it must be the absolute public URL prefix). Errors stay minified when --release-version differs from the SDK's reported version.

Using this in CI

  • Set the shell explicitly and enable set -euo pipefail; the default runner shell does not stop on the first error inside a multi-line block.
  • Pin the tool version. An unpinned build tool turns a runner image update into a build break on unchanged code.
  • Prefer non-interactive and batch flags. Progress output designed for a terminal bloats CI logs and can hang without a TTY.
  • Write machine-readable output (JSON, JUnit) to a file and upload it as an artifact, so a failure is diagnosable without re-running the job.

Frequently asked questions

datadog-ci sourcemaps upload for RUM Stack Traces?
Datadog RUM groups front-end errors by service and version. Uploading the matching source maps from CI is what turns minified frames into real file and line references.
What it does?
datadog-ci sourcemaps upload uploads .map files from a directory, tagging them with --service, --release-version, and the public path they map to (--minified-path-prefix). It uses DATADOG_API_KEY and DATADOG_SITE for auth and routing.
In CI?
The --release-version must equal the version your RUM SDK reports at runtime, or Datadog will not pair errors with the maps. Derive both from the same git SHA. Run with --dry-run first in a new pipeline to confirm the path prefix is right before consuming API quota.
Common errors in CI?
"Missing API key. Please set DATADOG_API_KEY" means the secret is unset. "Invalid API key" / HTTP 403 means a wrong key or a site mismatch (EU key against the US site). A 400 on upload usually means a malformed --minified-path-prefix (it must be the absolute public URL prefix).

Related guides

References

Run this faster and cheaper on Latchkey managed runners - self-healing included. Start free → 30-day trial · No credit card