dt-js-runtime
dynatrace/dynatrace-for-ai
Dynatrace server-side JavaScript runtime for executing functions with Web APIs, Node.js modules, and SDK access.
What is dt-js-runtime?
A sandboxed JavaScript/TypeScript execution environment for Dynatrace AppEngine. Use it to run async functions with access to fetch, crypto, streams, and the @dynatrace-sdk/* catalog, subject to runtime limits and security restrictions.
- Execute async JavaScript/TypeScript functions in a server-side sandbox
- Call internal Dynatrace platform APIs and external URLs via fetch with credential vault support
- Access Web APIs (fetch, crypto, TextEncoder, etc.) and Node.js compat modules (streams, buffer, etc.)
- Enforce runtime limits: timeouts, memory quotas, and I/O restrictions
- Retrieve secrets from credential vault for authenticated requests
- Use @dynatrace-sdk/* packages for Dynatrace-specific integrations
How to install dt-js-runtime
npx skills add https://github.com/dynatrace/dynatrace-for-ai --skill dt-js-runtime- Dynatrace environment with AppEngine enabled
- dtctl CLI installed and authenticated (via dynatrace-control skill)
- Node.js 18+ for local development (optional)
How to use dt-js-runtime
- 1.Install the skill via npx skills add
- 2.Load the appropriate reference file: limits-and-restrictions.md for quotas, apis-and-modules.md for available APIs, fetch.md for HTTP calls, or sdk.md for @dynatrace-sdk/* packages
- 3.Write an async function with a default export matching the function contract
- 4.Test locally using dtctl exec function --code or dtctl exec function -f script.js
- 5.Pass optional JSON input via --payload flag to test with arguments
- 6.Deploy the function to Dynatrace AppEngine or run it on-demand via dtctl
Use cases
- Automate data collection or remediation workflows via Dynatrace platform APIs
- Build custom integrations that fetch external data and process it server-side
- Execute scheduled or event-triggered functions without deploying a full application
- Prototype and test AppEngine logic locally using dtctl before deployment
- Securely call third-party APIs using stored credentials from the vault
- Dynatrace platform administrators and developers
- DevOps engineers building automation workflows
- Integration specialists connecting Dynatrace to external systems
- AppEngine application developers
dt-js-runtime FAQ
Every entry point must export a default async function with optional parameter: export default async function(payload?) { ... }. ES module syntax is required; TypeScript is accepted.
Refer to references/limits-and-restrictions.md for timeout, memory, and I/O quotas. Forbidden operations include eval, WebSocket, raw sockets, and filesystem access.
Use the fetch API. For internal /platform/... endpoints or external URLs, see references/fetch.md for credential vault integration and outbound allowlist configuration.
Yes, a subset of Node.js compat modules are available (streams, buffer, crypto, etc.). Check references/apis-and-modules.md for the full list.
Use dtctl exec function with --code for inline code or -f for a file. Pass JSON input via --payload, which is parsed and passed directly as the function argument.
Full instructions (SKILL.md)
Source of truth, from dynatrace/dynatrace-for-ai.
name: dt-js-runtime description: Dynatrace server-side JS runtime — function contract, runtime limits, Web APIs, Node.js modules, fetch with credential vault, and the @dynatrace-sdk/* catalog. license: Apache-2.0
Dynatrace JavaScript Runtime
The Dynatrace JS runtime is a server-side AppEngine sandbox that executes JavaScript/TypeScript.
Function contract
Every entry point must export a default async function:
export default async function () {
// ...
return result;
}
ES module syntax required. TypeScript accepted (type annotations, interfaces, generics). No other export shape is supported.
References
Start here, then load only the file you need.
| File | When to load |
|---|---|
| references/limits-and-restrictions.md | Timeout / memory / I/O quotas; what's forbidden (eval, WebSocket, sockets, filesystem) |
| references/apis-and-modules.md | Which Web APIs and Node.js compat modules are available (fetch, crypto, streams, buffer, …) |
| references/fetch.md | Calling internal /platform/... APIs or external URLs, credential vault, outbound allowlist |
| references/sdk.md | Any @dynatrace-sdk/* package — the index routes you to the right per-SDK file |
Running a function with dtctl
Use dtctl exec function to run JS runtime code without deploying an app.
# Run inline code
dtctl exec function --code 'export default async function() { return "hello" }'
# Run from file
dtctl exec function -f script.js
# Pass JSON input — the parsed object is the function's argument
dtctl exec function -f script.js --payload '{"key":"value"}'
The function may accept an optional parameter. --payload is parsed and passed
as that argument directly — it is not wrapped in an event.payload field:
export default async function(payload) {
// with --payload '{"key":"value"}', payload is {"key": "value"}
return payload.key;
}
Load the dynatrace-control skill for authentication setup, context switching, and the full exec function reference.
Related skills
More from dynatrace/dynatrace-for-ai and the wider catalog.

dt-migration
Migrate Dynatrace classic and Gen2 entity-based DQL queries to Smartscape equivalents.

dt-obs-aws
Monitor and analyze AWS infrastructure—EC2, RDS, Lambda, ECS/EKS, VPC, load balancers, storage, and costs—using Dynatrace Smartscape and DQL.

dt-obs-azure
Monitor and audit Azure infrastructure, resources, and security posture in Dynatrace.

dt-obs-frontends
Real User Monitoring (RUM) on Dynatrace — monitor web and mobile frontend performance, errors, and user sessions.

dt-obs-gcp
Monitor and audit GCP infrastructure—compute, networking, Kubernetes, serverless, IAM, and messaging—via Dynatrace Smartscape and DQL.

dt-obs-hosts
Monitor host and process infrastructure metrics including CPU, memory, disk, network, and technology inventory.