Getting Started
TutorialWhat Are Dynatrace Extensions 2.0?
Extensions 2.0 is Dynatrace's framework for bringing custom data into the platform. If Dynatrace doesn't have a built-in integration for your technology, you build an extension.
There are two types:
- SNMP extensions ā Declarative YAML that tells Dynatrace which OIDs to poll from network devices (switches, routers, firewalls, UPS, etc.)
- Python extensions ā Custom Python code using the
dt-extensions-sdkfor any data source with an API (REST, WSMAN, CLI, etc.)
Both types share the same extension.yaml file format for defining metrics, topology, screens, and dashboards. The difference is where the data comes from.
How Extensions Work
The flow is always the same:
extension.yaml (your code)
ā Upload to Dynatrace (signed ZIP)
ā Extension Execution Controller (EEC) runs it
ā Metrics flow into Dynatrace
ā Entities created from topology rules
ā Screens display the data
The EEC runs on an ActiveGate (for remote data sources like SNMP devices) or on OneAgent (for local data). It reads your extension.yaml, polls the data source on a schedule, and sends metrics to Dynatrace.
What's in an Extension Package?
An extension is a signed ZIP containing:
bundle.zip ā What you upload to Dynatrace
āāā extension.zip ā Your actual extension
ā āāā extension.yaml ā The core ā metrics, topology, screens
ā āāā snmp/ ā MIB files (SNMP extensions only)
ā āāā lib/ ā Python wheel (Python extensions only)
ā āāā dashboards/ ā Dashboard JSON definitions
ā āāā alerts/ ā Alert definitions
āāā extension.zip.sig ā Digital signature
āāā extension.zip.sig.tsr ā Timestamp (official extensions only)
The extension.yaml File
This is where everything lives. Every extension starts with the same header:
name: custom:com.dynatrace.extension.my-device
version: 0.0.1
minDynatraceVersion: "1.318.0"
author:
name: Your Name
Key rules:
nameā Must start withcustom:for non-Dynatrace extensions. Use reverse-DNS style naming.versionā Semantic versioning:major.minor.patch. Dynatrace stores up to 10 versions.minDynatraceVersionā Must be in quotes. Use"1.318.0"or later for current features.
Environment Setup
To build extensions, you need:
1. VS Code with Dynatrace Extensions Add-on
Install from the VS Code marketplace. Provides YAML schema validation, snippets, and build commands. Search for "Dynatrace Extensions" in Extensions.
2. dt-cli (Command Line Tool)
Used to assemble and sign extension packages:
# Install dt-cli
python3 -m venv /tmp/dtcli-venv
/tmp/dtcli-venv/bin/pip install dt-cli
export PATH="/tmp/dtcli-venv/bin:$PATH"
# Verify
dt --version
3. Signing Certificates
Every extension must be signed. Generate a CA and developer certificate:
# Generate CA certificate (no passphrase for dev)
dt ext genca --no-ca-passphrase
# Generate developer certificate
printf "Your Name\n" | dt ext generate-developer-pem \
--ca-crt ca.pem --ca-key ca.key -o developer.pem
The CA certificate (ca.pem) must be uploaded to:
- Dynatrace Credential Vault ā So the server trusts your extensions
- ActiveGate certificates directory ā So the runtime can verify signatures
4. A Dynatrace Environment
You need a Dynatrace environment with:
- An ActiveGate (for SNMP extensions)
- API token with
extensions.readandextensions.writescopes - The EEC enabled in Settings ā Preferences ā Extension Execution Controller
Your First Extension
Let's create the simplest possible valid extension ā just the header. No metrics, no topology, no screens. Just enough to upload to Dynatrace.
name: custom:com.dynatrace.extension.my-first-device
version: 0.0.1
minDynatraceVersion: "1.318.0"
author:
name: Student
metrics: []
snmp:
- group: default
interval:
minutes: 1
dimensions:
- key: device.address
value: this:device.address
This extension:
- Has a valid name with
custom:prefix - Declares one SNMP group with a 1-minute polling interval
- Captures the device IP address as a dimension
- Collects no metrics yet (we'll add those in Module 2)
Build & Sign
# 1. Assemble (creates extension.zip)
dt ext assemble --source ./ext --output ./extension.zip
# 2. Sign (creates bundle.zip ā the uploadable package)
dt ext sign --src ./extension.zip --key developer.pem --output ./bundle.zip
# 3. Upload to Dynatrace
curl -X POST "https://YOUR-ENV.live.dynatrace.com/api/v2/extensions" \
-H "Authorization: Api-Token YOUR-TOKEN" \
-F "file=@bundle.zip"
What's Next
In Module 1, we'll learn SNMP fundamentals ā OIDs, MIBs, scalar vs table data ā so you know what to put in your extension.yaml. In Module 2, we'll add real metrics and dimensions.
By Module 8, you'll have a complete production-ready extension with entities, screens, dashboards, and alerts.
š Hands-On Exercise
Edit the YAML in the editor, then click "Check My Work" to validate.
Your First Extension
Complete this minimal extension.yaml to poll sysUpTime from a network device.
- Fill in the
name:field using thecustom:prefix pattern - Add the correct scalar OID for sysUpTime (
1.3.6.1.2.1.1.3.0) - Set the metric type to
gauge - Add a
sys.namedimension using OID1.3.6.1.2.1.1.5.0
Click Check My Work when done.