This page is not yet available in Spanish. We are working on its translation.
If you have any questions or feedback about our current translation project, feel free to reach out to us!

Overview

In a Docker Linux container, use Single Step Instrumentation (SSI) for APM to install the Datadog Agent and instrument your applications in one step, with no additional configuration required.

Enable APM on your applications

To enable APM in a Docker Linux container:

  1. Run the one-line installation command:
    DD_APM_INSTRUMENTATION_ENABLED=docker DD_APM_INSTRUMENTATION_LIBRARIES="java:1,python:2,js:5,dotnet:3,php:1" DD_NO_AGENT_INSTALL=true bash -c "$(curl -L https://install.datadoghq.com/scripts/install_script_agent7.sh)"
    
  2. Configure the Agent in Docker:
    docker run -d --name dd-agent \
      -e DD_API_KEY=<YOUR_DD_API_KEY> \
      -e DD_APM_ENABLED=true \
      -e DD_ENV=<AGENT_ENV> \
      -e DD_APM_NON_LOCAL_TRAFFIC=true \
      -e DD_DOGSTATSD_NON_LOCAL_TRAFFIC=true \
      -e DD_APM_RECEIVER_SOCKET=/var/run/datadog/apm.socket \
      -e DD_DOGSTATSD_SOCKET=/var/run/datadog/dsd.socket \
      -v /var/run/datadog:/var/run/datadog \
      -v /var/run/docker.sock:/var/run/docker.sock:ro \
      gcr.io/datadoghq/agent:7
    
    Replace <YOUR_DD_API_KEY> with your [Datadog API key][5] and <AGENT_ENV> with the environment your Agent is installed on (for example, staging).
    See Advanced options for more options.
  3. Restart the Docker containers.
  4. Explore the performance observability of your services in Datadog.

After you complete these steps, you may want to enable runtime metrics or view observability data from your application in the Software Catalog.

Advanced Options

When you run the one-line installation command, there are options to customize your experience:

Customize APM libraries

By default, Java, Python, Ruby, Node.js and .NET Core Datadog APM libraries are installed when DD_APM_INSTRUMENTATION_ENABLED is set. DD_APM_INSTRUMENTATION_LIBRARIES is used to override which libraries are installed. The value is a comma-separated string of colon-separated library name and version pairs.

Example values for DD_APM_INSTRUMENTATION_LIBRARIES:

  • DD_APM_INSTRUMENTATION_LIBRARIES="java:1" - install only the Java Datadog APM library pinned to the major version 1 release line.
  • DD_APM_INSTRUMENTATION_LIBRARIES="java:1,python:2" - install only the Java and Python Datadog APM libraries pinned to the major versions 1 and 2 respectively.
  • DD_APM_INSTRUMENTATION_LIBRARIES="java:1.38.0,python:2.10.5" - install only the Java and Python Datadog APM libraries pinned to the specific versions 1.38.0 and 2.10.5 respectively.

Available versions are listed in source repositories for each language:

Remove Single Step APM instrumentation from your Agent

If you don’t want to collect trace data for a particular service, host, VM, or container, complete the following steps:

Remove instrumentation for specific services

To remove APM instrumentation and stop sending traces from a specific service:

  1. Add the DD_INSTRUMENT_SERVICE_WITH_APM environment variable to the service startup command:
    docker run -e DD_INSTRUMENT_SERVICE_WITH_APM=false <service_start_command>
    
  2. Restart the service.

Remove APM for all services on the infrastructure

To stop producing traces, uninstall APM and restart the infrastructure:

  1. Run:
    dd-container-install --uninstall
    
  2. Restart Docker:
    systemctl restart docker
    
    Or use the equivalent for your environment.

Further reading

Más enlaces, artículos y documentación útiles:

PREVIEWING: domalessi/docs-10444