PluginBench
Skill
Pass
Audit score 90

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
Prerequisites
  • Dynatrace environment with AppEngine enabled
  • dtctl CLI installed and authenticated (via dynatrace-control skill)
  • Node.js 18+ for local development (optional)
Claude Code
Cursor
Windsurf
Cline

How to use dt-js-runtime

  1. 1.Install the skill via npx skills add
  2. 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. 3.Write an async function with a default export matching the function contract
  4. 4.Test locally using dtctl exec function --code or dtctl exec function -f script.js
  5. 5.Pass optional JSON input via --payload flag to test with arguments
  6. 6.Deploy the function to Dynatrace AppEngine or run it on-demand via dtctl

Use cases

Good for
  • 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
Who it's for
  • Dynatrace platform administrators and developers
  • DevOps engineers building automation workflows
  • Integration specialists connecting Dynatrace to external systems
  • AppEngine application developers

dt-js-runtime FAQ

What function signature is required?

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.

What are the runtime limits?

Refer to references/limits-and-restrictions.md for timeout, memory, and I/O quotas. Forbidden operations include eval, WebSocket, raw sockets, and filesystem access.

How do I call Dynatrace APIs or external services?

Use the fetch API. For internal /platform/... endpoints or external URLs, see references/fetch.md for credential vault integration and outbound allowlist configuration.

Can I use Node.js modules?

Yes, a subset of Node.js compat modules are available (streams, buffer, crypto, etc.). Check references/apis-and-modules.md for the full list.

How do I test a function locally?

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.

FileWhen to load
references/limits-and-restrictions.mdTimeout / memory / I/O quotas; what's forbidden (eval, WebSocket, sockets, filesystem)
references/apis-and-modules.mdWhich Web APIs and Node.js compat modules are available (fetch, crypto, streams, buffer, …)
references/fetch.mdCalling internal /platform/... APIs or external URLs, credential vault, outbound allowlist
references/sdk.mdAny @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.