Application Instrumentation is the process of adding code to your application to capture and report observability data to Datadog, such as traces, metrics, and logs.Glossary with Datadog APM involves:
SDK setup: Adding a Datadog SDK to your application.
Span creation: Capturing observability data as A span is a logical unit of work in a distributed system for a given period.Glossarys.
Spans are automatically generated by default as soon as the SDK is loaded. This is known as auto-instrumentation and provides sufficient visibility for most users. If you need more control, you can optionally add custom spans.
Note: These steps assume you have a Datadog Agent installed and configured to receive traces.
Getting started
Prefer vendor-neutral instrumentation? See the OpenTelemetry documentation for using OpenTelemetry with Datadog.
Single step instrumentation (recommended)
Single Step Instrumentation (SSI) automatically installs and configures Datadog SDKs with a single command. Auto-instrumentation then immediately begins capturing traces from your supported frameworks and libraries, with no code changes required.
These options can be combined. For example, you can start with Single Step Instrumentation and add code-based custom instrumentation for specific spans, or use manually managed SDKs with Dynamic Instrumentation for no-deploy span additions.
Detailed comparison
SDK setup
Single Step Instrumentation is the recommended starting point for most users. If you need more control over SDK configuration, you can use manually managed SDKs instead:
Datadog automatically installs and loads SDKs into your application processes, at runtime, with a single command.
You install and configure SDKs directly in your application code or build process.
Code changes?
No
Yes
Setup complexity
Low - minimal configuration needed
Medium - requires environment and build configuration
Configuration control
Standard defaults with optional overrides
Full control through environment variables and code
When to use
Start here for fast, consistent instrumentation across services without code changes.
Progress to this when you need granular control over SDK behavior and configuration.
Span customization
Auto-instrumentation automatically creates spans for supported frameworks and libraries, providing essential observability with no additional work. When you need visibility into custom code paths or want to enrich traces with application-specific data, you can add custom spans using either Dynamic Instrumentation or code-based custom instrumentation:
Configure instrumentation rules in the Datadog UI; rules are applied at runtime.
Add explicit tracing API calls in your application code.
Code changes?
No
Yes
Deployment required
No
Yes (to add or modify spans)
When to use
Add custom spans without code changes or redeployments.
Progress to this when you need complex instrumentation logic or want spans permanently defined in code.
APM setup tutorials
The following tutorials guide you through setting up distributed tracing for a sample application on various infrastructure scenarios, with both automatic and custom instrumentation: