Log Locations
Extension logs live on the ActiveGate:
# Extension datasource logs
/var/lib/dynatrace/remotepluginmodule/log/extensions/datasources/{extension-name}/
# Tail while testing
tail -f /var/lib/dynatrace/.../datasources/com.dynatrace.extension.my-ext/*.log
Common Errors
| Error Message | Cause | Fix |
|---|---|---|
Cannot find module __main__ | Missing __main__.py in wheel | Check wheel structure, rebuild |
No module named X | Dependency not bundled in wheel | Add to setup.py install_requires |
DEVICE_CONNECTION_ERROR | API unreachable or timeout | Check network, increase timeout |
Certificate validation failed | CA cert not on ActiveGate | Copy ca.pem to AG certs dir |
metric key not found | Key mismatch code vs YAML | Compare report_metric keys with metrics: section |
๐ก Search for ERROR and Exception in the log โ Python tracebacks show the exact line number.
๐ Try it
This extension has a scalar OID missing .0 and a count metric with the wrong key. Find and fix both bugs.
extension.yamlYAML
Loading...
Local Testing
# test_local.py
from your_extension.__main__ import MyExtension
ext = MyExtension()
ext.activation_config = {
"host": "10.0.0.1",
"api_token": "test-token"
}
ext.query() # Run one poll cycle
โ ๏ธ report_metric() won't send data locally โ it needs the EEC runtime. Print the values instead for testing.
Debugging Checklist
| Check | How |
|---|---|
| AG logs for tracebacks | grep -r "Exception\|ERROR" /var/lib/dynatrace/.../datasources/ |
| Monitoring config correct | Dynatrace UI โ Extensions โ Monitoring configurations |
| EEC running | systemctl status dynatracegateway |
| Metric keys match | Compare report_metric() calls with metrics: in YAML |
| CA cert installed | Check both Credential Vault and AG certificates/ dir |
๐ Try itExercise 2
This table subgroup has a scalar OID ending in .0 and a metric used in snmp: but missing from metrics: metadata. Fix both.
extension.yamlYAML
Loading...
What's Next
๐ Python track complete! Continue to Production Skills for alerts, validation, and real-world case studies.