Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计通过

dt-dql-essentialsdt dql 要点

Agent Skill

dt-dql-essentials 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

6,879

周安装

281

GitHub Stars

59

下载量

2,203
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:dt-dql-essentials(dt dql 要点)
来源仓库:https://github.com/dynatrace/dynatrace-for-ai
仓库路径:skills/dt-dql-essentials
安装命令:
npx skills add https://github.com/dynatrace/dynatrace-for-ai --skill dt-dql-essentials
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/dynatrace/dynatrace-for-ai --skill dt-dql-essentials

简介

dt-dql-essentials 提供 DQL 查询语言的语法要点和最佳实践参考。

  • 适用于数据查询、过滤聚合和统计分析等数据操作场景。
  • 包含管道命令链、Smartscape 拓扑导航和语义字典等核心模式。
  • 使用前应加载相关参考文件,确保查询符合当前数据模型规范。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

DQL Essentials Skill

DQL is a pipeline-based query language. Queries chain commands with | to filter, transform, and aggregate data. DQL has unique syntax that differs from SQL — load this skill before writing any DQL query.


Use Cases

Use caseReference
Useful expressions in DQLreferences/useful-expressions.md
Smartscape topology navigation syntax and patternsreferences/smartscape-topology-navigation.md
Dynatrace Semantic Dictionary: field namespaces, data models, stability levels, query patterns, and best practicesreferences/semantic-dictionary.md
Various applications of summarize and makeTimeseries commandsreferences/summarization.md
Operators (in, time alignment @)references/operators.md
Array and timeseries manipulation (creation, modifications, use in filters) using DQLreferences/iterative-expressions.md
Query optimization (filter early, time ranges, field selection, performance)references/optimization.md

DQL Reference Index

DescriptionItems
Data Typesarray, binary, boolean, double, duration, long, record, string, timeframe, timestamp, uid
Parameter Value Typesbucket, dataObject, dplPattern, entityAttribute, entitySelector, entityType, enum, executionBlock, expressionTimeseriesAggregation, expressionWithConstantValue, expressionWithFieldAccess, fieldPattern, filePattern, identifierForAnyField, identifierForEdgeType, identifierForFieldOnRootLevel, identifierForNodeType, joinCondition, jsonPath, metricKey, metricTimeseriesAggregation, namelessDplPattern, nonEmptyExecutionBlock, prefix, primitiveValue, simpleIdentifier, tabularFileExisting, tabularFileNew, url
Commandsappend, data, dedup, describe, expand, fetch, fields, fieldsAdd, fieldsFlatten, fieldsKeep, fieldsRemove, fieldsRename, fieldsSnapshot, fieldsSummary, filter, filterOut, join, joinNested, limit, load, lookup, makeTimeseries, metrics, parse, search, smartscapeEdges, smartscapeNodes, sort, summarize, timeseries, traverse
Functions — Aggregationavg, collectArray, collectDistinct, correlation, count, countDistinct, countDistinctApprox, countDistinctExact, countIf, max, median, min, percentRank, percentile, percentileFromSamples, percentiles, stddev, sum, takeAny, takeFirst, takeLast, takeMax, takeMin, variance
Functions — ArrayarrayAvg, arrayConcat, arrayCumulativeSum, arrayDelta, arrayDiff, arrayDistinct, arrayFirst, arrayFlatten, arrayIndexOf, arrayLast, arrayLastIndexOf, arrayMax, arrayMedian, arrayMin, arrayMovingAvg, arrayMovingMax, arrayMovingMin, arrayMovingSum, arrayPercentile, arrayRemoveNulls, arrayReverse, arraySize, arraySlice, arraySort, arraySum, arrayToString, vectorCosineDistance, vectorInnerProductDistance, vectorL1Distance, vectorL2Distance
Functions — BitwisebitwiseAnd, bitwiseCountOnes, bitwiseNot, bitwiseOr, bitwiseShiftLeft, bitwiseShiftRight, bitwiseXor
Functions — Booleanexists, in, isFalseOrNull, isNotNull, isNull, isTrueOrNull, isUid128, isUid64, isUuid
Functions — CastasArray, asBinary, asBoolean, asDouble, asDuration, asIp, asLong, asNumber, asRecord, asSmartscapeId, asString, asTimeframe, asTimestamp, asUid
Functions — Constante, pi
Functions — ConversiontoArray, toBoolean, toDouble, toDuration, toIp, toLong, toSmartscapeId, toString, toTimeframe, toTimestamp, toUid, toVariant
Functions — Createarray, duration, ip, record, smartscapeId, timeframe, timestamp, timestampFromUnixMillis, timestampFromUnixNanos, timestampFromUnixSeconds, uid128, uid64, uuid
Functions — CryptographichashCrc32, hashMd5, hashSha1, hashSha256, hashSha512, hashXxHash32, hashXxHash64
Functions — EntitiesclassicEntitySelector, entityAttr, entityName
Functions — Time series aggregation for expressionsavg, count, countDistinct, countDistinctApprox, countDistinctExact, countIf, end, max, median, min, percentRank, percentile, percentileFromSamples, start, sum
Functions — Flowcoalesce, if
Functions — GeneraljsonField, jsonPath, lookup, parse, parseAll, type
Functions — GetarrayElement, getEnd, getHighBits, getLowBits, getStart
Functions — IterativeiAny, iCollectArray, iIndex
Functions — Mathematicalabs, acos, asin, atan, atan2, bin, cbrt, ceil, cos, cosh, degreeToRadian, exp, floor, hexStringToNumber, hypotenuse, log, log10, log1p, numberToHexString, power, radianToDegree, random, range, round, signum, sin, sinh, sqrt, tan, tanh
Functions — NetworkipIn, ipIsLinkLocal, ipIsLoopback, ipIsPrivate, ipIsPublic, ipMask, isIp, isIpV4, isIpV6
Functions — SmartscapegetNodeField, getNodeName
Functions — Stringconcat, contains, decodeBase16ToBinary, decodeBase16ToString, decodeBase64ToBinary, decodeBase64ToString, decodeUrl, encodeBase16, encodeBase64, encodeUrl, endsWith, escape, getCharacter, indexOf, lastIndexOf, levenshteinDistance, like, lower, matchesPattern, matchesPhrase, matchesRegex, matchesValue, punctuation, replacePattern, replaceString, splitByPattern, splitString, startsWith, stringLength, substring, trim, unescape, unescapeHtml, upper
Functions — TimeformatTimestamp, getDayOfMonth, getDayOfWeek, getDayOfYear, getHour, getMinute, getMonth, getSecond, getWeekOfYear, getYear, now, unixMillisFromTimestamp, unixNanosFromTimestamp, unixSecondsFromTimestamp
Functions — Time series aggregation for metricsavg, count, countDistinct, end, max, median, min, percentRank, percentile, start, sum

Syntax Pitfalls

❌ Wrong✅ RightIssue
filter field in ["a", "b"]filter in(field, "a", "b")No array literal syntax
by: severity, statusby: {severity, status}Multiple grouping fields require curly braces
contains(toLowercase(field), "err")contains(lower(field), "err") or contains(field, "err", caseSensitive: false)There's no function for toLowerCase in DQL
filter name == "*serv*9*"filter contains(name, "serv")Mid-string wildcards not allowed; use contains()
matchesValue(field, "prod") on string fieldcontains(field, "prod")matchesValue() is for array fields only
toLowercase(field)lower(field)The correct function in DQL is called lower
arrayAvg(field[]) or arraySum(field[])arrayAvg(field) or field[]field[] = element-wise (array→array); arrayAvg(field) = collapse to scalar. Never mix both.
my_field after lookup or joinlookup.my_field / right.my_fieldlookup prefixes fields with lookup.; join prefixes right-side fields with right.
Chained lookup losing fieldsfieldsRename between lookupsEach lookup **removes all existing lookup.* fields**. Rename after each lookup to preserve results (see below)
substring(field, 0, 200)substring(field, from: 0, to: 200)DQL functions use named parameters — positional args cause TOO_MANY_POSITIONAL_PARAMETERS
filter log.level == "ERROR"filter loglevel == "ERROR"Log severity field is loglevel (no dot) — log.level does not exist
sort count() desc` sort count() desc `fields with special characters must use backticks

Fetch Command → Data Model

Each data model has a specific fetch command — using the wrong one returns no results.

Fetch CommandData ModelKey Fields / Notes
fetch spansDistributed tracingspan.*, service.*, http.*, db.*, code.*, exception.*
fetch logsLog eventslog.*, k8s.*, host.* — message body is content, severity is loglevel (NOT log.level)
fetch eventsDavis / infra eventsevent.*, dt.smartscape.*
fetch bizeventsBusiness eventsevent.*, custom fields
fetch securityEventsSecurity eventsvulnerability.*, event.*
fetch usersessionsRUM sessionsdt.rum.*, browser.*, geo.*
timeseriesMetricsNOT fetch — uses timeseries avg(metric.key) syntax

Legacy compatibility: dt.entity.* still works in older queries, but it is deprecated. Use dt.smartscape.* and smartscapeNodes for all new queries.

Metric-key note: keys containing hyphens are parsed as subtraction. Use backticks, for example: ` timeseries sum(my.metric-name) `.

→ Full field namespace reference: references/semantic-dictionary.md


Data Objects

DQL queries start with fetch <data_object> or timeseries. There is no fetch dt.metric or fetch dt.metrics — metrics are queried with timeseries.

Core data objects for fetch:

Data ObjectDescription
logsLog entries
spansDistributed traces / spans
eventsPlatform events
bizeventsBusiness events
user.eventsRUM individual events (page views, clicks, requests, errors)
user.sessionsRUM session-level aggregates
user.replaysSession replay recordings
security.eventsSecurity events
application.snapshotsApplication snapshots
dt.smartscape.<type>Smartscape entity fields (e.g., dt.smartscape.host, dt.smartscape.service)
dt.davis.problemsDAVIS-detected problems
dt.davis.eventsDAVIS events

Metrics — use timeseries, not fetch:

timeseries cpu = avg(dt.host.cpu.usage), by: {dt.smartscape.host}

Topology — use smartscapeNodes, not fetch:

smartscapeNodes "HOST"

Discover available data objects:

fetch dt.system.data_objects | fields name, display_name, type

Metric Discovery

To search for available metrics by keyword, use metric.series:

fetch metric.series, from: now() - 1h
| filter contains(metric.key, "replay")
| summarize count(), by: {metric.key}
| sort `count()` desc

There is no fetch dt.metric or fetch dt.metrics — those data objects do not exist.


Entity Field Patterns

Entity fields in DQL are scoped to specific entity types — not universal like SQL columns.

  • entity.id does not exist — use a typed field such as dt.smartscape.host.
EntityID field
Hostdt.smartscape.host
Servicedt.smartscape.service
Processdt.smartscape.process
Kubernetes clusterdt.smartscape.k8s_cluster
  • For topology traversal and relationships, use smartscapeNodes instead of fetch.

Smartscape Entity Patterns

Use smartscapeNodes for topology queries. Node types are uppercase strings and differ from field names.

EntityField namesmartscapeNodes type
Hostdt.smartscape.host"HOST"
Servicedt.smartscape.service"SERVICE"
K8s clusterdt.smartscape.k8s_cluster"K8S_CLUSTER"

Use toSmartscapeId() for ID conversion from strings (required!).

references/smartscape-topology-navigation.md


matchesValue() Usage

Use matchesValue() for array fields such as dt.tags:

| filter matchesValue(dt.tags, "env:production")
  • Not for string fields with special characters — use contains() for those
  • matchesValue() on a scalar string field does not behave like a wildcard or fuzzy match

Chained Lookup Pattern

Each lookup command removes all existing fields starting with lookup. before adding new ones. When chaining multiple lookups, use fieldsRename after each to preserve the result:

fetch bizevents
// Step 1: First lookup — enrich orders with product info
| lookup [fetch bizevents
    | filter event.type == "product_catalog"
    | fields product_id, category],
  sourceField: product_id, lookupField: product_id

// Step 2: Rename BEFORE next lookup — or lookup.category gets wiped
| fieldsRename product_category = lookup.category

// Step 3: Second lookup — lookup.* is now clean for new results
| lookup [fetch bizevents
    | filter event.type == "warehouse_stock"
    | fields category, warehouse_region],
  sourceField: product_category, lookupField: category

// Both product_category and lookup.warehouse_region are available

Without the fieldsRename, the second lookup silently drops the first lookup's results — producing empty fields and collapsed aggregations.


makeTimeseries Command

makeTimeseries converts event-based data (logs, spans, bizevents) into a time-bucketed metric series. It is not the same as the timeseries command — timeseries queries pre-ingested metric data; makeTimeseries builds a series from signals in a pipeline.

Basic syntax:

fetch logs
| makeTimeseries count = count(), by: {loglevel}, interval: 5m

Key parameters:

ParameterRequiredDescription
<agg> = <expr>YesAggregation to compute per bucket (e.g. count(), avg(duration))
interval:NoBucket size — e.g. 1m, 5m, 1h
by:NoOptional grouping dimensions (same {} syntax as summarize)
from: / to:NoExplicit time range; defaults to the query timeframe
bins:NoNumber of time buckets (alternative to interval:)
time:NoField to use as the timestamp; defaults to timestamp
spread:NoTimeframe expression for bucket calculation; alternative to time:, only works with count or countIf
nonempty:NoBoolean; when true, fills missing time buckets with null instead of omitting them

→ Full formal parameter specification: references/dql/dql-commands.md

Example — error rate timeseries from logs:

fetch logs
| makeTimeseries
    total = count(),
    errors = countIf(loglevel == "ERROR"),
    interval: 5m,
    by: {k8s.cluster.name}
| fieldsAdd error_rate = errors / total * 100

Example — entity existence timeline using spread::

smartscapeNodes "HOST"
| makeTimeseries concurrently_existing_hosts = count(), spread: lifetime

spread: lifetime distributes each host's count across the timeframe it existed, producing a series that shows how many hosts were alive at any point in time.

references/iterative-expressions.md for timeseries array manipulation


Timeframe Specification

Access to data requires specification of a timeframe. It can be specified in the UI, as REST API parameters, or in a DQL query explicitly using a pair of parameters: from: and to: (if one is omitted it defaults to now()), or alternatively using a single timeframe: parameter. Timeframe can be expressed using absolute values or relative expressions vs. current time. The time alignment operator (@) can be used to round timestamps to time unit boundaries — see references/operators.md for full details.

Examples

from:now()-1h@h, to:now()@h     // last complete hour
from:now()-1d@d, to:now()@d     // yesterday complete
from:now()@M                    // this month so far, till now
from:now()-2h@h                 // go back 2 hours, then align to hour boundary

Absolute timestamps

Use ISO 8601 format:

from:"2024-01-15T08:00:00Z", to:"2024-01-15T09:00:00Z"

Modifying Time

Key concepts

  • DQL has 3 specialized types related to time:

- timestamp — internally kept as number of nanoseconds since epoch, but exposed as date/time in a particular timezone - timeframe — a pair of 2 timestamps (start and end) - duration — internally kept as number of nanoseconds, but exposed as duration scaled to a reasonable factor (e.g. ms, minutes, days)

Rules

  • Subtracting timestamps yields a duration: timestamp - timestamp → duration
  • Duration divided by duration yields a double: e.g. 2h / 1m = 120.0
  • Scalar times duration yields a duration: e.g. no_of_h * 1h → duration
  • For extraction of time elements (hours, days of month, etc):

- ✅ Use time functions. They support calendar and time zones properly including DST. - ❌ Avoid using formatTimestamp for extracting time components. - ❌ Avoid converting timestamps and durations to double/long and using division, modulo, and constants expressing time units as nanoseconds.


References

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.95%
按下载量换算836

Claude

27.3%
按下载量换算601

Cursor

16.16%
按下载量换算356

Gemini CLI

9.45%
按下载量换算208

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills