The Dynatrace platform offers two service detection approaches: Service Detection v2 (SDv2) and Service Detection v1 (SDv1). Use this page to decide which approach fits your workload.
In most cases, SDv2 is the recommended approach. SDv2 is the only option for OpenTelemetry services and the recommended default for Kubernetes and AWS Lambda. SDv1 remains the right choice in specific cases, for example, for workload types that host multiple applications in a single process.
SDv2 and SDv1 differ in the signals they evaluate to detect a service.
SDv2 detects services through attribute-based rules evaluated against incoming spans. Built-in rules cover common sources, such as OpenTelemetry and Kubernetes, and you can add your own service detection rules when required. Because service detection rules rely on resource attributes, such as service.name or k8s.workload.name, SDv2 treats OpenTelemetry and OneAgent data the same way. For OneAgent-monitored workloads, SDv2 maps each process to one service.
SDv1 is the original service detection for OneAgent-instrumented processes. SDv1 detects services from technology-specific details in the span, such as the invoked Java classes or the web application context. Then it sorts services into several service types: web request services, web services, database services, messaging services, remote services, background activities, and custom services. Because of this, SDv1 can split one process into multiple services, for example, one service per deployed web application.
| Aspect | SDv2 | SDv1 |
|---|---|---|
| Service detection | Rule-based. Attribute-based rules are evaluated against every span. | Technology-specific. Detection is based on code-level content and anchored to a process group of a OneAgent-instrumented process. |
| Data sources | OpenTelemetry and OneAgent | OneAgent-instrumented processes |
| Service granularity | One service per process | One process can be split into multiple services |
| Service naming | Derived from resource attributes and customizable through attribute-based rules that apply consistently across every span. | Built-in and custom service naming rules that set the display name on the service entity only. |
| Custom service definitions | The class or method you define becomes a span on the service it runs in. No separate service is created. | The class or method you define becomes the entry point of a separate custom service. |
Choose SDv2 for the following use cases:
Across all these workloads, SDv2 provides one naming model: service names come from resource attributes, so spans, logs, and metrics use the same name, and you maintain detection and naming through attribute-based rules instead of per-technology configuration.
For OneAgent-monitored workloads, you activate SDv2 manually for each deployment scenario. For details, see Configure service detection for OneAgent in Service Detection v2 (Services Classic).
Keep SDv1 for the following use cases:
Application servers and multi-service processes: Use SDv1 when a single process runs multiple applications, for example, a JVM on IBM WebSphere, Oracle WebLogic, another J2EE server with several deployed applications, or Adobe ColdFusion with multiple contexts. SDv1 detects a separate service for each application.
SDv2 doesn't work for this use case because it maps the entire process to a single service, and the applications can't be distinguished.
Background or scheduled workloads with no inbound request: Use SDv1 for workloads that are timer-, cron-, or thread-triggered.
SDv2 doesn't work for this use case because detection is built around inbound request spans.
Mainframe workloads: SDv1 remains the recommended approach for mainframe workloads.
Dependencies on SDv1 custom services or service IDs: Keep SDv1 until you've updated everything that references those custom services or service IDs.
Because SDv2 assigns new service IDs and SDv1 custom services become spans on the service they run in, custom services no longer have their own service ID. For details, see Migration considerations.
When you move a workload from SDv1 to SDv2, note the following:
Yes. Service detection is set per workload, not per environment. Workloads that match the SDv2 matching condition in the service detection rule use SDv2, and all other OneAgent-monitored workloads keep using SDv1. For example, you can use SDv2 for a Kubernetes cluster and keep SDv1 for application servers on other hosts. OpenTelemetry data always uses SDv2.
When services from both approaches call each other, the trace connects them across the boundary, so you see the full call chain.
Yes. To switch back, change the matching condition of the relevant service detection rule so that the workload no longer matches. OneAgent then uses SDv1 again for that workload.
When you switch back:
Historical data stays with the SDv1 services and remains available for the configured retention period. This data is not moved to the new SDv2 services.