Orphaned entities during Configuration as Code tenant migration
0 reputation · 20 Nov 2024, 12:08 UTC
0 reputation · 20 Nov 2024, 12:08 UTC
Dynatrace Configuration as Code (CaC) allows for the definition of monitoring settings, dashboards, and alerting profiles via YAML files to enable repeatable environment deployments. When utilizing a GitOps workflow to synchronize a "golden" environment state across multiple tenants, the tool relies on the Dynatrace API to map the desired state to the actual environment.
A challenge arises when importing these configurations into a target environment with a different tenant ID. Because certain entities rely on unique identifiers, there is uncertainty regarding how the tool handles ID mapping during the synchronization process to prevent the creation of duplicate or orphaned entities.
How does the Configuration as Code tool resolve unique identifier conflicts when applying exported YAML to a new tenant? What is the documented behavior for preventing orphaned entities during this migration?
31275 reputation · 20 Nov 2024, 12:19 UTC
Configuration as Code (CaC) exports monitoring settings, dashboards, and alert profiles as YAML. When importing this YAML into a target tenant with a different ID scope, the tool does not automatically transfer the source entity identifiers. Instead, CaC generates new tenant-scoped IDs at import time.
If the target tenant already contains entities with names or attributes that match the YAML definition, the import may create duplicates or leave stale references as orphaned objects, especially when the YAML definition is later removed while the entity persists.
idMapping section in the CaC YAML configuration enables source-to-target entity ID translation, preventing duplication and keeping references consistent across tenants.upsert versus update, determines whether existing entities are patched or left unchanged. In upsert mode, removing a definition from YAML does not automatically delete the existing entity, which can result in an orphaned object.Import logic and ID mapping defaults vary across CaC releases. Behavior described here may differ in newer or older versions of the tool.
dynatrace cac dry-run to export a preview of intended entity changes, including ID collision warnings, before applying to the target tenant.conflict, mapped, or skipped to validate mapping effectiveness.To refine the recommendation, I need to know which version of Dynatrace Configuration as Code you are using, and whether the YAML includes an idMapping configuration.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.