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 allows you to automatically instrument your application, without any additional installation or configuration steps.
To get started, read the Single Step Instrumentation documentation.
To automatically instrument your application with Datadog libraries:
- Install and configure the Agent.
- Add the Datadog tracing library to your code.
Install and configure the Datadog Agent to receive traces from your instrumented application. By default, the Datadog Agent is configured to receive traces in your datadog.yaml
file under apm_config
with enabled: true
and listens for trace data at http://localhost:8126
.
For containerized environments, follow the links below to enable trace collection within the Datadog Agent.
Containers
- Set
apm_non_local_traffic: true
in the apm_config
section of your main datadog.yaml
configuration file. - See the specific setup instructions to ensure that the Agent is configured to receive traces in a containerized environment:
The trace client attempts to send traces to the Unix domain socket /var/run/datadog/apm.socket
by default. If the socket does not exist, traces are sent to http://localhost:8126
.
If a different socket, host, or port is required, use the DD_TRACE_AGENT_URL
environment variable. For example:
DD_TRACE_AGENT_URL=http://custom-hostname:1234
DD_TRACE_AGENT_URL=unix:///var/run/datadog/apm.socket
Similarly, the trace client attempts to send stats to the /var/run/datadog/dsd.socket
Unix domain socket. If the socket does not exist, then stats are sent to http://localhost:8125
.
- Set
DD_SITE
in the Datadog Agent to
to ensure the Agent sends data to the right Datadog location.
AWS Lambda
To set up Datadog APM in AWS Lambda, see the Tracing Serverless Functions documentation.
Other environments
Tracing is available for several other environments, such as Heroku, Cloud Foundry, AWS Elastic Beanstalk, and Azure App Service.
For other environments, see the Integrations documentation for that environment and contact support if you are encountering any setup issues.
Instrument your application
Set up your application to send traces using one of the following official Datadog tracing libraries:
To instrument an application written in a language that does not have official library support, see the list of community tracing libraries.