Live Debugger

Ce produit n'est pas pris en charge par le site Datadog que vous avez sélectionné. ().
Cette page n'est pas encore disponible en français, sa traduction est en cours.
Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.

Overview

Live Debugger lets you inspect application behavior in real time, directly in running services, without redeploying code or interrupting execution.

Instead of adding temporary debug logs or reproducing issues locally, you can dynamically capture application state—such as variable values, method inputs, and execution context—at specific points in the code. This makes Live Debugger well suited for diagnosing issues in production or other long-running environments.

Live Debugger uses logpoints: auto-expiring, non-breaking breakpoints that collect diagnostic data without pausing the application. Since execution continues normally, Live Debugger can be used safely on production systems to investigate problems as they happen.

Key capabilities

Live Debugger provides:

  • Real-time inspection of variable values, method arguments, and execution context in running code.
  • Safe, non-invasive data capture that collects debugging information without pausing applications or requiring redeploys.
  • Dynamic logpoint placement anywhere in your codebase, including in third-party libraries.
  • Auto-expiring logpoints that deactivate automatically after a configurable duration.
  • Conditional data capture based on user-defined expressions, so information is collected only when specific conditions are met.
  • Built-in sensitive data scrubbing to help prevent exposure of personal data, secrets, and credentials.

Getting started

Prerequisites

  1. All Dynamic Instrumentation prerequisites are met.
  2. You have created a logs index to store debugging information.
  3. (Recommended) You have enabled Source Code Integration to view and select specific code locations when adding logpoints.

Setup Live Debugger

Enable and disable Live Debugger on a service using one of the following methods:

Only users with the following permissions can use one-click enablement: Org Management, APM Remote Configuration Read, APM Remote Configuration Write.
  1. Select the service and environment on the Live Debugger Settings page.
  2. Check that all prerequisites are met as indicated on the Settings page.
  3. Click “Enable” or “Disable”:
    • “Enable” to allow users to create Debug Sessions on the selected service and environment.
    • “Disable” to deactivate active Debug Sessions and prevent users from creating more.

Note: No service restart is required for changes to take effect. Admins and security contacts receive email notifications when services are enabled or disabled.

Manual enablement

  1. Select the service and environment on the Live Debugger Settings page.
  2. Follow the instructions to enable Live Debugger.
  3. Restart the service before using Live Debugger.

Live Debugger and Dynamic Instrumentation

Due to shared underlying technology, Live Debugger and Dynamic Instrumentation are always enabled or disabled together on the same service and environment.

Like Live Debugger, Dynamic Instrumentation allows users to create logpoints (in addition to supporting other custom instrumentation like spans, span tags, and metrics). However, Live Debugger logpoints expire automatically after a set time period, while Dynamic Instrumentation logpoints remain active until manually deactivated.

When you enable or disable Live Debugger, the same action applies to Dynamic Instrumentation for that service and environment. When disabled, all data capture stops from both active Debug Session logpoints and dynamic instrumentations.

Using Live Debugger

Try using Live Debugger from your JetBrains IDE! Click here to learn more.

Creating and using a Debug Session

A Debug Session lets you inspect running code using auto-expiring logpoints. To create and use a Debug Session:

  1. Start a Debug Session from one of the following locations:
    • On the Live Debugger page, click Create Debug Session.
    • (Requires the Code Origin feature) In the Trace Explorer, open a trace, locate the Code Origin section in the side panel, and click Start Debug Session.
  2. Add a logpoint to begin collecting diagnostic data.
  3. Add, remove, or modify logpoints as needed during the session.

Debug Sessions expire automatically. You can also manually disable or re-enable a session, as well as individual logpoints, at any time.

Creating logpoints

Logpoints are “non-breaking breakpoints” that specify where in the code to capture information, what data to include, and under what conditions. To add a logpoint for debugging:

  1. Go to the Live Debugger page.
  2. Click Create Debug Session.
  3. Choose your service, environment, and select where in your code to place the first logpoint.
  4. Define a logpoint message template using the Dynamic Instrumentation expression language.
  5. (Optional) Enable “Capture Variables” to collect all execution context (this feature is rate-limited to 1 execution per second).
  6. (Optional) Define a condition for when the logs should be emitted.

Note: Some feature limitations may apply depending on the service’s runtime language. Review the runtime language-specific documentation for more details.

Protecting sensitive data

Live Debugger data might contain sensitive information, especially when using the “Capture Variables” option. To protect this data:

  1. Use the built-in sensitive data scrubbing mechanisms.
  2. Use Sensitive Data Scanner to identify and redact sensitive information based on regular expressions.

Impact on performance and billing

Enabling Live Debugger and Dynamic Instrumentation on a service does not trigger data capture or impact performance. Data capture only occurs when there are active Debug Sessions or dynamic instrumentations on that service.

Performance impact: Datadog’s agent-driven instrumentation ensures minimal impact on application performance; sampling logic, rate limits, and built-in budgets prevent runaway data capture.

Pricing impact: Logs captured by Datadog are all billed the same way, whether they are generated from Live Debugger or logger lines in your source code. With Live Debugger, the logpoints automatically expire after the set time period, limiting unnecessary data accumulation and costs. Monitor your Datadog Plan & Usage page for any unexpected increases after utilizing a new feature.

Limitations

The following constraints apply to Live Debugger usage and configuration:

  • Language support: Live Debugger is available for the same runtime languages as Dynamic Instrumentation, including: Java, Python, .NET, PHP (preview), Node.js (preview), Ruby (preview).
  • Configuration scope: Live Debugger and Dynamic Instrumentation are enabled or disabled together for the same service and environment.
  • Rate limits:
    • Logpoints with variable capture: Limited to 1 execution per second.
    • Logpoints without variable capture: Limited to 5000 executions per second, per service instance.

Further Reading