К основному содержанию
скилл CX Codex

dt-migration — скилл для Claude Code: что делает и как установить

Скилл помогает переписать классические и Gen2-запросы Dynatrace DQL на модель Smartscape. Полезен при миграции старых фильтров сущностей и выборок.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add Dynatrace/dynatrace-for-ai --skill dt-migration -a claude-code
Открыть на GitHub

Что делает dt-migration

Скилл разбирает классические DQL-запросы к сущностям Dynatrace и переводит их в синтаксис Smartscape. Он разделяет миграцию на три сценария: фильтрация больших массивов данных, использование подзапросов с сущностями и прямые списки через smartscapeNodes. При работе с логами и метриками инструмент сначала проверяет прямые фильтры по измерениям сырых данных, а не переносит всё в Smartscape без разбора.

Внутри заложены правила сопоставления типов и конструкций: замена classicEntitySelector, преобразование связей runs или belongs_to в обход через traverse, а также вызовы getNodeName вместо устаревших функций. Сущности вроде HOST или PROCESS получают прямые соответствия, тогда как группы хостов переводятся в атрибуты родительских узлов.

Скилл отвечает только за логику запросов DQL и не охватывает миграцию настроек на уровне ассетов. Перед финальной записью DQL потребуется предварительно подключить скилл dt-dql-essentials, иначе итоговый запрос может нарушить актуальные синтаксические правила платформы.

Какие задачи решает

  • переписать выборки fetch dt.entity.* на вызовы smartscapeNodes
  • заменить фильтры classicEntitySelector на условия по измерениям
  • перевести связи belongs_to и runs в операции traverse
  • заменить вызовы entityName и entityAttr на актуальные функции узлов

Примеры запросов агенту

  • Переведи запрос с fetch dt.entity.host на выборку через smartscapeNodes.
  • Перепиши фильтр с classicEntitySelector в запросе метрик на прямые измерения.
  • Обнови связи runs[...] и вызовы entityName в DQL под синтаксис Smartscape.

Как установить dt-migration

1Через Skills CLI (Vercel)

npx skills add Dynatrace/dynatrace-for-ai --skill dt-migration -a claude-code

2Вручную: положить файлы

~/.claude/skills/dt-migration/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/dt-migration/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о dt-migration

Как установить dt-migration в Claude Code?

Выполните команду npx skills add Dynatrace/dynatrace-for-ai --skill dt-migration -a claude-code.

Для чего нужен скилл dt-migration?

Он помогает переводить устаревшие запросы Dynatrace DQL с классических сущностей Gen2 на модель узлов и связей Smartscape.

Что нужно подготовить перед запуском миграции?

Сначала требуется загрузить скилл dt-dql-essentials, чтобы итоговые запросы соответствовали действующим правилам синтаксиса Dynatrace.

Исходный текст

SKILL.md · Apache-2.0
---
name: dt-migration
description: Migrate Dynatrace classic and Gen2 entity-based DQL to Smartscape equivalents. Covers three scenarios. (1) mass data queries filtered by classic entity conditions — migrate to direct dimension filters first, Smartscape only as fallback; (2) mass data queries using entity subqueries for filtering — same dimension-first strategy; (3) pure entity list queries — migrate fetch dt.entity.* to smartscapeNodes. Also handles entityName, entityAttr, classicEntitySelector, and classic relationship patterns.
license: Apache-2.0
---

# Smartscape Migration Skill

This skill migrates Dynatrace classic and Gen2 entity-based DQL queries and query patterns to Smartscape-based equivalents.

Load the **dt-dql-essentials** skill before writing final DQL so the translated query also follows current DQL syntax rules.

This skill focuses on Smartscape-oriented DQL migration only. It does not cover asset-level migration workflows.

## Query Purpose Classification

**Start here.** The correct migration strategy depends on what the query is actually trying to do — not just which classic constructs it uses.

There are three distinct situations:

| # | Situation | Classic anti-pattern | Migration strategy |
| --- | --- | --- | --- |
| 1 | Mass data query filtered by entity conditions | `classicEntitySelector(...)` inline in `filter:` of a timeseries, logs, or metrics query | Resolve entity conditions to raw data dimensions first. Smartscape is a fallback, not the default. |
| 2 | Mass data query using entity subquery for filtering | `fetch dt.entity.*` inside `in [...]`, `lookup [...]`, or `join [...]` to filter the outer mass data query | Same dimension-first strategy. Rewrite as raw dimension filter or `in [smartscapeNodes ...]` subquery. |
| 3 | Pure entity list query | `fetch dt.entity.*` used standalone or as the primary result source | `smartscapeNodes` is the only valid path. No raw dimension alternative exists. |

**Decision:**

- **Situations 1 or 2** — load [references/mass-data-filtering-strategy.md](references/mass-data-filtering-strategy.md) and complete **all steps** including field discovery (Step 2) and equivalence verification (Step 4). Do not skip the `fieldsSnapshot` gates — they determine which approach is viable. Only fall back to the Migration Workflow below when the entity-type mapping or relationship traversal is needed to complete a Smartscape subquery.
- **Situation 3** — continue with the Migration Workflow and entity mapping table below.

