agentleFS
kryptophonikkryptophonik/SRE-Skills/skills/sre-dynatrace/SKILL.md

sre-dynatrace

Skill4 starsChanged 23 days agoMITView on GitHub

Use when data lives in Dynatrace: DQL for problems, logs, metrics and entities, Davis problem triage, SLO and health checks. Read-only MCP or DQL for Notebooks.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Wait for explicit human approval before any prod-changing command, MCP write tool, or external post.

    line 12
  2. Very specific:

    Always bound the timeframe (from: now()-2h) to limit Grail scan cost.

    line 23
  3. Distinctive:

    If neither MCP nor the scripts can reach the tenant, give the user the query to paste into a Notebook.

    line 38
  4. Distinctive:

    Check recent deployments/config events on the entity.

    line 45
  5. Very specific:

    Verify field names in your environment first with smartscapeNodes "SERVICE" | limit 1.

    line 112

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Dynatrace for SRE

Safety gates (REQUIRED)

  1. Read-only diagnosis first.
  2. Propose each change with risk (low/med/high) and reversibility.
  3. Wait for explicit human approval before any prod-changing command, MCP write tool, or external post.
  4. Act only as approved, verify, and stop and escalate if anything gets worse.

Full rules: sre-safety-gates. Read-only MCP setup: sre-safety-gates/references/mcp.md.

Process skills: sre-incident-command, sre-engineer, sre-diagnostics, sre-slo-alerting, sre-dependency-mapping.

Access

  • MCP (preferred): Dynatrace MCP server — tools such as <server>:list_problems, <server>:execute_dql, <server>:verify_dql, <server>:find_entity_by_name, <server>:get_kubernetes_events (fully qualified; check names with /mcp). Run verify_dql before execute_dql on new queries. The local dynatrace-oss server is deprecated (final 2.1.2); prefer Dynatrace for AI + dtctl or the Dynatrace Remote MCP Server (see sre-safety-gates/references/mcp.md).
  • Fallback: paste DQL into a Notebook; give the user the query.
  • Always bound the timeframe (from: now()-2h) to limit Grail scan cost.

Scripts and references

These live in this skill's folder. Paths are relative to it.

  • bash scripts/dql.sh '<query>' runs one read-only DQL query. It uses dtctl if it's installed and signed in. Otherwise it uses the Grail query API with DT_ENVIRONMENT and DT_PLATFORM_TOKEN from the environment. It refuses anything that isn't a read query (fetch, timeseries, smartscapeNodes, smartscapeEdges, data, describe, fieldsSnapshot). Use it when no Dynatrace MCP server is connected and the user has set up access.
  • bash scripts/check-fields.sh <data object> [window] prints the field names of one sample record, for example bash scripts/check-fields.sh logs 2h. Run it before writing a query against fields you haven't seen in this tenant.
  • references/dql-cheatsheet.md has the start commands, time ranges and the common-mistakes table. Read it before writing DQL.
  • references/metrics-and-fields.md lists metric keys, units and key fields. Anything marked "verify" has to be checked in the tenant.
  • references/problems.md has the problem triage queries.

To check a query before running it, or when it returns nothing, follow references/dql-review.md.

If neither MCP nor the scripts can reach the tenant, give the user the query to paste into a Notebook.

Triage flow

  1. Open problems in scope (query below or list_problems).
  2. For the top problem: affected entities, root-cause entity, start time.
  3. Pull related logs and metrics for that entity and window.
  4. Check recent deployments/config events on the entity.
  5. Hand findings to sre-engineer; propose remediation with approval.

DQL cookbook

Reviewed against Dynatrace's dynatrace-for-ai skills. Use the Smartscape forms (dt.smartscape.*, smartscapeNodes, getNodeName()) first. Classic fallback for older tenants: dt.entity.* dimensions with entityName() and fetch dt.entity.<type>.

Active problems:

fetch dt.davis.problems, from: now()-24h
| filter not(dt.davis.is_duplicate) and event.status == "ACTIVE"
| fields event.start, display_id, event.name, event.category, affected_entity_ids = smartscape.affected_entities[][id], root_cause_entity_id, root_cause_entity_name
| sort event.start desc

Problem count over time (noise trend):

fetch dt.davis.problems, from: now()-7d
| filter not(dt.davis.is_duplicate)
| makeTimeseries problems = count(default: 0), time: event.start, interval: 1h

Mean time to resolve:

fetch dt.davis.problems, from: now()-7d
| filter not(dt.davis.is_duplicate) and event.status == "CLOSED"
| fieldsAdd hours = toLong(event.end - event.start) / 3600000000000.0
| makeTimeseries avg_hours = avg(hours), time: event.end, interval: 1d

Host CPU top 10:

timeseries usage = avg(dt.host.cpu.usage), by: { dt.smartscape.host }
| fieldsAdd host = getNodeName(dt.smartscape.host)
| sort arrayAvg(usage) desc
| limit 10

Error logs by workload:

fetch logs, from: now()-1h
| filter loglevel == "ERROR"
| summarize errors = count(), by: { k8s.namespace.name, k8s.workload.name }
| sort errors desc
| limit 20

Service error % and p95 (response_time is in microseconds):

timeseries { total = sum(dt.service.request.count), failed = sum(dt.service.request.failure_count), p95_us = percentile(dt.service.request.response_time, 95, rollup: avg) }, by: { dt.smartscape.service }
| fieldsAdd service = getNodeName(dt.smartscape.service), error_pct = if(total[] > 0, failed[] * 100.0 / total[])

Find a service by name:

smartscapeNodes "SERVICE"
| filter contains(name, "<name>", caseSensitive: false)
| fields id, name

Verify field names in your environment first with smartscapeNodes "SERVICE" | limit 1. Classic fallback: fetch dt.entity.service | filter contains(entity.name, "<name>") | fields id, entity.name.

Metric and field names vary by environment and Grail version; check with verify_dql or Notebook autocomplete.

Output

  • Findings with the DQL used, timeframe, entities, problem IDs, and links/notebook names

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.