dt-dql-essentials

Write, fix, and optimize Dynatrace DQL queries using syntax rules and reference patterns.

Updated Dec 12, 2025
One-click install
npx skills add https://github.com/ricardojjulia/ESACompanion --skill dt-dql-essentials-ricardojjulia
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dt-dql-essentials
Source: https://github.com/ricardojjulia/ESACompanion/tree/main/.github/skills/dt-dql-essentials
Command: npx skills add https://github.com/ricardojjulia/ESACompanion --skill dt-dql-essentials-ricardojjulia

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing correct Dynatrace Query Language (DQL) queries is error-prone because DQL differs significantly from SQL, and inefficient queries scan excessive data, driving up execution time and query consumption costs. This Skill provides the syntax rules, common pitfalls, and optimization patterns needed to produce correct, fast, and cost-efficient DQL. ## Core Features & Use Cases - Syntax Pitfall Prevention: A lookup table of common mistakes (e.g., = vs ==, log.level vs loglevel, dt.entity.* vs dt.smartscape.*) with the correct DQL equivalents. - Query Optimization: Guidance on filtering early, bucket filters, short time ranges, field selection, sampling, and cardinality limits to reduce scanned data and lower query cost. - Command & Function Reference Index: Routing tables to detailed specs for all DQL commands (fetch, timeseries, summarize, makeTimeseries, lookup, join) and function groups (aggregation, array, string, time, smartscape). - Use Case: When asked to build a timeseries of error rates per Kubernetes cluster, load this Skill to correctly combine fetch logs, makeTimeseries with countIf, and iterative array expressions — avoiding silent failures like missing rollup: parameters. ## Quick Start Ask the AI to write or optimize a DQL query, for example to build a timeseries of error counts per service over the last 24 hours.

Frequently Asked Questions about dt-dql-essentials

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a DQL query in Dynatrace?▼

DQL queries start with a fetch command like `fetch logs` or `timeseries avg(metric.key)`, then chain commands with pipes to filter, transform, and aggregate. Use `filter` for conditions, `summarize` for aggregation, and always specify a time range with `from:`.

How do I optimize a slow or expensive DQL query?▼

Filter immediately after fetch, use the shortest necessary time range, apply bucket filters, select only needed fields, and avoid grouping by high-cardinality fields like trace IDs. Reducing scanned data makes queries both faster and cheaper to run.

What is the difference between timeseries and makeTimeseries in DQL?▼

The `timeseries` command queries pre-ingested metrics, while `makeTimeseries` builds time-bucketed series from event data like logs or spans in a pipeline. Do not pipe `timeseries` output into `makeTimeseries`, as it fails with an implicit time default error.

Why does my DQL percentile or median query return no results?▼

The `percentile`, `median`, and `percentRank` functions in the `timeseries` command require a `rollup:` parameter such as `rollup: avg`. Without it, the query silently returns empty results instead of raising an error.

Does DQL support wildcards in equality filters?▼

No, the `==` operator does not support wildcards in DQL. Use `matchesValue()` for patterns with `*` at the start or end, or `contains()` for substring matching on string fields.

When should I not use this DQL writing skill?▼

Do not use it to explain existing queries or answer product questions, and do not use it to monitor actual tenant query consumption or billing. For consumption and cost trend analysis, use the dt-platform-costs skill instead.