> Note: Situation 3 has a sub-case where `classicEntitySelector` is used to filter the entities returned by `fetch dt.entity.*`. This is rare and follows the same `smartscapeNodes` path — resolve the selector conditions using [references/mass-data-filtering-strategy.md](references/mass-data-filtering-strategy.md) Step 1B, then apply them as node filters in `smartscapeNodes`.

## Migration Workflow

Follow this order for **Situation 3** (pure entity list queries) and for constructing Smartscape subqueries in Situations 1 and 2:

1. Identify the classic input pattern:
   - `fetch dt.entity.*`
   - `classicEntitySelector(...)`
   - relationship field access such as `belongs_to[...]`, `runs[...]`, `instance_of[...]`
   - signal or event queries using `dt.entity.*`
2. Identify the involved classic entity types.
3. Look up the Smartscape replacement in the core entity mapping table below.
4. Check which classic DQL constructs need explicit migration.
5. Rewrite the query using Smartscape primitives:
   - `smartscapeNodes`
   - `smartscapeEdges`
   - `traverse`
   - `references`
   - `getNodeName()`
   - `getNodeField()`
6. Check for special cases, unsupported entities, or ID assumptions.
7. Load the matching detailed references for the specific entity family or migration pattern.

For the full migration process and output expectations, load [references/migration-workflow.md](references/migration-workflow.md).

## Core Entity Mapping Table

Use this compact table first for common migrations. For the full mapping set, load [references/type-mappings.md](references/type-mappings.md).

| Classic / Gen2 entity | Smartscape field | Smartscape node type | Notes |
| --- | --- | --- | --- |
| `dt.entity.host` | `dt.smartscape.host` | `HOST` | Standard host mapping |
| `dt.entity.service` | `dt.smartscape.service` | `SERVICE` | Standard service mapping |
| `dt.entity.process_group_instance` | `dt.smartscape.process` | `PROCESS` | Process instance maps directly |
| `dt.entity.container_group_instance` | `dt.smartscape.container` | `CONTAINER` | Container-group instance maps directly |
| `dt.entity.kubernetes_cluster` | `dt.smartscape.k8s_cluster` | `K8S_CLUSTER` | Kubernetes cluster |
| `dt.entity.kubernetes_node` | `dt.smartscape.k8s_node` | `K8S_NODE` | Kubernetes node |
| `dt.entity.kubernetes_service` | `dt.smartscape.k8s_service` | `K8S_SERVICE` | Kubernetes service |
| `dt.entity.cloud_application` | multiple workload fields | multiple K8S workload node types | Maps to multiple workload types; load the cloud-application guide |
| `dt.entity.cloud_application_instance` | `dt.smartscape.k8s_pod` | `K8S_POD` | Classic cloud app instance becomes pod |
| `dt.entity.cloud_application_namespace` | `dt.smartscape.k8s_namespace` | `K8S_NAMESPACE` | Namespace mapping |
| `dt.entity.application` | `dt.smartscape.frontend` | `FRONTEND` | Frontend application mapping |
| `dt.entity.aws_lambda_function` | `dt.smartscape.aws.lambda_function` | `AWS_LAMBDA_FUNCTION` | Cloud-function entity mapping |

## DQL Constructs to Inspect During Migration

These classic constructs usually need explicit rewriting:

| Classic construct | Typical Smartscape replacement | Notes |
| --- | --- | --- |
| `entityName(x)` | `name` or `getNodeName(x)` | Prefer `name` when querying nodes directly |
| `entityAttr(x, "...")` | direct node field or `getNodeField(x, "...")` | Prefer direct fields when available |
| `classicEntitySelector(...)` | node filters plus `traverse` | Start from the constrained side; for mass data queries see mass-data-filtering-strategy.md first |
| `dt.entity.*` in signal queries | `dt.smartscape.*` | Applies to `by`, `filter`, `fieldsAdd`, `expand`, and related clauses |
| `belongs_to[...]`, `runs[...]`, `instance_of[...]` | `traverse` or `references[...]` | `references` works only for static edges |
| classic entity ID filters | Smartscape `id` | Do not reuse classic IDs blindly |
| `affected_entity_ids` and `affected_entity_types` | `smartscape.affected_entities` | One record array replaces the two parallel arrays; each record has `id`, `type`, and `name` |

For the detailed function-by-function guide, load [references/dql-function-migration.md](references/dql-function-migration.md).

## Special Cases

Do not translate these patterns literally:

- **Host group** — no standalone Smartscape entity; use fields on `HOST`
- **Process group** — no standalone Smartscape entity; use fields on `PROCESS`
- **Container group** — no standalone Smartscape entity; preserve output shape with placeholders if needed
- **Classic IDs** — classic entity IDs do not carry over to Smartscape automatically
- **Planned, missing, or not-planned mappings** — check the full mapping table before assuming direct support

Load [references/special-cases.md](references/special-cases.md) before migrating these patterns.

## Entity-Focused Guides

When a migration centers on a specific entity family, load the matching detailed guide:

