With one command, you can install, configure, and start the Agent, while also instrumenting your services with ASM.
For an Ubuntu host:
Run the one-line installation command:
DD_API_KEY=<YOUR_DD_API_KEY> DD_SITE="<YOUR_DD_SITE>" DD_APM_INSTRUMENTATION_ENABLED=host DD_APPSEC_ENABLED=true bash -c "$(curl -L https://install.datadoghq.com/scripts/install_script_agent7.sh)"
a. Replace <YOUR_DD_API_KEY>
with your Datadog API key.
b. Replace <YOUR_DD_SITE>
with your Datadog site.
You can also optionally configure the following:
Exit your current shell session.
Start a new shell session.
Restart the services on the host or VM.
Explore the performance observability of your services in Datadog.
Note: To configure single-step for both ASM Threat Protection and Code Security, add the environment variables DD_APPSEC_ENABLED=true
and DD_IAST_ENABLED=true
to your one-line installation command.
Specifying tracing library versions
By default, enabling APM on your server installs support for Java, Python, Ruby, Node.js, and .NET Core services. If you only have services implemented in some of these languages, set DD_APM_INSTRUMENTATION_LIBRARIES
in your one-line installation command:
DD_APM_INSTRUMENTATION_LIBRARIES="java:1.25.0,python" DD_API_KEY=<YOUR_DD_API_KEY> DD_SITE="<YOUR_DD_SITE>" DD_APM_INSTRUMENTATION_ENABLED=host DD_APPSEC_ENABLED=true DD_ENV=staging bash -c "$(curl -L https://install.datadoghq.com/scripts/install_script_agent7.sh)"
You can optionally provide a version number for the tracing library by placing a colon after the language name and specifying the tracing library version. If you don’t specify a version, it defaults to the latest version. Language names are comma-separated.
Supported languages include:
- .NET (
dotnet
) - Python (
python
) - Java (
java
) - Node.js (
js
) - Ruby (
ruby
)
Note: For the Node.js tracing library, different versions of Node.js are compatible with different versions of the Node.js tracing library. See DataDog/dd-trace-js: JavaScript APM Tracer for more information.
Tagging observability data by environment
Set DD_ENV
in your one-line installation command for Linux to automatically tag instrumented services and other telemetry that pass through the Agent with a specific environment. For example, if the Agent is installed in your staging environment, set DD_ENV=staging
to associate your observability data with staging
.
For example:
DD_API_KEY=<YOUR_DD_API_KEY> DD_SITE="<YOUR_DD_SITE>" DD_APM_INSTRUMENTATION_ENABLED=host DD_APPSEC_ENABLED=true DD_ENV=staging bash -c "$(curl -L https://install.datadoghq.com/scripts/install_script_agent7.sh)"
For a Docker Linux container:
- Install the library injector:
bash -c "$(curl -L https://install.datadoghq.com/scripts/install_script_docker_injection.sh)"
- 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_APPSEC_ENABLED=true \
-e DD_APM_NON_LOCAL_TRAFFIC=true \
-e DD_DOGSTATSD_NON_LOCAL_TRAFFIC=true \
-e DD_APM_RECEIVER_SOCKET=/opt/datadog/apm/inject/run/apm.socket \
-e DD_DOGSTATSD_SOCKET=/opt/datadog/apm/inject/run/dsd.socket \
-v /opt/datadog/apm:/opt/datadog/apm \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
gcr.io/datadoghq/agent:7
Replace <YOUR_DD_API_KEY>
with your Datadog API.You can also optionally configure the following:
- Restart the Docker containers.
- Explore the performance observability of your services in Datadog.
Specifying tracing library versions
By default, enabling APM on your server installs support for Java, Python, Ruby, Node.js, and .NET services. If you only have services implemented in some of these languages, set DD_APM_INSTRUMENTATION_LIBRARIES
when running the installation script.
For example, to install support for only v1.25.0 of the Java tracing library and the latest Python tracing library, add the following to the installation command:
DD_APM_INSTRUMENTATION_LIBRARIES="java:1.25.0,python" bash -c "$(curl -L https://install.datadoghq.com/scripts/install_script_docker_injection.sh)"
You can optionally provide a version number for the tracing library by placing a colon after the language name and specifying the tracing library version. If you don’t specify a version, it defaults to the latest version. Language names are comma-separated.
Supported languages include:
- .NET (
dotnet
) - Python (
python
) - Java (
java
) - Node.js (
js
) - Ruby (
ruby
)
Note: For the Node.js tracing library, different versions of Node.js are compatible with different versions of the Node.js tracing library. See DataDog/dd-trace-js: JavaScript APM Tracer for more information.
Tagging observability data by environment
Set DD_ENV
in the library injector installation command for Docker to automatically tag instrumented services and other telemetry that pass through the Agent with a specific environment. For example, if the Agent is installed in your staging environment, set DD_ENV=staging
to associate your observability data with staging
.
For example:
docker run -d --name dd-agent \
-e DD_API_KEY=${YOUR_DD_API_KEY} \
-e DD_APM_ENABLED=true \
-e DD_APPSEC_ENABLED=true \
-e DD_ENV=staging \
-e DD_APM_NON_LOCAL_TRAFFIC=true \
-e DD_DOGSTATSD_NON_LOCAL_TRAFFIC=true \
-e DD_APM_RECEIVER_SOCKET=/opt/datadog/apm/inject/run/apm.socket \
-e DD_DOGSTATSD_SOCKET=/opt/datadog/apm/inject/run/dsd.socket \
-v /opt/datadog/apm:/opt/datadog/apm \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
gcr.io/datadoghq/agent:7
You can enable APM by installing the Agent with the Datadog Helm chart. This deploys the Datadog Agent across all nodes in your Linux-based Kubernetes cluster with a DaemonSet.
Note: Single step instrumentation doesn’t instrument applications in the namespace where you install the Datadog Agent. It’s recommended to install the Agent in a separate namespace in your cluster where you don’t run your applications.
Requirements
- Make sure you have Helm installed.
Installation
To enable single step instrumentation with Helm:
Add the Helm Datadog repo:
helm repo add datadog https://helm.datadoghq.com
helm repo update
Create a Kubernetes Secret to store your Datadog API key:
kubectl create secret generic datadog-secret --from-literal api-key=$DD_API_KEY