- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
Single Step Instrumentation for APM installs the Datadog Agent and instruments your applications in one step, with no additional configuration steps required.
Languages and architectures: Single step APM instrumentation only supports tracing Java, Python, Ruby, Node.js, and .NET Core services on x86_64
and arm64
architectures.
Operating systems:
If you install or update a Datadog Agent with the Enable APM Instrumentation (beta) option selected, the Agent is installed and configured to enable APM. This automatically instruments your application, without any additional installation or configuration steps.
The following examples show how it works for each deployment type.
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_APM_INSTRUMENTATION_LIBRARIES=java:1,python:2,js:5,dotnet:3,ruby:2 DD_ENV=<AGENT_ENV> bash -c "$(curl -L https://install.datadoghq.com/scripts/install_script_agent7.sh)"
Replace <YOUR_DD_API_KEY>
with your Datadog API key, <YOUR_DD_SITE>
with your Datadog site, and <AGENT_ENV>
with the environment your Agent is installed on (for example, staging
).
Start a new shell session.
Restart the services on the host or VM.
For a Docker Linux container:
DD_APM_INSTRUMENTATION_ENABLED=docker DD_APM_INSTRUMENTATION_LIBRARIES=java:1,python:2,js:5,dotnet:3,ruby:2 DD_NO_AGENT_INSTALL=true bash -c "$(curl -L https://install.datadoghq.com/scripts/install_script_agent7.sh)"
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
<YOUR_DD_API_KEY>
with your Datadog API key and <AGENT_ENV>
with the environment your Agent is installed on (for example, staging
).You can enable APM by installing the Agent with either:
Helm
for deploying the Datadog Operator.Kubectl
CLI for installing the Datadog Agent.Follow these steps to enable Single Step Instrumentation across your entire cluster with the Datadog Operator. This automatically sends traces for all applications in the cluster that are written in supported languages.
To enable Single Step Instrumentation with the Datadog Operator:
Install the Datadog Operator v1.5.0+ with Helm:
helm repo add datadog https://helm.datadoghq.com
helm repo update
helm install my-datadog-operator datadog/datadog-operator
Create a Kubernetes secret to store your Datadog API key:
kubectl create secret generic datadog-secret --from-literal api-key=$DD_API_KEY
Create datadog-agent.yaml
with the spec of your Datadog Agent deployment configuration. The simplest configuration is as follows:
apiVersion: datadoghq.com/v2alpha1
kind: DatadogAgent
metadata:
name: datadog
spec:
global:
site: <DATADOG_SITE>
tags:
- env:<AGENT_ENV>
credentials:
apiSecret:
secretName: datadog-secret
keyName: api-key
features:
apm:
instrumentation:
enabled: true
libVersions:
java: "1"
dotnet: "3"
python: "2"
js: "5"
ruby: "2"
Replace <DATADOG_SITE>
with your Datadog site and <AGENT_ENV>
with the environment your Agent is installed on (for example, env:staging
).
Run the following command:
kubectl apply -f /path/to/your/datadog-agent.yaml
After waiting a few minutes for the Datadog Cluster Agent changes to apply, restart your applications.
Follow these steps to enable Single Step Instrumentation across your entire cluster with Helm. This automatically sends traces for all applications in the cluster that are written in supported languages.
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
Create datadog-values.yaml
and add the following configuration:
datadog:
apiKeyExistingSecret: datadog-secret
site: <DATADOG_SITE>
tags:
- env:<AGENT_ENV>
apm:
instrumentation:
enabled: true
libVersions:
java: "1"
dotnet: "3"
python: "2"
js: "5"
ruby: "2"
Replace <DATADOG_SITE>
with your Datadog site and <AGENT_ENV>
with the environment your Agent is installed on (for example, env:staging
).
Run the following command:
helm install datadog-agent -f datadog-values.yaml datadog/datadog
After waiting a few minutes for the Datadog Cluster Agent changes to apply, restart your applications.
After you complete these steps, you may want to enable runtime metrics or view observability data from your application in the Service Catalog.
When you run the one-line installation command, there are a few options to customize your experience:
DD_APM_INSTRUMENTATION_LIBRARIES
- customizing APM librariesBy 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:
DD_APM_INSTRUMENTATION_LIBRARIES
- customizing APM librariesBy 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:
You can choose to enable or disable instrumentation for applications in specific namespaces. You can only set enabledNamespaces or disabledNamespaces, not both.
The file you need to configure depends on if you enabled Single Step Instrumentation with Datadog Operator or Helm:
To enable instrumentation for specific namespaces, add enabledNamespaces
configuration to datadog-agent.yaml
:
features:
apm:
instrumentation:
enabled: true
enabledNamespaces: # Add namespaces to instrument
- default
- applications
To disable instrumentation for specific namespaces, add disabledNamespaces
configuration to datadog-agent.yaml
:
features:
apm:
instrumentation:
enabled: true
disabledNamespaces: # Add namespaces to not instrument
- default
- applications
To enable instrumentation for specific namespaces, add enabledNamespaces
configuration to datadog-values.yaml
:
datadog:
apm:
instrumentation:
enabled: true
enabledNamespaces: # Add namespaces to instrument
- namespace_1
- namespace_2
To disable instrumentation for specific namespaces, add disabledNamespaces
configuration to datadog-values.yaml
:
datadog:
apm:
instrumentation:
enabled: true
disabledNamespaces: # Add namespaces to not instrument
- namespace_1
- namespace_2
Specify Datadog tracing libraries and their versions to automatically instrument applications written in those languages. You can configure this in two ways, which are applied in the following order of precedence:
Default: If you don’t specify any library versions and apm.instrumentation.enabled=true
, applications written in supported languages are automatically instrumented using the latest tracing library versions.
To automatically instrument applications in specific pods, add the appropriate language annotation and library version for your application in your pod spec:
Language | Pod annotation |
---|---|
Java | admission.datadoghq.com/java-lib.version: "<CONTAINER IMAGE TAG>" |
Node.js | admission.datadoghq.com/js-lib.version: "<CONTAINER IMAGE TAG>" |
Python | admission.datadoghq.com/python-lib.version: "<CONTAINER IMAGE TAG>" |
.NET | admission.datadoghq.com/dotnet-lib.version: "<CONTAINER IMAGE TAG>" |
Ruby | admission.datadoghq.com/ruby-lib.version: "<CONTAINER IMAGE TAG>" |
Replace <CONTAINER IMAGE TAG>
with the desired library version. Available versions are listed in the Datadog container registries and tracer source repositories for each language:
-musl
suffix, such as v2.29.0-musl
.)latest
tag, as major library releases may introduce breaking changes.For example, to automatically instrument Java applications:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
# ...
spec:
template:
metadata:
annotations:
admission.datadoghq.com/java-lib.version: "<CONTAINER IMAGE TAG>"
spec:
containers:
- # ...
If you don’t enable automatic instrumentation for specific pods using annotations, you can specify which languages to instrument across the entire cluster using the Single Step Instrumentation configuration. When apm.instrumentation.libVersions
is set, only applications written in the specified languages will be instrumented, using the specified library versions.
The file you need to configure depends on if you enabled Single Step Instrumentation with Datadog Operator or Helm:
For example, to instrument .NET, Python, and Node.js applications, add the following configuration to your datadog-agent.yaml
file:
features:
apm:
instrumentation:
enabled: true
libVersions: # Add any libraries and versions you want to set
dotnet: "3.2.0"
python: "1.20.6"
js: "4.17.0"
For example, to instrument .NET, Python, and Node.js applications, add the following configuration to your datadog-values.yaml
file:
datadog:
apm:
instrumentation:
enabled: true
libVersions: # Add any libraries and versions you want to set
dotnet: "3.2.0"
python: "1.20.6"
js: "4.17.0"
Datadog publishes instrumentation libraries images on gcr.io, Docker Hub, and Amazon ECR:
The DD_ADMISSION_CONTROLLER_AUTO_INSTRUMENTATION_CONTAINER_REGISTRY
environment variable in the Datadog Cluster Agent configuration specifies the registry used by the Admission Controller. The default value is gcr.io/datadoghq
.
You can pull the tracing library from a different registry by changing it to docker.io/datadog
, public.ecr.aws/datadog
, or another URL if you are hosting the images in a local container registry.
For instructions on changing your container registry, see Changing Your Container Registry.
If you don’t want to collect trace data for a particular service, host, VM, or container, complete the following steps:
To remove APM instrumentation and stop sending traces from a specific service, follow these steps:
Add the DD_INSTRUMENT_SERVICE_WITH_APM
environment variable to the service startup command:
DD_INSTRUMENT_SERVICE_WITH_APM=false <service_start_command>
Restart the service.
DD_INSTRUMENT_SERVICE_WITH_APM
environment variable to the service startup command:docker run -e DD_INSTRUMENT_SERVICE_WITH_APM=false <service_start_command>
admission.datadoghq.com/enabled:
label to "false"
for the pod spec:spec:
template:
metadata:
labels:
admission.datadoghq.com/enabled: "false"
kubectl apply -f /path/to/your/deployment.yaml
To stop producing traces, uninstall APM and restart the infrastructure:
dd-host-install --uninstall
dd-container-install --uninstall
systemctl restart docker
The file you need to configure depends on if you enabled Single Step Instrumentation with Datadog Operator or Helm:
Set instrumentation.enabled=false
in datadog-agent.yaml
:
features:
apm:
instrumentation:
enabled: false
Deploy the Datadog Agent with the updated configuration file:
kubectl apply -f /path/to/your/datadog-agent.yaml
Set instrumentation.enabled=false
in datadog-values.yaml
:
datadog:
apm:
instrumentation:
enabled: false
Run the following command:
helm upgrade datadog-agent -f datadog-values.yaml datadog/datadog
추가 유용한 문서, 링크 및 기사: