[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BW5H43MADHKWAA2AFF68Z1":3,"skill-same:01M7BW5H43MADHKWAA2AFF68Z1":61},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7BW5H43MADHKWAA2AFF68Z1","dt-obs-analytics",null,"Analyze dashboards and notebooks using Davis analyzers — anomaly detection, novelty scoring, and correlation. Use when the user references a specific Dynatrace dashboard or notebook (by URL, UUID, or name) and asks what it shows, which DQL queries it runs, whether a tile looks off, or wants to find anomalies, score novelty, or correlate its metrics. The trigger is a dashboard or notebook as the data source, not a general DQL question. This skill extracts timeseries queries efficiently without reading the full raw document JSON, then optionally runs Davis analyzers on the extracted metrics. Trigger phrases: \"what's wrong on this dashboard\", \"analyze this notebook\", \"find anomalies\", \"novelty score\", \"correlate metrics\", \"extract DQL from dashboard\", \"dashboard URL\", \"tile\", \"run-analyzer\", \"timeseries extraction\", \"Davis analyzer\".","CognitionAI\u002Fdevin-marketplace","CognitionAI","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F163493330?v=4","01M7BVSRD98NC4FG8T3EZS6V5M","Cognition","01M7BVSRDX111C2XPWJ0E6MY26",29,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FCognitionAI\u002Fdevin-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fdynatrace\u002Fskills\u002Fdt-obs-analytics\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: dt-obs-analytics\ndescription: >-\n  Analyze dashboards and notebooks using Davis analyzers — anomaly detection, novelty scoring,\n  and correlation. Use when the user references a specific Dynatrace dashboard or notebook\n  (by URL, UUID, or name) and asks what it shows, which DQL queries it runs, whether a tile\n  looks off, or wants to find anomalies, score novelty, or correlate its metrics.\n  The trigger is a dashboard or notebook as the data source, not a general DQL question.\n  This skill extracts timeseries queries efficiently without reading the full raw document JSON,\n  then optionally runs Davis analyzers on the extracted metrics.\n  Trigger phrases: \"what's wrong on this dashboard\", \"analyze this notebook\", \"find anomalies\",\n  \"novelty score\", \"correlate metrics\", \"extract DQL from dashboard\", \"dashboard URL\", \"tile\",\n  \"run-analyzer\", \"timeseries extraction\", \"Davis analyzer\".\nlicense: Apache-2.0\n---\n\n# Analytics — Dashboard & Notebook Query Extraction\n\nA pipeline of three platform JavaScript scripts under `scripts\u002F` — two extractors feeding a shared analyzer runner:\n\n```\nscripts\u002Fextract-timeseries-dashboard.js ──┐\nscripts\u002Fextract-timeseries-notebook.js  ──┴──► queryset.json ──► scripts\u002Frun-analyzer.js (any Davis analyzer)\n```\n\nEach script is invoked via:\n```bash\ndtctl exec function -f scripts\u002F\u003Cscript>.js --payload '\u003Cjson>' -o json\n```\n\n`-o json` wraps the function return value under `.result`. When you need to inspect the result, read it directly from the output — no `jq` required. Pass the full raw output as `queries` to `run-analyzer.js` and it unwraps automatically.\n\n## Parsing a dashboard URL\n\nWhen the entry point is a Dynatrace dashboard URL, extract the three components the scripts need:\n\n```\nhttps:\u002F\u002F\u003Ctenant>\u002Fui\u002Fapps\u002Fdynatrace.dashboards\u002Fdashboard\u002F\u003CID>#from=\u003Cfrom>&to=\u003Cto>&vfilter_\u003Cname>=\u003Cval>...\n```\n\n| URL part | Script destination |\n|---|---|\n| Path segment after `\u002Fdashboard\u002F` (before `#`) | `id` in extract-timeseries-dashboard.js payload |\n| `#from=` value (URL-decode `%3A` → `:`) | `timeframe.startTime` in run-analyzer.js (only needed if running analysis) |\n| `#to=` value (URL-decode) | `timeframe.endTime` in run-analyzer.js (only needed if running analysis) |\n| `vfilter_\u003Cname>=\u003Cvalue>` params | `variables` map in run-analyzer.js (strip `vfilter_` prefix) |\n\nThe timeframe in the URL fragment is the dashboard's *display* window. It is **not** injected into the extracted DQL — the **extractor** returns the DQL verbatim with its original `$variable` tokens and any embedded `| timeframe` clauses intact. Use the parsed `from`\u002F`to` values only when calling `run-analyzer.js` to set the analysis window. If the user just wants to list the queries, the timeframe is informational only.\n\nNote: when you pass `run-analyzer.js` an **absolute** `timeframe.startTime` (not a `now...` expression), it strips any embedded `| timeframe ...` stage from the DQL before analysis, so the analyzer honors your requested window rather than the query's baked-in one. For relative (`now...`) windows the embedded `| timeframe` is left intact. This means the query actually analyzed can differ from the extracted text — expected behavior, noted here so results line up with the window you asked for.\n\nQuick bash parse (pure bash + sed\u002Fawk — no python needed):\n```bash\nDASHBOARD_URL=\"https:\u002F\u002Fabc123.apps.dynatrace.com\u002Fui\u002Fapps\u002Fdynatrace.dashboards\u002Fdashboard\u002F5bea16c7-029b-43b6-9735-459db2d25bbf#from=2026-05-28T04%3A00Z&to=2026-05-28T05%3A00Z&vfilter_host_group=prod&vfilter_workload=my-svc\"\n\n# Minimal URL-decoder: turn %XX into \\xXX and let printf interpret it.\nurldecode() { local s=\"${1\u002F\u002F+\u002F }\"; printf '%b' \"${s\u002F\u002F%\u002F\\\\x}\"; }\n\nDOC_ID=$(echo \"$DASHBOARD_URL\" | sed 's\u002F#.*\u002F\u002F' | awk -F\u002F '{print $NF}')\nFROM=$(urldecode \"$(echo \"$DASHBOARD_URL\" | sed -n 's\u002F.*[#&]from=\\([^&]*\\).*\u002F\\1\u002Fp')\")\nTO=$(urldecode \"$(echo \"$DASHBOARD_URL\"   | sed -n 's\u002F.*[#&]to=\\([^&]*\\).*\u002F\\1\u002Fp')\")\nHOST_GROUP=$(echo \"$DASHBOARD_URL\" | sed -n 's\u002F.*[#&]vfilter_host_group=\\([^&]*\\).*\u002F\\1\u002Fp')\nWORKLOAD=$(echo \"$DASHBOARD_URL\"   | sed -n 's\u002F.*[#&]vfilter_workload=\\([^&]*\\).*\u002F\\1\u002Fp')\n```\n\nFor notebooks: path segment after `\u002Fnotebook\u002F`, or `#share=` value for `\u002Fdocument\u002Fv0\u002F#share=\u003CID>` links.\n\n## Step 1 — Extract queries\n\n### From a dashboard\n\n```bash\n# All tiles\ndtctl exec function -f scripts\u002Fextract-timeseries-dashboard.js \\\n  --payload '{\"id\":\"\u003Cdashboard-id-or-name>\"}' -o json\n\n# Only tiles whose title matches a name the user mentioned (e.g. \"CPU usage\", \"Kafka lag\")\ndtctl exec function -f scripts\u002Fextract-timeseries-dashboard.js \\\n  --payload '{\"id\":\"\u003Cdashboard-id>\",\"titleFilter\":\"CPU usage\"}' -o json\n```\n\n**When the user names a specific tile, chart, or section**, pass its name as `titleFilter` rather than extracting the full dashboard. `titleFilter` is a case-insensitive substring or `\u002Fregex\u002Fflags` pattern. This keeps the queryset small and focused.\n\n**When it is not clear which tile(s) the user wants**, do NOT extract all DQL — dashboards can have 20–50 tiles and returning all queries causes significant context bloat. Instead use a two-step flow:\n\n1. List tile names with `listOnly: true` (no DQL, just titles):\n   ```bash\n   dtctl exec function -f scripts\u002Fextract-timeseries-dashboard.js \\\n     --payload '{\"id\":\"\u003Cdashboard-id>\",\"listOnly\":true}' -o json\n   # Returns: {\"result\":{\"ok\":true,\"tiles\":[{\"id\":\"...\",\"title\":\"CPU Usage\",\"visualization\":\"lineChart\"},...]}}\n   ```\n2. Show the tile names to the user and ask which tile(s) they mean.\n3. Re-run with `titleFilter` for only the tile(s) of interest.\n\nThis avoids pulling 20–50 DQL queries into context when only 1–2 are relevant.\n\nPayload knobs:\n- `id` (required) — dashboard ID (UUID) or exact name. Preset IDs like `my.dynatrace.infraops.preview.*` work.\n- `titleFilter` — case-insensitive substring (`\"CPU usage\"`) or `\u002Fregex\u002Fflags` (`\"\u002F^kafka\u002Fi\"`).\n- `listOnly` — when `true`, returns `tiles: [{id, title, visualization}]` without DQL. Use for disambiguation.\n- `compact` — when `true`, returns only `{id, title, dqlQuery}` per tile (drops description, visualization, isTimeseries). Saves ~40% per-tile tokens. In `listOnly` mode, drops visualization too.\n- `includeSkipped` — when `true`, returns the full `skipped[]` array. Default: only `skippedCount` is returned.\n\nResponse envelope:\n```json\n{\n  \"ok\": true,\n  \"documentId\": \"...\", \"documentName\": \"...\", \"documentVersion\": 7,\n  \"queries\": [\n    { \"id\": \"\u003Ctile-key>\", \"title\": \"...\", \"description\": \"...\",\n      \"dqlQuery\": \"timeseries avg(dt.host.cpu.usage)\",\n      \"visualization\": \"lineChart\", \"isTimeseries\": true }\n  ],\n  \"skipped\": [{ \"id\": \"...\", \"reason\": \"non-data tile (markdown)\" }]\n}\n```\n\nOn failure: `{ \"ok\": false, \"error\": { \"code\": \"...\", \"message\": \"...\" } }`.\n\n### From a notebook\n\nSame envelope, different schema walk:\n\n```bash\n# All cells\ndtctl exec function -f scripts\u002Fextract-timeseries-notebook.js \\\n  --payload '{\"id\":\"\u003Cnotebook-id-or-name>\"}' -o json\n\n# A specific section (if cell titles are set)\ndtctl exec function -f scripts\u002Fextract-timeseries-notebook.js \\\n  --payload '{\"id\":\"\u003Cnotebook-id>\",\"titleFilter\":\"JVM memory\"}' -o json\n```\n\nNotebook cells often have empty titles — prefer addressing cells by `id` from the envelope if targeting a specific one.\n\n## Step 2 — Run an analyzer\n\nSave the extractor output to a file, then pass it via shell substitution — the shell reads the file, so the JSON never enters the model's context:\n\n```bash\n# Run extractor, save output\ndtctl exec function -f scripts\u002Fextract-timeseries-dashboard.js \\\n  --payload '{\"id\":\"\u003Cid>\",\"titleFilter\":\"CPU usage\",\"compact\":true}' -o json > queryset.json\n\n# Shell substitution: $(cat queryset.json) is expanded by the shell, not the model\ndtctl exec function -f scripts\u002Frun-analyzer.js \\\n  --payload '{\n    \"analyzerName\": \"dt.statistics.NoveltyScoreAnalyzer\",\n    \"queries\": '\"$(cat queryset.json)\"',\n    \"timeframe\": { \"startTime\": \"...\", \"endTime\": \"...\" },\n    \"analyzerParams\": { ... }\n  }' -o json\n```\n\n`run-analyzer.js` unwraps the `{\"result\":{...}}` dtctl envelope automatically — pass the raw saved output as-is. No `jq` or parsing step is needed: normalization of the array \u002F envelope \u002F dtctl-output shapes happens inside the script.\n\nFor large querysets (many tiles), the inline `$(cat ...)` form can hit shell argument-length limits. Build the payload file and use dtctl's `--data` flag instead — still no `jq` and still out of model context:\n\n```bash\n{ printf '{\"analyzerName\":\"dt.statistics.NoveltyScoreAnalyzer\",\"timeframe\":{\"startTime\":\"now-1h\",\"endTime\":\"now\"},\"queries\":'\n  cat queryset.json\n  printf '}'; } > payload.json\n\ndtctl exec function -f scripts\u002Frun-analyzer.js --data payload.json -o json\n```\n\nKey payload knobs for `run-analyzer.js`:\n- `minScore` — drop results below this threshold (e.g. `0.5`). Auto-detects score field from `noveltyScore`, `anomalyScore`, `correlationCoefficient`, `correlation`, `coefficient`. Pass `scoreField` to override.\n- `scoreField` — explicit field name to read score from (e.g. `\"noveltyScore\"`).\n\nThe `queries` field accepts any of: a raw array, the extractor envelope (`{queries:[...]}`), or the full dtctl output (`{\"result\":{\"queries\":[...]}}`). All three are normalized automatically.\n\n### Common analyzers\n\n| Goal | analyzerName | analyzerParams |\n|---|---|---|\n| Find anomalous metrics | `dt.statistics.anomaly_detection.SeasonalBaselineAnomalyDetectionAnalyzer` | `{ \"trainingTimeframe\": { \"startTime\": \"now-8d\", \"endTime\": \"now-1d\" } }` (optional) |\n| Score how novel each metric is | `dt.statistics.NoveltyScoreAnalyzer` | `{ \"detectionMode\": \"ALL\", \"minNoveltyScore\": 0 }` (optional) |\n| Correlate against a primary metric | `dt.statistics.SimplePearsonCorrelationAnalyzer` | set `metricQuery` instead (changes call shape) |\n\n### Correlation mode\n\nPass `metricQuery` to correlate every query in the set against a single primary DQL string:\n\n```bash\ndtctl exec function -f scripts\u002Frun-analyzer.js \\\n  --payload '{\n    \"analyzerName\": \"dt.statistics.SimplePearsonCorrelationAnalyzer\",\n    \"queries\": '\"$(cat queryset.json)\"',\n    \"metricQuery\": \"\u003CdqlQuery of the primary tile, copied from extractor output>\",\n    \"timeframe\": { \"startTime\": \"...\", \"endTime\": \"...\" }\n  }' -o json\n```\n\nWhen chaining from a previous analyzer run (e.g. anomaly detection → correlation), use `metricQueryFrom` instead. The script picks the highest-scored result's `dqlQuery` automatically:\n\n```bash\ndtctl exec function -f scripts\u002Frun-analyzer.js \\\n  --payload '{\n    \"analyzerName\": \"dt.statistics.SimplePearsonCorrelationAnalyzer\",\n    \"queries\": '\"$(cat queryset.json)\"',\n    \"metricQueryFrom\": '\"$(cat findings.json)\"',\n    \"timeframe\": { \"startTime\": \"...\", \"endTime\": \"...\" }\n  }' -o json\n```\n\n`metricQuery` takes precedence if both are set.\n\n### Variable substitution\n\nDashboard queries often contain `$variable` tokens (from URL `vfilter_*` params). Pass them via `variables` to substitute before execution:\n\n```bash\ndtctl exec function -f scripts\u002Frun-analyzer.js \\\n  --payload '{\n    \"analyzerName\": \"dt.statistics.anomaly_detection.SeasonalBaselineAnomalyDetectionAnalyzer\",\n    \"queries\": [...],\n    \"timeframe\": { \"startTime\": \"2026-05-28T04:00Z\", \"endTime\": \"2026-05-28T05:00Z\" },\n    \"variables\": { \"host_group\": \"prod\", \"workload\": \"my-svc\" }\n  }' -o json\n```\n\nBuild `variables` from `vfilter_*` URL params by stripping the `vfilter_` prefix. Trailing `*` wildcards are stripped automatically. Unresolved tokens are cleaned up from DQL filter clauses rather than left to error.\n\n### Response shape\n\n```json\n{\n  \"ok\": true,\n  \"checkedAt\": \"...\",\n  \"analyzerName\": \"...\",\n  \"summary\": { \"checked\": 12, \"completed\": 11, \"errors\": 1 },\n  \"results\": [\n    {\n      \"id\": \"tile-key\", \"title\": \"CPU usage\", \"dqlQuery\": \"...\",\n      \"output\": \u003Craw analyzer output>,\n      \"executionStatus\": \"COMPLETED\"\n    }\n  ],\n  \"errors\": [ { \"id\": \"...\", \"error\": \"...\" } ]\n}\n```\n\nThe `output` field is the raw analyzer result. Interpret it based on the analyzer:\n- **Anomaly detection**: look for `anomalyScore`, `anomalies[]`, or `raisedAlerts[]` in each output entry. Score ≥ 0.7 → abnormal, ≥ 0.4 → borderline.\n- **Novelty**: look for `noveltyScore` (or the closest score-like numeric field). Score ≥ 0.7 → novel.\n- **Correlation**: look for `correlationCoefficient`. Sort by `|correlationCoefficient|` descending; drop entries where `|correlationCoefficient| \u003C 0.5`.\n\n## End-to-end: \"what's abnormal on this dashboard?\"\n\n```bash\n# 1. Extract queries — shell reads file, JSON stays out of model context\ndtctl exec function -f scripts\u002Fextract-timeseries-dashboard.js \\\n  --payload '{\"id\":\"5bea16c7-029b-43b6-9735-459db2d25bbf\",\"compact\":true}' \\\n  -o json > queryset.json\n\n# 2. Run anomaly detection — $(cat queryset.json) expanded by shell, not model\ndtctl exec function -f scripts\u002Frun-analyzer.js \\\n  --payload '{\n    \"analyzerName\": \"dt.statistics.anomaly_detection.SeasonalBaselineAnomalyDetectionAnalyzer\",\n    \"queries\": '\"$(cat queryset.json)\"',\n    \"timeframe\": { \"startTime\": \"2026-05-28T04:00Z\", \"endTime\": \"2026-05-28T05:00Z\" },\n    \"variables\": { \"host_group\": \"prod\", \"workload\": \"my-svc\" }\n  }' -o json > findings.json\n\n# 3. Correlate — metricQueryFrom picks the top finding automatically\ndtctl exec function -f scripts\u002Frun-analyzer.js \\\n  --payload '{\n    \"analyzerName\": \"dt.statistics.SimplePearsonCorrelationAnalyzer\",\n    \"queries\": '\"$(cat queryset.json)\"',\n    \"metricQueryFrom\": '\"$(cat findings.json)\"',\n    \"timeframe\": { \"startTime\": \"2026-05-28T04:00Z\", \"endTime\": \"2026-05-28T05:00Z\" }\n  }' -o json\n```\n\n## Verifying a single extracted query\n\nRead the `dqlQuery` field from the extractor output and pass it directly:\n\n```bash\ndtctl query --query \"\u003CdqlQuery copied from extractor output>\" -o json | head -40\n```\n\n## Gotchas\n\n- **Never read raw dashboard JSON yourself.** `dtctl get dashboard \u003Cid> -o json` is typically 50–200 KB. The extractor reads it on the platform and returns a compact envelope (~5–15 KB).\n- **Never extract all tiles when only one is needed.** A 50-tile dashboard returns 50 DQL queries into context. If the user names a tile, use `titleFilter`. If it's ambiguous, use `listOnly: true` first to ask which tile — then extract only that one.\n- **Variables are required for filtered dashboards.** Queries with unsubstituted `$variable` tokens silently drop entity filters (e.g. `in(field, $undefined)` evaluates to `true`). Always pass `variables` when the URL has `vfilter_*` params.\n- **Schema drift.** If a tile lands in `skipped` with reason `no DQL query found`, the dashboard schema has a query location the extractor doesn't know about — add it to the `pickQuery` candidate list in the script.\n- **Analyzer availability.** Not all Davis analyzers are available on every tenant. If a call comes back with `Could not find an analyzer with name '...'` or `is not a function`, list what's actually registered: `dtctl get analyzers -o json`.\n- **Statistical fallback removed.** `run-analyzer.js` only calls Davis analyzers. For historical anomaly detection, pass a long `trainingTimeframe` via `analyzerParams` (e.g. `{ \"trainingTimeframe\": { \"startTime\": \"now-30d\", \"endTime\": \"now-1d\" } }`), or query the DQL directly.\n- **Comments in queries.** Queries starting with `\u002F\u002F comment` lines are classified correctly by the extractor (leading line\u002Fblock comments are stripped before the `timeseries` check).\n\n## Scripts reference\n\n- [scripts\u002Fextract-timeseries-dashboard.js](scripts\u002Fextract-timeseries-dashboard.js) — extracts timeseries DQL from a dashboard\n- [scripts\u002Fextract-timeseries-notebook.js](scripts\u002Fextract-timeseries-notebook.js) — same for notebooks\n- [scripts\u002Frun-analyzer.js](scripts\u002Frun-analyzer.js) — generic Davis analyzer runner\n","# Analytics — Dashboard & Notebook Query Extraction\n\nA pipeline of three platform JavaScript scripts under `scripts\u002F` — two extractors feeding a shared analyzer runner:\n\n```\nscripts\u002Fextract-timeseries-dashboard.js ──┐\nscripts\u002Fextract-timeseries-notebook.js  ──┴──► queryset.json ──► scripts\u002Frun-analyzer.js (any Davis analyzer)\n```\n\nEach script is invoked via:\n```bash\ndtctl exec function -f scripts\u002F\u003Cscript>.js --payload '\u003Cjson>' -o json\n```\n\n`-o json` wraps the function return value under `.result`. When you need to inspect the result, read it directly from the output — no `jq` required. Pass the full raw output as `queries` to `run-analyzer.js` and it unwraps automatically.\n\n## Parsing a dashboard URL\n\nWhen the entry point is a Dynatrace dashboard URL, extract the three components the scripts need:\n\n```\nhttps:\u002F\u002F\u003Ctenant>\u002Fui\u002Fapps\u002Fdynatrace.dashboards\u002Fdashboard\u002F\u003CID>#from=\u003Cfrom>&to=\u003Cto>&vfilter_\u003Cname>=\u003Cval>...\n```\n\n| URL part | Script destination |\n|---|---|\n| Path segment after `\u002Fdashboard\u002F` (before `#`) | `id` in extract-timeseries-dashboard.js payload |\n| `#from=` value (URL-decode `%3A` → `:`) | `timeframe.startTime` in run-analyzer.js (only needed if running analysis) |\n| `#to=` value (URL-decode) | `timeframe.endTime` in run-analyzer.js (only needed if running analysis) |\n| `vfilter_\u003Cname>=\u003Cvalue>` params | `variables` map in run-analyzer.js (strip `vfilter_` prefix) |\n\nThe timeframe in the URL fragment is the dashboard's *display* window. It is **not** injected into the extracted DQL — the **extractor** returns the DQL verbatim with its original `$variable` tokens and any embedded `| timeframe` clauses intact. Use the parsed `from`\u002F`to` values only when calling `run-analyzer.js` to set the analysis window. If the user just wants to list the queries, the timeframe is informational only.\n\nNote: when you pass `run-analyzer.js` an **absolute** `timeframe.startTime` (not a `now...` expression), it strips any embedded `| timeframe ...` stage from the DQL before analysis, so the analyzer honors your requested window rather than the query's baked-in one. For relative (`now...`) windows the embedded `| timeframe` is left intact. This means the query actually analyzed can differ from the extracted text — expected behavior, noted here so results line up with the window you asked for.\n\nQuick bash parse (pure bash + sed\u002Fawk — no python needed):\n```bash\nDASHBOARD_URL=\"https:\u002F\u002Fabc123.apps.dynatrace.com\u002Fui\u002Fapps\u002Fdynatrace.dashboards\u002Fdashboard\u002F5bea16c7-029b-43b6-9735-459db2d25bbf#from=2026-05-28T04%3A00Z&to=2026-05-28T05%3A00Z&vfilter_host_group=prod&vfilter_workload=my-svc\"\n\n# Minimal URL-decoder: turn %XX into \\xXX and let printf interpret it.\nurldecode() { local s=\"${1\u002F\u002F+\u002F }\"; printf '%b' \"${s\u002F\u002F%\u002F\\\\x}\"; }\n\nDOC_ID=$(echo \"$DASHBOARD_URL\" | sed 's\u002F#.*\u002F\u002F' | awk -F\u002F '{print $NF}')\nFROM=$(urldecode \"$(echo \"$DASHBOARD_URL\" | sed -n 's\u002F.*[#&]from=\\([^&]*\\).*\u002F\\1\u002Fp')\")\nTO=$(urldecode \"$(echo \"$DASHBOARD_URL\"   | sed -n 's\u002F.*[#&]to=\\([^&]*\\).*\u002F\\1\u002Fp')\")\nHOST_GROUP=$(echo \"$DASHBOARD_URL\" | sed -n 's\u002F.*[#&]vfilter_host_group=\\([^&]*\\).*\u002F\\1\u002Fp')\nWORKLOAD=$(echo \"$DASHBOARD_URL\"   | sed -n 's\u002F.*[#&]vfilter_workload=\\([^&]*\\).*\u002F\\1\u002Fp')\n```\n\nFor notebooks: path segment after `\u002Fnotebook\u002F`, or `#share=` value for `\u002Fdocument\u002Fv0\u002F#share=\u003CID>` links.\n\n## Step 1 — Extract queries\n\n### From a dashboard\n\n```bash\n# All tiles\ndtctl exec function -f scripts\u002Fextract-timeseries-dashboard.js \\\n  --payload '{\"id\":\"\u003Cdashboard-id-or-name>\"}' -o json\n\n# Only tiles whose title matches a name the user mentioned (e.g. \"CPU usage\", \"Kafka lag\")\ndtctl exec function -f scripts\u002Fextract-timeseries-dashboard.js \\\n  --payload '{\"id\":\"\u003Cdashboard-id>\",\"titleFilter\":\"CPU usage\"}' -o json\n```\n\n**When the user names a specific tile, chart, or section**, pass its name as `titleFilter` rather than extracting the full dashboard. `titleFilter` is a case-insensitive substring or `\u002Fregex\u002Fflags` pattern. This keeps the queryset small and focused.\n\n**When it is not clear which tile(s) the user wants**, do NOT extract all DQL — dashboards can have 20–50 tiles and returning all queries causes significant context bloat. Instead use a two-step flow:\n\n1. List tile names with `listOnly: true` (no DQL, just titles):\n   ```bash\n   dtctl exec function -f scripts\u002Fextract-timeseries-dashboard.js \\\n     --payload '{\"id\":\"\u003Cdashboard-id>\",\"listOnly\":true}' -o json\n   # Returns: {\"result\":{\"ok\":true,\"tiles\":[{\"id\":\"...\",\"title\":\"CPU Usage\",\"visualization\":\"lineChart\"},...]}}\n   ```\n2. Show the tile names to the user and ask which tile(s) they mean.\n3. Re-run with `titleFilter` for only the tile(s) of interest.\n\nThis avoids pulling 20–50 DQL queries into context when only 1–2 are relevant.\n\nPayload knobs:\n- `id` (required) — dashboard ID (UUID) or exact name. Preset IDs like `my.dynatrace.infraops.preview.*` work.\n- `titleFilter` — case-insensitive substring (`\"CPU usage\"`) or `\u002Fregex\u002Fflags` (`\"\u002F^kafka\u002Fi\"`).\n- `listOnly` — when `true`, returns `tiles: [{id, title, visualization}]` without DQL. Use for disambiguation.\n- `compact` — when `true`, returns only `{id, title, dqlQuery}` per tile (drops description, visualization, isTimeseries). Saves ~40% per-tile tokens. In `listOnly` mode, drops visualization too.\n- `includeSkipped` — when `true`, returns the full `skipped[]` array. Default: only `skippedCount` is returned.\n\nResponse envelope:\n```json\n{\n  \"ok\": true,\n  \"documentId\": \"...\", \"documentName\": \"...\", \"documentVersion\": 7,\n  \"queries\": [\n    { \"id\": \"\u003Ctile-key>\", \"title\": \"...\", \"description\": \"...\",\n      \"dqlQuery\": \"timeseries avg(dt.host.cpu.usage)\",\n      \"visualization\": \"lineChart\", \"isTimeseries\": true }\n  ],\n  \"skipped\": [{ \"id\": \"...\", \"reason\": \"non-data tile (markdown)\" }]\n}\n```\n\nOn failure: `{ \"ok\": false, \"error\": { \"code\": \"...\", \"message\": \"...\" } }`.\n\n### From a notebook\n\nSame envelope, different schema walk:\n\n```bash\n# All cells\ndtctl exec function -f scripts\u002Fextract-timeseries-notebook.js \\\n  --payload '{\"id\":\"\u003Cnotebook-id-or-name>\"}' -o json\n\n# A specific section (if cell titles are set)\ndtctl exec function -f scripts\u002Fextract-timeseries-notebook.js \\\n  --payload '{\"id\":\"\u003Cnotebook-id>\",\"titleFilter\":\"JVM memory\"}' -o json\n```\n\nNotebook cells often have empty titles — prefer addressing cells by `id` from the envelope if targeting a specific one.\n\n## Step 2 — Run an analyzer\n\nSave the extractor output to a file, then pass it via shell substitution — the shell reads the file, so the JSON never enters the model's context:\n\n```bash\n# Run extractor, save output\ndtctl exec function -f scripts\u002Fextract-timeseries-dashboard.js \\\n  --payload '{\"id\":\"\u003Cid>\",\"titleFilter\":\"CPU usage\",\"compact\":true}' -o json > queryset.json\n\n# Shell substitution: $(cat queryset.json) is expanded by the shell, not the model\ndtctl exec function -f scripts\u002Frun-analyzer.js \\\n  --payload '{\n    \"analyzerName\": \"dt.statistics.NoveltyScoreAnalyzer\",\n    \"queries\": '\"$(cat queryset.json)\"',\n    \"timeframe\": { \"startTime\": \"...\", \"endTime\": \"...\" },\n    \"analyzerParams\": { ... }\n  }' -o json\n```\n\n`run-analyzer.js` unwraps the `{\"result\":{...}}` dtctl envelope automatically — pass the raw saved output as-is. No `jq` or parsing step is needed: normalization of the array \u002F envelope \u002F dtctl-output shapes happens inside the script.\n\nFor large querysets (many tiles), the inline `$(cat ...)` form can hit shell argument-length limits. Build the payload file and use dtctl's `--data` flag instead — still no `jq` and still out of model context:\n\n```bash\n{ printf '{\"analyzerName\":\"dt.statistics.NoveltyScoreAnalyzer\",\"timeframe\":{\"startTime\":\"now-1h\",\"endTime\":\"now\"},\"queries\":'\n  cat queryset.json\n  printf '}'; } > payload.json\n\ndtctl exec function -f scripts\u002Frun-analyzer.js --data payload.json -o json\n```\n\nKey payload knobs for `run-analyzer.js`:\n- `minScore` — drop results below this threshold (e.g. `0.5`). Auto-detects score field from `noveltyScore`, `anomalyScore`, `correlationCoefficient`, `correlation`, `coefficient`. Pass `scoreField` to override.\n- `scoreField` — explicit field name to read score from (e.g. `\"noveltyScore\"`).\n\nThe `queries` field accepts any of: a raw array, the extractor envelope (`{queries:[...]}`), or the full dtctl output (`{\"result\":{\"queries\":[...]}}`). All three are normalized automatically.\n\n### Common analyzers\n\n| Goal | analyzerName | analyzerParams |\n|---|---|---|\n| Find anomalous metrics | `dt.statistics.anomaly_detection.SeasonalBaselineAnomalyDetectionAnalyzer` | `{ \"trainingTimeframe\": { \"startTime\": \"now-8d\", \"endTime\": \"now-1d\" } }` (optional) |\n| Score how novel each metric is | `dt.statistics.NoveltyScoreAnalyzer` | `{ \"detectionMode\": \"ALL\", \"minNoveltyScore\": 0 }` (optional) |\n| Correlate against a primary metric | `dt.statistics.SimplePearsonCorrelationAnalyzer` | set `metricQuery` instead (changes call shape) |\n\n### Correlation mode\n\nPass `metricQuery` to correlate every query in the set against a single primary DQL string:\n\n```bash\ndtctl exec function -f scripts\u002Frun-analyzer.js \\\n  --payload '{\n    \"analyzerName\": \"dt.statistics.SimplePearsonCorrelationAnalyzer\",\n    \"queries\": '\"$(cat queryset.json)\"',\n    \"metricQuery\": \"\u003CdqlQuery of the primary tile, copied from extractor output>\",\n    \"timeframe\": { \"startTime\": \"...\", \"endTime\": \"...\" }\n  }' -o json\n```\n\nWhen chaining from a previous analyzer run (e.g. anomaly detection → correlation), use `metricQueryFrom` instead. The script picks the highest-scored result's `dqlQuery` automatically:\n\n```bash\ndtctl exec function -f scripts\u002Frun-analyzer.js \\\n  --payload '{\n    \"analyzerName\": \"dt.statistics.SimplePearsonCorrelationAnalyzer\",\n    \"queries\": '\"$(cat queryset.json)\"',\n    \"metricQueryFrom\": '\"$(cat findings.json)\"',\n    \"timeframe\": { \"startTime\": \"...\", \"endTime\": \"...\" }\n  }' -o json\n```\n\n`metricQuery` takes precedence if both are set.\n\n### Variable substitution\n\nDashboard queries often contain `$variable` tokens (from URL `vfilter_*` params). Pass them via `variables` to substitute before execution:\n\n```bash\ndtctl exec function -f scripts\u002Frun-analyzer.js \\\n  --payload '{\n    \"analyzerName\": \"dt.statistics.anomaly_detection.SeasonalBaselineAnomalyDetectionAnalyzer\",\n    \"queries\": [...],\n    \"timeframe\": { \"startTime\": \"2026-05-28T04:00Z\", \"endTime\": \"2026-05-28T05:00Z\" },\n    \"variables\": { \"host_group\": \"prod\", \"workload\": \"my-svc\" }\n  }' -o json\n```\n\nBuild `variables` from `vfilter_*` URL params by stripping the `vfilter_` prefix. Trailing `*` wildcards are stripped automatically. Unresolved tokens are cleaned up from DQL filter clauses rather than left to error.\n\n### Response shape\n\n```json\n{\n  \"ok\": true,\n  \"checkedAt\": \"...\",\n  \"analyzerName\": \"...\",\n  \"summary\": { \"checked\": 12, \"completed\": 11, \"errors\": 1 },\n  \"results\": [\n    {\n      \"id\": \"tile-key\", \"title\": \"CPU usage\", \"dqlQuery\": \"...\",\n      \"output\": \u003Craw analyzer output>,\n      \"executionStatus\": \"COMPLETED\"\n    }\n  ],\n  \"errors\": [ { \"id\": \"...\", \"error\": \"...\" } ]\n}\n```\n\nThe `output` field is the raw analyzer result. Interpret it based on the analyzer:\n- **Anomaly detection**: look for `anomalyScore`, `anomalies[]`, or `raisedAlerts[]` in each output entry. Score ≥ 0.7 → abnormal, ≥ 0.4 → borderline.\n- **Novelty**: look for `noveltyScore` (or the closest score-like numeric field). Score ≥ 0.7 → novel.\n- **Correlation**: look for `correlationCoefficient`. Sort by `|correlationCoefficient|` descending; drop entries where `|correlationCoefficient| \u003C 0.5`.\n\n## End-to-end: \"what's abnormal on this dashboard?\"\n\n```bash\n# 1. Extract queries — shell reads file, JSON stays out of model context\ndtctl exec function -f scripts\u002Fextract-timeseries-dashboard.js \\\n  --payload '{\"id\":\"5bea16c7-029b-43b6-9735-459db2d25bbf\",\"compact\":true}' \\\n  -o json > queryset.json\n\n# 2. Run anomaly detection — $(cat queryset.json) expanded by shell, not model\ndtctl exec function -f scripts\u002Frun-analyzer.js \\\n  --payload '{\n    \"analyzerName\": \"dt.statistics.anomaly_detection.SeasonalBaselineAnomalyDetectionAnalyzer\",\n    \"queries\": '\"$(cat queryset.json)\"',\n    \"timeframe\": { \"startTime\": \"2026-05-28T04:00Z\", \"endTime\": \"2026-05-28T05:00Z\" },\n    \"variables\": { \"host_group\": \"prod\", \"workload\": \"my-svc\" }\n  }' -o json > findings.json\n\n# 3. Correlate — metricQueryFrom picks the top finding automatically\ndtctl exec function -f scripts\u002Frun-analyzer.js \\\n  --payload '{\n    \"analyzerName\": \"dt.statistics.SimplePearsonCorrelationAnalyzer\",\n    \"queries\": '\"$(cat queryset.json)\"',\n    \"metricQueryFrom\": '\"$(cat findings.json)\"',\n    \"timeframe\": { \"startTime\": \"2026-05-28T04:00Z\", \"endTime\": \"2026-05-28T05:00Z\" }\n  }' -o json\n```\n\n## Verifying a single extracted query\n\nRead the `dqlQuery` field from the extractor output and pass it directly:\n\n```bash\ndtctl query --query \"\u003CdqlQuery copied from extractor output>\" -o json | head -40\n```\n\n## Gotchas\n\n- **Never read raw dashboard JSON yourself.** `dtctl get dashboard \u003Cid> -o json` is typically 50–200 KB. The extractor reads it on the platform and returns a compact envelope (~5–15 KB).\n- **Never extract all tiles when only one is needed.** A 50-tile dashboard returns 50 DQL queries into context. If the user names a tile, use `titleFilter`. If it's ambiguous, use `listOnly: true` first to ask which tile — then extract only that one.\n- **Variables are required for filtered dashboards.** Queries with unsubstituted `$variable` tokens silently drop entity filters (e.g. `in(field, $undefined)` evaluates to `true`). Always pass `variables` when the URL has `vfilter_*` params.\n- **Schema drift.** If a tile lands in `skipped` with reason `no DQL query found`, the dashboard schema has a query location the extractor doesn't know about — add it to the `pickQuery` candidate list in the script.\n- **Analyzer availability.** Not all Davis analyzers are available on every tenant. If a call comes back with `Could not find an analyzer with name '...'` or `is not a function`, list what's actually registered: `dtctl get analyzers -o json`.\n- **Statistical fallback removed.** `run-analyzer.js` only calls Davis analyzers. For historical anomaly detection, pass a long `trainingTimeframe` via `analyzerParams` (e.g. `{ \"trainingTimeframe\": { \"startTime\": \"now-30d\", \"endTime\": \"now-1d\" } }`), or query the DQL directly.\n- **Comments in queries.** Queries starting with `\u002F\u002F comment` lines are classified correctly by the extractor (leading line\u002Fblock comments are stripped before the `timeseries` check).\n\n## Scripts reference\n\n- [scripts\u002Fextract-timeseries-dashboard.js](scripts\u002Fextract-timeseries-dashboard.js) — extracts timeseries DQL from a dashboard\n- [scripts\u002Fextract-timeseries-notebook.js](scripts\u002Fextract-timeseries-notebook.js) — same for notebooks\n- [scripts\u002Frun-analyzer.js](scripts\u002Frun-analyzer.js) — generic Davis analyzer runner\n",{"name":5,"license":15,"description":7},"main","9836d94e88404aabb682086405c2aa9cba7657ac","plugins\u002Fdynatrace\u002Fskills\u002Fdt-obs-analytics",156,"https:\u002F\u002Fgithub.com\u002FCognitionAI\u002Fdevin-marketplace","https:\u002F\u002Fgithub.com\u002FCognitionAI","https:\u002F\u002Fcognition.ai\u002F","Makers of Devin, the AI software engineer.","2026-11-13 07:08:23",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add CognitionAI\u002Fdevin-marketplace --skill dt-obs-analytics",{"tool":39,"command":40},"bunx","bunx skills add CognitionAI\u002Fdevin-marketplace --skill dt-obs-analytics",{"tool":42,"command":43},"pnpm","pnpm dlx skills add CognitionAI\u002Fdevin-marketplace --skill dt-obs-analytics","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FCognitionAI\u002Fdevin-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fdynatrace\u002Fskills\u002Fdt-obs-analytics\u002FSKILL.md",true,[47,53,57],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"scripts\u002Fextract-timeseries-dashboard.js","SCRIPT","脚本",11498,"https:\u002F\u002Fgithub.com\u002FCognitionAI\u002Fdevin-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fdynatrace\u002Fskills\u002Fdt-obs-analytics\u002Fscripts\u002Fextract-timeseries-dashboard.js",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"scripts\u002Fextract-timeseries-notebook.js",8400,"https:\u002F\u002Fgithub.com\u002FCognitionAI\u002Fdevin-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fdynatrace\u002Fskills\u002Fdt-obs-analytics\u002Fscripts\u002Fextract-timeseries-notebook.js",{"path":58,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":59,"sourceHtmlUrl":60},"scripts\u002Frun-analyzer.js",16262,"https:\u002F\u002Fgithub.com\u002FCognitionAI\u002Fdevin-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fdynatrace\u002Fskills\u002Fdt-obs-analytics\u002Fscripts\u002Frun-analyzer.js",[62,69,76,82,89,96],{"skillNo":63,"name":64,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":65,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M7BYC4AJGM98P2G9JH7QS24Z","business-data","MIT","https:\u002F\u002Fgithub.com\u002FCognitionAI\u002Fdevin-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fwindsor-ai\u002Fskills\u002Fbusiness-data\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":65,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7BYBZ0CD4CBCPZHRZ551BNK","workflow","Creates durable, resumable workflows using Vercel's Workflow SDK. Use when building workflows that need to survive restarts, pause for external events, retry on failure, or coordinate multi-step operations over time. Triggers on mentions of \"workflow\", \"durable functions\", \"resumable\", \"workflow sdk\", \"queue\", \"event\", \"push\", \"subscribe\", or step-based orchestration.","https:\u002F\u002Fgithub.com\u002FCognitionAI\u002Fdevin-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fvercel\u002Fskills\u002Fworkflow\u002Fupstream\u002FSKILL.md",[],[],{"skillNo":77,"name":71,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":65,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7BYB1XSZHKHD8JZTQJ62JN0","Vercel Workflow SDK expert guidance. Use when building durable workflows, long-running tasks, API routes or agents that need pause\u002Fresume, retries, step-based execution, or crash-safe orchestration with Vercel Workflow.","https:\u002F\u002Fgithub.com\u002FCognitionAI\u002Fdevin-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fvercel\u002Fskills\u002Fworkflow\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":65,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7BYASGMK935J33E21N5WTW0","verification","Full-story verification — infers what the user is building, then verifies the complete flow end-to-end: browser → API → data → response. Triggers on dev server start and 'why isn't this working' signals.","https:\u002F\u002Fgithub.com\u002FCognitionAI\u002Fdevin-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fvercel\u002Fskills\u002Fverification\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":65,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M7BY9WJERKSKEH9HK6E71GW2","vercel-storage","Vercel storage expert guidance — Blob, Global Config (formerly Edge Config), and Marketplace storage (Neon Postgres, Upstash Redis). Use when choosing, configuring, or using data storage with Vercel applications.","https:\u002F\u002Fgithub.com\u002FCognitionAI\u002Fdevin-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fvercel\u002Fskills\u002Fvercel-storage\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":65,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M7BY9N034894YV2J9DCRZHYS","vercel-services","Configure and troubleshoot Vercel Services for multiple frontends and backends in one project. Use when composing a polyglot or multi-service application on one Vercel deployment; defining the `services` key, service-targeted rewrites, or service bindings in `vercel.json`; or running all services with `vercel dev`.","https:\u002F\u002Fgithub.com\u002FCognitionAI\u002Fdevin-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fvercel\u002Fskills\u002Fvercel-services\u002FSKILL.md",[],[]]