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.
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
Tenant confirmation — REQUIRED before any tenant write
Before the agent runs any
dtctl 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.:
bash
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:
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).
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.