Skip to main content
Use the sourcemap processor in your OpenTelemetry Collector to symbolicate JavaScript (JS) stack traces. The sourcemap processor replaces minified names and addresses in your JS stack traces with symbols from provided source maps.

Before You Start

The sourcemap processor is compatible with Honeycomb OpenTelemetry Web SDK version 0.12.0 and later. To use the sourcemap processor, you need:
  • OpenTelemetry Collector built with CGO enabled.
  • An environment or container image with glibc support. We recommend gcr.io/distroless/cc, a secure and lightweight container image with CGO and glibc support.
If you’re not using the Honeycomb OpenTelemetry Web SDK, make sure your exception data is in the format the processor expects.

Install

By default, the Honeycomb OpenTelemetry Collector distribution includes the sourcemap processor, so you can skip to the next section if you’re using it. If you use another collector distribution or build your own, it must be built with CGO enabled. You can install the sourcemap processor by adding it to your OpenTelemetry Collector build configuration file:
processors:
  - gomod: github.com/honeycombio/opentelemetry-collector-symbolicator/sourcemapprocessor v0.0.14
You can find the latest sourcemap processor version on the releases page in the GitHub repo.

Source Files and Source Maps

The sourcemap processor requires access to your minimized JS source files and associated source maps. These can be stored in your local file system, Amazon S3, or Google Cloud Storage. To support symbolication, your minified source files must have a comment with a sourceMappingURL pointing to the relative path of the source map file.
//# sourceMappingURL=/static/dist/main.c383b093b0b66825a9c3.js.map
You should also version your source files and source maps with a file hash in the file name, for example: vendor.1c285a50f5307be9648d.js. This helps prevent conflicts and ensure the correct file versions are used.

Configure a File Store

Add the source_map_symbolicator as a processor in your OpenTelemetry Collector configuration:
processors:
  source_map_symbolicator:
You can then configure where your source maps are stored.
By default, the sourcemap processor loads source map files from a local directory. You can set the file path in your collector configuration:
processors:
  source_map_symbolicator:
    # source_map_store is sets which store to use, in this case local disk
    source_map_store: file_store
    local_source_maps:
        # (optional) path sets the base path of the files, defaults to `.`
        path: /tmp/sourcemaps
Make sure your collector can access the path directory you set, and that file paths in stack traces match the structure of your configured file store.

How the Processor Retrieves Files from Local Disk

When retrieving files from local disk, the processor:
  1. Gets the base file name from the URL included in the stack trace.
  2. The path, if configured, is joined with the base file name.
  3. Reads the file using the joined path from disk.
For example:
  • Original URL: https://example.com/static/dist/main.c383b093b0b66825a9c3.js
  • path is set to /tmp/sourcemaps
  • New path: /tmp/sourcemaps/main.c383b093b0b66825a9c3.js.map

Advanced Configuration

In addition to basic setup, you can customize how the sourcemap processor handles stack traces by configuring attribute mappings and additional processing options.
After updating the configuration file, restart the OpenTelemetry Collector to apply the changes.

Mapping Attributes

Use these configuration options to specify which attributes the processor should read from and write to when handling stack traces:

Additional Processing Options

Use these configuration options to control how stack traces are processed and managed:

Language-Based Routing

The source map processor supports language-based routing to ensure it only processes signals from JavaScript/TypeScript applications. This prevents the processor from running on signals from other languages (like Java or Swift), improving performance and avoiding unnecessary processing.
If using Honeycomb’s React Native SDK, you’ll want to enable hermesjs as a value. See the SDK’s default attribute values
Example configuration:
processors:
  source_map_symbolicator:
    allowed_languages: ["javascript", "webjs"]
allowed_languages configuration behavior:
  • Empty allowed_languages (default): Processes all signals, regardless of language attribute.
  • With allowed_languages configured: Only processes signals where the language attribute matches one of the allowed values (case-insensitive).
  • Missing language attribute: Skips processing when allowed_languages is configured.