šŸ“” SNMP Extensions — Module 0

Getting Started

Tutorial

What 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-sdk for 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 with custom: 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:

  1. Dynatrace Credential Vault — So the server trusts your extensions
  2. 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.read and extensions.write scopes
  • 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 the custom: 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.name dimension using OID 1.3.6.1.2.1.1.5.0

Click Check My Work when done.

extension.yamlYAML
Loading...