Enable Developer Observability

Temporary table of contents for Developer Observability

Preview

Requirements

OneAgent comes with a big set of features that are activated by default. Nevertheless, you always need to explicitly activate features added by newer versions of OneAgent and opt-in features. For details see, OneAgent Features and API Configuration.

To enable Developer Observability (Live Debugger), ensure that your One Agent is up to date and deployed correctly.

Availability

Dynatrace Live Debugger is only available on Dynatrace SaaS deployments with a DPS accounts that have the applicable rate card associated with the account. Please contact a Dynatrace product expert via live chat within your environment.

Enable Developer Observability

In order to enable the Live Debugger (as part of the Developer Observability product), the environment admin needs to enable the Live Debugger feature application through:

  1. Go to Settings > Preferences > OneAgent features

  2. Enable the live-debugging feature for Java, Node.js, or both, depending on your needs.

    1. Go to Settings > Preferences > OneAgent features.
    2. Enable the Java Live-Debugger, Node.js Live-Debugger, or both.
      • Enabling the Java Live-Debugger feature requires a restart of the monitored Java process to fully activate.
    1. On the process group overview page, select Settings.
    2. Go to Preferences > OneAgent features.
    3. Enable the Java Live-Debugger, Node.js Live-Debugger, or both.
      • Enabling the Java Live-Debugger feature requires a restart of the monitored Java process to fully activate.
    1. On the process overview page, select More () > Settings.
    2. Go to Preferences > OneAgent features.
    3. Enable the Java Live-Debugger, Node.js Live-Debugger, or both.
      • Enabling the Java Live-Debugger feature requires a restart of the monitored Java process to fully activate.
  3. Enable Developer Observability

    Go to Settings > Developer Observability > Enable Developer Observability

    1. On the process group overview page, select Settings.
    2. Go to Developer Observability > Enable Developer Observability.
    1. On the process overview page, select More () > Settings.
    2. Go to Developer Observability > Enable Developer Observability
  4. Create IAM policy using the details described in Grant permission to use the Live Debugger via an IAM policy.

  5. Apply your policy to a group.

  6. Assign the users to a group.

  7. Restart the OneAgent.

Now you can enter the Live Debugger and select the services you would like to debug.

Additional Settings

Labels

  • Labels are key/value pairs that are attached to running application instances.
  • They can be used to organize and select groups of application instances.
  • The Live Debugger application will automatically provide you with the OneAgent labels via the Application Selection page (including attributes / resource labels / labels) where you can easily add them as filters to pick your relevant instances to debug.

IAM service reference

All supported values for each IAM permission and condition are listed below. Use them to define access policies based on a fine-grained set of permissions and conditions that can be enforced per service. For more information, see Working with policies.

dev-obs:breakpoints:set

Grants permission to set user-level Live Debugging breakpoints.

Conditions:

  • dev-obs:k8s.namespace.name - the name of the namespace that the pod is running in.

    operators: IN, NOT IN, startsWith, NOT startsWith, =, !=

  • dev-obs:k8s.cluster.name - the name of the cluster that the pod is running in.

    operators: IN, NOT IN, startsWith, NOT startsWith, =, !=

  • devobs:dt.host_group.id – ID of the host group.

    operators: IN, NOT IN, startsWith, NOT startsWith, =, !=

  • dev-obs:dt.host.name - the name of the host.

    operators: IN, NOT IN, startsWith, NOT startsWith, =, !=

Example policies:

  • Allow setting breakpoints for all instances:

    ALLOW dev-obs:breakpoints:set;
  • Allow setting breakpoints for a particular host group:

    ALLOW dev-obs:breakpoints:set WHERE devobs:dt.host_group.id = "myHostGroup";

dev-obs:breakpoints:manage

Grants permission to manage environment-level Live Debugging breakpoints.

Example policy:

Allow managing breakpoints across the environment:

ALLOW dev-obs:breakpoints:manage;

Agent Setup

Node

Transpiled code

If your application's code is being transpiled or bundled, you must include the source maps, either in-line or as separate files.

  • Webpack
    Use either the inline-source-map or source-map values for the devtool option in the Webpack config file (reference).
  • Babel
    Use either the inline, both or true values for the sourceMaps option in the Babel config file (reference).
  • TypeScript
    Add either inlineSourceMap: true or sourceMap: true as well as inlineSources: true in the TypeScript config file (reference).
  • CoffeeScript
    Pass either the -M (inline) or -m flags to the coffee CLI tool (reference).
    Note: When using both Webpack and TypeScript together, please do as follows:
  • Webpack + TypeScript
    Add sourceMap: true as well as inlineSources: true in the TypeScript config file and use either the inline-source-map or source-map values for the devtool option in the Webpack config file.
Uglification/minification

The Live Debugger works with uglified/minified code if it's provided with source maps, however, mangling (changing of variable names) should not be applied. Webpack may automatically mangle variable names when used in production. To disable mangling in webpack, add the following to webpack.config.js:

const TerserPlugin = require("terser-webpack-plugin");
module.exports = {
// ...
optimization: {
minimizer: \[new TerserPlugin({
terserOptions: {
mangle: false,
},
})],
},
};

Integrate with your version control

When debugging within a remote environment, knowing exactly what source code it is executing is imperative.

The Live Debugger integrates with your source-control provider to fetch the correct source code for every environment (see our source code security page for more info).

Configure the following environment variables to enable automatic source code fetching:

  • DT_LIVEDEBUGGER_COMMIT - String that indicates your git commit
  • DT_LIVEDEBUGGER_REMOTE_ORIGIN - String that indicates your git remote origin

For multiple sources, use the environment variable DT_LIVEDEBUGGER_SOURCES to initialize the SDK with information about the sources used in your application.

DT_LIVEDEBUGGER _SOURCES is a semicolon-separated list with either a source control repository and revision information, or a path on the local filesystem to a JAR file.

Applying Data Masking Rules

Dynatrace Live Debugger offers data masking rules to let you control sensitive data, giving you the ability to specify which data it should not collect and display to users.

You can set the data masking rules through the Live Debugger Settings page:

  1. Go to Settings > Developer Observability > Sensitive data masking.
  2. Configure data masking by adding rules with a set of matchers that identify your sensitive data.
  3. Select Add rule to start configuring your rule.
  4. Name: The name to display for your configuration.
  5. Select the rule type:
  • Redact by variable name
    When masking by variable name, the entire value of any variable matching that name will be redacted.
    For example, adding a rule for the variable name secretKey replaces the output secretKey:12345 with secretKey:\*\*\*.

  • Redact by regex
    When masking by regular expression, all matches to that expression will be redacted.
    For example, adding a rule regarding the variable value \[0-9]+ will replace nameAndPassword:LordHelmet-12345 with nameAndPassword:LordHelmet-\*\*\*\*.

Defined rules can be reordered, and they are executed in the order in which they appear on the Sensitive data masking page.

The redacted data is replaced, by default, with the string \*\*\*.

You can choose a custom string for the rule, or replace it with a SHA-256 hash. For example, adding a rule for the variable name secretKey with a custom replacement of REDACTED replaces the output secretKey:12345 with secretKey:REDACTED.

Data redaction

Data redaction settings only apply to breakpoints set after the configuration change.

Enable Live Debugging ActiveGate Module

To use the Live Debugger module, enable the Live Debugger ActiveGate module by setting debugging_enabled to true in the custom.properties file and then restarting ActiveGate.

If you are using a proxy, configure it within the Environment ActiveGate as described in Proxy for ActiveGate.