이 페이지는 아직 한국어로 제공되지 않습니다. 번역 작업 중입니다.
현재 번역 프로젝트에 대한 질문이나 피드백이 있으신 경우 언제든지 연락주시기 바랍니다.

Overview

When you enable the enablePrivacyForActionName initialization parameter, action names are masked for privacy. In minified builds, action names can also become unreadable because bundlers obfuscate the DOM element text and attributes that RUM uses to generate action names.

The Action Name Deobfuscation build plugin addresses both issues by instrumenting your source code at build time to generate a privacy dictionary that maps obfuscated values back to their original text. The RUM SDK uses this dictionary to resolve readable action names.

Prerequisites

  • The RUM SDK initialized with trackUserInteractions: true and enablePrivacyForActionName: true. See Mask all action names.
  • The Datadog build plugin installed and registered with your bundler. See Build Plugins for installation instructions.

Configuration

Configure the rum.privacy object in your build plugin options:

ParameterTypeRequiredDefaultDescription
rum.privacy.includeArray of RegExp or StringNoJS/TS files (.js, .ts, .jsx, .tsx, .mjs, .cjs, and variants)File patterns to process for action name deobfuscation.
rum.privacy.excludeArray of RegExp or StringNonode_modules, .preval. filesFile patterns to skip.

Example

With default settings (processes all JS/TS files, excludes node_modules):

const { datadogWebpackPlugin } = require('@datadog/webpack-plugin');

module.exports = {
  plugins: [
    datadogWebpackPlugin({
      rum: {
        privacy: {},
      },
    }),
  ],
};

With custom include and exclude patterns:

const { datadogWebpackPlugin } = require('@datadog/webpack-plugin');

module.exports = {
  plugins: [
    datadogWebpackPlugin({
      rum: {
        privacy: {
          include: [/\.jsx?$/, /\.tsx?$/],
          exclude: [/\/node_modules\//, /\/test\//],
        },
      },
    }),
  ],
};
These examples use webpack. The configuration object is identical across all supported bundlers. See Build Plugins for installation instructions.

Further reading