- [references/entity-host.md](references/entity-host.md)
- [references/entity-service.md](references/entity-service.md)
- [references/entity-process.md](references/entity-process.md)
- [references/entity-container.md](references/entity-container.md)
- [references/entity-kubernetes.md](references/entity-kubernetes.md)
- [references/entity-cloud-application.md](references/entity-cloud-application.md)

Each guide explains:

- what the classic entity represented
- what the Smartscape replacement is
- which fields usually change
- how relationships are migrated
- common examples and pitfalls

## References

- [references/README.md](references/README.md) — Reference index and reading guide
- [references/mass-data-filtering-strategy.md](references/mass-data-filtering-strategy.md) — **Start here for Situations 1 and 2.** Mandatory steps: resolve conditions, run fieldsSnapshot discovery, select approach, write query, verify equivalence
- [references/auto-tagging-field-mapping.md](references/auto-tagging-field-mapping.md) — Maps auto-tagging rule condition keys to semantic dictionary fields (mass data and Smartscape node attributes)
- [references/entity-selector-predicates.md](references/entity-selector-predicates.md) — Full predicate vocabulary for `classicEntitySelector` expressions
- [references/migration-workflow.md](references/migration-workflow.md) — End-to-end migration process and output expectations
- [references/type-mappings.md](references/type-mappings.md) — Full classic-to-Smartscape type and field mappings
- [references/dql-function-migration.md](references/dql-function-migration.md) — How to migrate classic DQL functions and patterns
- [references/relationship-mappings.md](references/relationship-mappings.md) — Valid Smartscape edges and traversal guidance
- [references/special-cases.md](references/special-cases.md) — Non-literal and unsupported entity migrations
- [references/quick-reference.md](references/quick-reference.md) — Compact rules and gotchas
- [references/examples.md](references/examples.md) — Before/after migration examples

© Dynatrace · Apache-2.0 · Dynatrace/dynatrace-for-ai

Похожие скиллы

Всё по теме «DevOps и инфраструктура» →
dtctl Dynatrace Управляет Dynatrace через CLI: исследует инциденты, логи, трассировки и состояние сервисов. Пригодится для запросов DQL и работы с дашбордами. CX Codex +1 1 300установок Dynatrace Expert официальный github Субагент подключает наблюдаемость и безопасность Dynatrace прямо к рабочим процессам в репозитории. Он разбирает инциденты, валидирует релизы и ищет уязвимости по логам и спанам. ★ 40 418звёзд репо arize-phoenix-migration arize Переносит трейсы, датасеты, эксперименты и сохранённые оценки из Phoenix в Arize AX и проверяет, что записи доехали. CX Codex +1 467установок tigris-s3-migration tigrisdata Скилл ведёт миграцию объектного хранилища с AWS S3, GCS или Azure Blob на Tigris. Пригодится, когда нужно переключить бакет без остановки продакшена. CX Codex +1 3 100установок d1-migration jezweb Ведёт миграции Cloudflare D1 через Drizzle: генерация SQL, проверка на опасные места, применение к локальной и удалённой базе, починка зависших миграций. CX Codex +1 1 200установок migration adobe Скилл для перевода легаси-проекта AEM 6.x, AMS или on-prem на AEM as a Cloud Service: сначала разбор проекта, потом починка одного блокера за сессию. CX Codex +1 918установок

Из того же набора29

dt-obs-services Скилл для анализа производительности сервисов в Dynatrace: RED-метрики, SLA, service mesh и рантайм-метрики Java, .NET, Node.js, Python, PHP и Go. CX Codex +1 2 600установок dt-obs-tracing Скилл для анализа распределённых трейсов Dynatrace: медленные запросы, упавшие спаны, зависимости между сервисами. Пригодится, когда копаешь вглубь одного запроса. CX Codex +1 2 600установок dt-obs-aws Помогает анализировать инфраструктуру AWS через Dynatrace Smartscape и запросы DQL: инвентарь ресурсов, топологию VPC и расходы на облако. CX Codex +1 2 500установок dt-obs-frontends Скилл для работы с Real User Monitoring в Dynatrace: Core Web Vitals, сессии, ошибки фронтенда и связь с бэкендом через DQL. CX Codex +1 2 500установок dt-obs-predictive-analytics Скилл для прогноза метрик Dynatrace: считает тренды, насыщение ресурсов и аномалии по хостам и сервисам. Нужен, когда планируешь ёмкость или ищешь, что изменилось. CX Codex +1 2 100установок dt-obs-gcp Скилл для работы с ресурсами Google Cloud через Dynatrace Smartscape и DQL: инвентаризация, топология, аудит доступов. Пригодится, когда нужно разобраться, что реально крутится в GCP. CX Codex +1 2 000установок dt-obs-azure Скилл учит агента анализировать ресурсы Azure через Dynatrace Smartscape и DQL. Пригодится при аудите сетевой топологии, проверке настроек безопасности и анализе инфраструктуры. CX Codex +1 2 000установок dt-alerting Скилл ведёт по всему циклу алертинга в Dynatrace: выбор детектора аномалий, хранение событий в Grail, группировка проблем и маршрутизация уведомлений. CX Codex +1 1 800установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой