Single Step APM Instrumentation on Linux
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
On a Linux host or VM, use Single Step Instrumentation (SSI) for APM to install the Datadog Agent and instrument your applications in one step, with no additional configuration required.
Install the dd-apm skill in your AI coding agent for guided APM setup. Run this command:
npx skills add https://github.com/datadog-labs/agent-skills --skill dd-apm --full-depth -y
Enable APM on your applications
New Agent installation
If you don’t yet have a Datadog Agent installed, install the Agent and enable SSI in one step.
Run the following command on your Linux host or VM:
DD_API_KEY=<YOUR_DD_API_KEY> \
DD_SITE="" \
DD_APM_INSTRUMENTATION_ENABLED=host \
bash -c "$(curl -L https://install.datadoghq.com/scripts/install_script_agent7.sh)"
Replace <YOUR_DD_API_KEY> with your Datadog API key. The command installs or updates the Agent and the SSI packages.
By default, SSI installs the latest SDK versions. To pin specific versions, add the DD_APM_INSTRUMENTATION_LIBRARIES variable with comma-separated language:major pairs. Available versions are listed in the source repositories for each language: Java (java), Node.js (js), Python (python), .NET (dotnet), Ruby (ruby), PHP (php).
Restart your applications.
SSI adds a small amount of startup time to instrumented applications. If this overhead is not acceptable for your use case, contact
Datadog Support.
Generate the command from Datadog
To get a command pre-filled with your API key and site, go to the Install the Datadog Agent on Linux page and turn on Application Performance Monitoring under Core Observability.
To select SDK versions from dropdowns, click Customize Library Versions.
Then copy and run the generated command.
Existing Agent installation
If you already have a Datadog Agent installed, re-run the Agent installation command from New Agent installation on the host. The command updates the existing Agent and enables SSI.
Alternatively, use Fleet Automation to enable SSI from Datadog:
In Datadog, go to Fleet Automation > Configuration.
Click Configure Agents.
Apply filters to select the agents you want to configure, then click Next.
Click the Application Performance Monitoring (APM) tile, then click Next.
In the Configure SDKs Installation screen, click Yes to automatically install the SDKs. Select Use latest version, or uncheck to specify individual SDK versions.
Click Next.
Review your configuration and click Deploy Configuration.
Verify the installation
Confirm the Agent is running:
sudo datadog-agent status
Confirm that SSI injection is armed on the host:
cat /etc/ld.so.preload && ls /opt/datadog-packages/ | grep apm
The output lists the APM injector library in /etc/ld.so.preload and one or more datadog-apm-* packages.
After your applications receive traffic, confirm your services appear on the APM Services page. If they don’t appear within a few minutes, follow the SSI troubleshooting guide.
Unified Service Tags (USTs) apply consistent tags across traces, metrics, and logs, making it easier to navigate and correlate your observability data. Learn how to set USTs for Linux services.
Enable SDK-dependent products and features
After SSI loads the Datadog SDK into your applications and enables distributed tracing, you can configure additional products that rely on the SDK:
Note: All variables accept true or false. DD_PROFILING_ENABLED also accepts auto, which profiles only eligible processes and is recommended for SSI.
Use one of the following setup methods:
Advanced options
Update SDK version
The SDK version is fixed when you run the Agent installation command.
To update the SDK versions:
- Re-run the Agent installation command. This command also updates the Agent to the latest version.
- Restart your applications.
Define instrumentation rules
Instrumentation rules are not supported for your selected
Datadog site (
).
Instrumentation rules (available for Agent v7.73+) let you control which processes are automatically instrumented by SSI on Linux hosts.
To configure instrumentation rules:
In Datadog, go to APM > Service Setup > Manage Instrumentation Rules.
Click Add or Edit Rules.
Define instrumentation rules:
- Click Add New Rule, then choose Allow Rule or Block Rule to specify whether matching processes should be instrumented.
- Name your rule.
- Add one or more conditions. See Define rule conditions to learn more.
(Optional) Drag and drop rules to reorder them.
Note: Rules are evaluated in order. After a process matches a rule, subsequent rules are ignored.
Set the default behavior (allow or block) for processes that do not match any rule.
Click Next to preview your rules.
Click Deploy Rules.
If Remote Configuration is enabled, rules are deployed to every host and applied on those with SSI enabled within 50 seconds. Alternatively, click Export to export the configuration file and apply it manually to your hosts.
Define rule conditions
Each rule consists of one or more conditions. A condition includes the following elements:
- Attribute: The process property that the rule evaluates.
- Operator: The comparison logic (
equals, not equals, prefix, or contains). - Value: The text or pattern to match, such as a process name or command-line flag.
Supported attributes include:
| Attribute | Description | Example |
|---|
| Operating System | OS of the host. | linux |
| Executable | Executable name of the process. | python3.11 |
| Executable Full Path | Full path of the executable. | /usr/bin/python3.11 |
| Arguments | Command-line arguments used to start the process. | --env=production |
| Working Directory | Working directory of the process. | /app |
| Language | Programming language detected for the process. | python |
| Entry Point File | The specific file used to launch the application. | app.py, server.js |
Example use cases
Review the following examples demonstrating how to apply instrumentation rules:
Instrument all processes by default. Add block rules to exclude services that would add noise without value, such as analytics cron jobs and Java batch processors.
Block all instrumentation by default. Add allow rules to opt specific processes into APM. This approach gives you precise control and works well for gradual rollouts.
For example, to instrument only a checkout service and a customer portal, create allow rules using
Working Directory, then set the default behavior to
Block Instrumentation.
Remove Single Step APM instrumentation from your Agent
To stop producing traces for all services on your infrastructure:
- Run:
dd-host-install --uninstall
- Restart the services on the host or VM.
Troubleshooting
If you encounter problems enabling APM with SSI, see the SSI troubleshooting guide.
Further reading
Documentation, liens et articles supplémentaires utiles: