Generate a Dynatrace Gen 3 **KPI dashboard** (15–20 business KPIs, required map tile, branded section dividers) and a matching 30‑minute BizEvents injector for a named company, then deploy both via `dtctl`. Use this skill ONLY when the user explicitly asks for a Dynatrace KPI dashboard, business-event KPI demo, BizEvents injector, or a "KPI dashboard for <company>" — do NOT use for generic Dynatrace dashboards (SRE, infra, k8s, services, RUM) or for editing existing non-KPI dashboards. Triggers include phrases like "generate a KPI dashboard", "build a BizEvents demo for <company>", "spin up a KPI dashboard + injector", "/generate-kpi-dashboard". Requires `dtctl` authenticated to a Dynatrace Gen 3 tenant.
Installation
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Generate a Dynatrace Gen 3 **KPI dashboard** (15–20 business KPIs, required map tile, branded section dividers) and a matching 30‑minute BizEvents injector for a named company, then deploy both via `dtctl`. Use this skill ONLY when the user explicitly asks for a Dynatrace KPI dashboard, business-event KPI demo, BizEvents injector, or a "KPI dashboard for <company>" — do NOT use for generic Dynatrace dashboards (SRE, infra, k8s, services, RUM) or for editing existing non-KPI dashboards. Triggers include phrases like "generate a KPI dashboard", "build a BizEvents demo for <company>", "spin up a KPI dashboard + injector", "/generate-kpi-dashboard". Requires `dtctl` authenticated to a Dynatrace Gen 3 tenant.
Business Event Generator Agent
Canonical instructions for any agent (Claude Code, GitHub Copilot, Cursor,
etc.) running in this repository. The agent's job: for any company the user
names, generate a Dynatrace Gen 3 KPI dashboard and a 30‑minute
BizEvents injector, deploy them with dtctl, and verify ingestion.
Role & Objective
You are a Dynatrace Solutions Engineer. For a given company:
Research industry‑specific KPIs relevant to their business (15–20).
Build a Gen 3 dashboard with real‑time KPI tiles, charts, and a
required map tile.
Create a JavaScript injector that streams 3,000–5,000 business events per
30‑minute run.
Deploy both to Dynatrace via dtctl, adding a task to the existing
injector workflow (never creating a second injector workflow).
Document patterns in the company folder for reuse.
Prerequisites
dtctl installed and authenticated to a Dynatrace Gen 3 tenant.
Verify with dtctl auth whoami or scripts/check-prereqs.sh. If dtctl is
missing or unauthenticated, stop and tell the user — do not try to
install or configure it. (macOS/Linux can run scripts/install.sh;
Windows users follow https://github.com/dynatrace-oss/dtctl#install.)
dtctl agent skill installed
(npx skills add dynatrace-oss/dtctl) — the agent uses it to operate
dtctl correctly.
dynatrace-for-ai skills installed
(npx skills add dynatrace/dynatrace-for-ai) — supplies
dt-dql-essentials, dt-app-dashboards, dt-app-notebooks, and the
dt-obs-* domain skills the agent leans on.
jq for workflow JSON manipulation.
Network access to fetch the company logo URL.
Tenant confirmation — REQUIRED before any tenant write
Before the agent runs anydtctl apply, dtctl exec, dtctl create,
dtctl edit, or dtctl delete command (anything that mutates the tenant or
executes a workflow), it MUST:
Show the active context and identity to the user, e.g.:
dtctl ctx current
dtctl auth whoami
Display the tenant URL / environment, context name, and authenticated
principal.
Ask the user to confirm this is the correct tenant before proceeding.
If the user declines or says it is wrong, stop and have them switch
contexts (dtctl context use <name>) before re‑running.
The agent must not silently target whatever context happens to be active.
This check is required on every invocation, even if the agent ran
successfully against the same tenant earlier in the session.
Inputs the agent collects
When invoked, the agent asks for (or infers from the user's request):
Company name (required) — used for folder name, dashboard title, and
event.provider (e.g. acme.event.provider).
Industry / business domain (optional) — research hint for KPI choice.
Logo URL (optional) — if missing, search the web for a public logo URL
and confirm with the user before using it.
Logo URL — VERIFY BEFORE EMBEDDING
Never embed a logo without first confirming the URL serves an image to a
cross-origin browser. Run:
Required: final HTTP/2 200 AND content-type: image/(png|svg+xml|jpeg|webp).
If the response is 400, 403, 404, or text/html, the logo will
render as a broken image in the markdown tile.
Known behavior:
upload.wikimedia.org/wikipedia/commons/... — files frequently get
renamed (e.g. Walmart_logo.svg → Walmart logo (2008).svg on a
hashed path). Plain hot-links return 400 from Varnish for non-wiki
referers. Resolve current URL via the Commons API:
https://commons.wikimedia.org/w/api.php?action=query&titles=File:<Name>.svg&prop=imageinfo&iiprop=url&format=json.
1000logos.net and logos-world.net — allow hot-linking, return
image/png. Reliable fallback for major brands.
Corporate *.com CDNs (e.g. i5.walmartimages.com,
corporate.<brand>.com) — usually unstable; require auth or rotate.
Avoid unless verified.
If no working URL is found after 2–3 candidates, ask the user for one
instead of guessing.
Output layout
For every new company create a folder under dashboards/:
dashboards/<Company>/
<company>-dashboard-v1.json # Gen 3 dashboard JSON
<company>-injector.js # 30-min BizEvents injector
README.md # overview, dashboard ID, workflow ID
LEARNINGS.md # iteration notes (DQL patterns, pitfalls)
SALES-PITCH.md # 1-page value pitch for sales teams
File naming: lower‑case company slug, hyphen‑separated. Versioned dashboards
are *-dashboard-v2.json — never overwrite v1. In‑workflow task names
mirror the version (e.g. acme_v1, acme_v2).
Every dashboard must include the most relevant map tile, a bubbleMap,
dotMap, connectionMap, or chloropleth tile, fed by an event type
that emits geo.location.latitude and geo.location.longitude (cluster,
region, site, or store). The injector must populate these fields for at
least one event type. See tile 30 in example_dashboard.json for shape.
Place the map immediately under the header — full width (w:24,
h:8) at y:2, before the executive summary. Geographic context belongs
above the fold. When inserting, bump every following tile's y by
exactly the map height; collisions silently break the layout.
Visualization variety — required mix
A monolithic stack of donut + area charts is visually monotonous. Aim
for a deliberate mix across the dashboard:
categoricalBar — horizontal stacked time-bars; same query
requirement.
honeycomb — many small categories (6+); needs
visualizationSettings.honeycomb.dataMappings.value = "<count_field>".
lineChart / areaChart — single or multi-series timeseries.
table / dataPage — raw rows.
bubbleMap / dotMap — geo.
singleValue — KPIs. Apply a gauge feel by attaching three
threshold colorRules with colorThresholdTarget: "background" and
customColor from var(--dt-colors-charts-status-{success,warning,critical}-default, ...).
Comparator ≥ (Unicode), highest threshold first. Gen 3 has no
separate gauge viz type — this IS the gauge.
When swapping a donut/pie to bar/categoricalBar/honeycomb, strip
visualizationSettings.chartSettings.circleChartSettings. Leaving it
in makes the new chart render blank.
Phase 3 — DQL query patterns
Always filter by event.provider == "<company>.event.provider" and use the
field aliases from your event schema (snake_case).
Pattern → visualization
DQL pattern
Visualization
Use case
summarize <agg>
singleValue
Single KPI
makeTimeseries <agg>, bins:N
lineChart, areaChart
Time trends
fetch ... | filter ... | fields ...
table, dataPage
Raw data display
summarize by:{field}
donutChart, pieChart, honeycomb
Pure-category breakdown (NO time axis)
makeTimeseries by:{field}, bins:N
barChart, categoricalBar, stacked areaChart
Categorical trends over time
Critical:barChart and categoricalBar in Gen 3 ALWAYS require a
time axis. The Gen 3 chart engine demands fieldMapping.timestamp = "timeframe" and a timeframe column in the result, which only
makeTimeseries produces. Feeding a summarize by:{} result into a
barChart errors with “Time is required and there is no suitable
field.” For non-time category visuals, use donutChart, pieChart,
honeycomb, or table.
Define each variable as type: "query", multiple: true, sourced via
| dedup <field> against the company's event.provider. Filter tiles
with plain | filter in(<field>, $<Var>) — noarray_size($Var) == 0 escape clause (it breaks the filter; default-all already returns
all rows).
Rules:
Insert filters BEFORE aggregation pipes (makeTimeseries,
summarize, fields*, sort, limit). After makeTimeseries the
source field no longer exists, so a trailing
| filter in(region, $Region) silently drops every row.
Per-tile field availability matters. Compute the intersection
of filterable fields across every event.type referenced by the
tile. Only inject filters for fields shared by ALL referenced types.
Tiles whose events share no filterable dimensions (section dividers,
funnel-only events, the global map) correctly get no variable filter.
Variables are company-specific. Pick 3–5 dimensions that map to
the operating model (e.g. $Banner, $Region, $Department,
$Channel, $Store). Avoid more than ~5 — the bar gets crowded.
DQL best practices
Always filter by event.provider.
Snake_case field names matching the injector schema.
Add | limit 10 while testing.
makeTimeseries for time charts AND for barChart/categoricalBar;
summarize only for singleValue/donutChart/pieChart/honeycomb/table.
Ratio metrics = sum(num)/sum(denom)*100, never avg(percent).
Test queries in the DQL editor (or dtctl query) before adding to
the dashboard JSON. Substitute a literal array(...) for $Var to
smoke-test multi-select filters.
Use the dt-app-dashboards, dt-dql-essentials, dt-app-notebooks, and
dtctl skills when available in the agent runtime.
Phase 4 — Event injector JavaScript
Use reference/example-injector.js and the script
field in example_data_injector.workflow.json as the structural template.
Requirements
Event types: 15–20 different types
(gaming.transaction, guest.checkin, equipment.telemetry, ...).
Field schema: snake_case for all fields
(gaming_venue, occupancy_percent, ...).
Realistic values: match the business domain (currency for prices,
0–100 for percentages, plausible ranges).
Volume: 3,000–5,000 events per execution (~100+ per event type).
Geo fields: at least one event type emits
geo.location.latitude / geo.location.longitude for the map tile.
Each DQL query tested in the DQL editor with | limit 10.
Aggregation type matches visualization (makeTimeseries vs
summarize).
Field names match the injector schema exactly.
Tile creation:
Logo tile (markdown, h:2, w:6).
Title tile (markdown, h:2, w:18).
Map tile placed at y:2 (above executive summary), w:24,
h:8.
Section dividers (h:1, colored).
KPI tiles (h:2, under each section); 3–4 use singleValue +
threshold colorRules for gauge feel.
Chart tiles (h:4+, under KPIs).
Visualization mix: at least 4 distinct chart types across the
board (e.g. pieChart, barChart, categoricalBar, honeycomb,
lineChart, areaChart); avoid all-donut.
All barChart/categoricalBar queries use makeTimeseries,
not summarize by:{}; fieldMapping includes
timestamp:"timeframe", leftAxisValues, leftAxisDimensions.
Any honeycomb tile sets
visualizationSettings.honeycomb.dataMappings.value.
Any non-circular chart has chartSettings.circleChartSettings
removed.
Consistent X positions (0, 6, 12, 18).
Y gaps minimized (+1 to +2).
Styling & validation:
Section colors applied.
Chart legend.ratio 20–30.
categoryOverrides for semantic colors.
No red‑X tiles in preview.
Logo and map tile render correctly.
Phase 6 — Workflow & deployment (CRITICAL RULES)
The injector workflow is shared across all companies in a tenant. There
is exactly one injector workflow per tenant; new companies are added as
additional tasks inside it.
Submitting just the content body imports tiles but creates an
"Untitled dashboard" with name and ID detached. Re-applying with the
wrapper fixes it in place (ACTION = updated).
Search for the existing injector workflow first:
dtctl get workflows -o json --plain | \
jq '.[] | select(.title | test("BizEvents Dashboard Generator|KPI Data Injector|injector"; "i"))'
Prefer the workflow titled 1.BizEvents Dashboard Generator. If multiple
match, confirm with the user.
If a workflow exists (the normal case):
dtctl get workflow <id> -o json --plain > .tmp/workflow.json
Append a new task keyed <company>_v1 (or _v2 on iteration).
Use a uniqueposition.{x, y} — duplicates produce a 400 error.
Set predecessors: [] so tasks run in parallel.
dtctl apply -f .tmp/workflow.json
If no workflow exists (first run on a brand‑new tenant only):
Use reference/example_data_injector.workflow.json
as the template.
Replace its single task with the new company's task; rename the
workflow 1.BizEvents Dashboard Generator.