Service Detection v2 (SDv2) allows you to define services based on span resource attributes. You can use the default Dynatrace detection rules and also define your own custom rules. The same rules are also applied to log and metric ingest which allows Dynatrace to link the input of all sources together.
This page describes service detection for SDv2, how to use default detection rules, and how to create your own custom rules.
Since the introduction of unified services, Dynatrace has provided several default service detection rules.
Priority
Condition
Service name
1
adobe.em.tier
, adobe.em.env_type
, adobe.em.program
attributes present
aem-{adobe.em.tier}-{adobe.em.env_type}-{adobe.em.program}
2
k8s.workload.name
attribute present
{k8s.workload.name}
3
dt.kubernetes.workload.name
attribute present
{dt.kubernetes.workload.name}
4
istio.canonical_service
attribute present
{istio.canonical_service}
5
service.name
attribute present
{service.name}
The service ID is a unique identifier, such as SERVICE-649B4E44CBA804F4
, that is the result of hashing the attribute values that are used as part of the name pattern, additional service detection attributes, and service splitting attributes, when applicable.
Detection rules are customized in Settings > Process and contextualize > Services > Service detection.
In Service detection, select Add rule.
Fill in the following optional and required fields:
Rule name: required
A user-defined name for the rule.
Description: optional
A human-readable descriptor of the rule.
Matching condition: required
A DQL matcher. If the matching condition applies, the rule is evaluated.
Service name template: required
The name that you want the service to have.
You can use plain text, or resource attributes surrounded by curly braces ({}
).
For the rule to be applied, the span must contain all the specified resource attributes.
Changing the static parts of the template or re-ordering the used attributes will not affect the service ID. Only completely removing an attribute or adding a new attribute will also change the service ID.
Additional service detection attributes: optional
Additional attributes used to detect and split services without affecting the generated name.
Each attribute consists of a resource attribute specified without curly braces (for example, service.name
or k8s.workload.name
).
Adding or removing attributes in this section will change the resulting service ID.
Up to 10 additional service detection attributes can be applied.
Select Save changes.
You can re-order custom rules.
You can also edit a custom rule.
To delete a custom rule
You can delete only custom rules, not the built-in rules.
To remove an attribute that was used as part of the service name without also changing the service ID
This way, it will still contribute to the service ID, but it will no longer be part of the service name.
Verify that all the attributes used as parts of the Service name template and Additional service detection attributes also exist on the spans. The existence of those attributes is an implicit matching condition.