Troubleshoot extensions

If after deploying your extension the results are different from your expectations, try one of the following actions to find out what went wrong.

Dynatrace extension framework upgrade notice

Starting with Dynatrace OneAgent and ActiveGate version 1.231, we are upgrading the Extension Framework (also referred to as the plugins framework) from Python 3.6 to Python 3.8.

  • Consequences: Some Dynatrace extensions running in your environment may stop working and require redeployment of a new version prepared for Python 3.8.
  • Symptoms:
    • No data is provided for affected metrics on dashboards, alerts, and custom device pages populated by the affected extension metrics.
    • Extension logs display errors. Most often this will manifest itself as Python ModuleNotFoundError in the PluginAgent log.
    • Sometimes the Python virtual machine crashes.
  • Impact: This issue affects only those extensions that use native libraries called from Python code distributed with the extension.

Extension

What to do

  1. In Dynatrace Hub, find and select one of the extensions listed to the left.
  2. On the extension details page, select Download to download the extension ZIP file to your machine. If there are operating system options, be sure to select the correct download for your deployment.
  3. Deploy the extension per the instructions on the corresponding documentation page. (In the list to the left, select the name of the extension.)

For assistance, contact a Dynatrace product expert via live chat within your Dynatrace environment.

No action required. Extensions distributed with OneAgent will be updated automatically to work with Python 3.8 together with the Python upgrade.

To learn about upgrading custom Dynatrace extensions from Python 3.6 to Python 3.8, see Upgrade custom Dynatrace extensions from Python 3.6 to Python 3.8.

Browse the Dynatrace UI

Go to the Technology overview page to verify that your monitored technology is displayed on one of the tiles. If you can't find it, your device group wasn't reported by the extension.

Click your device group. If the device group doesn't contain a device, your device wasn't reported. If there are no metrics reported in the device group, the extension isn't sending group metrics. Note that this may be the expected behavior.

Check extension status in the Dynatrace UI

You can find the problems reported by a running extension on the Monitored technologies page. Go to Settings > Monitoring > Monitored Technologies and select the Custom extensions tab. The extensions that report errors are displayed in red. Click the extension name to see the reported errors.

Check the logs

ActiveGate extensions

  • On Linux, logs are stored at /var/lib/dynatrace/remotepluginmodule/log/remoteplugin.
  • On Windows, logs are stored at %PROGRAMDATA%\Dynatrace\remotepluginmodule\log\remoteplugin.

The base folder contains logs from Remote Plugin Module internals. The extension messages are stored in subfolders. Let's use an example:

import logging
from ruxit.api.base_plugin import RemoteBasePlugin
logger = logging.getLogger(__name__)
class LogPluginRemote(RemoteBasePlugin):
def query(self, **kwargs):
logger.info('LogPluginRemote query is called')
{
"name": "custom.remote.python.log_demo",
"version": "1.001",
"type": "python",
"entity": "CUSTOM_DEVICE",
"metricGroup": "my_log",
"technologies": ["My Technology"],
"source": {
"package": "log_demo_plugin",
"className": "LogPluginRemote",
"activation": "Remote"
},
"metrics": [
{
"entity": "CUSTOM_DEVICE",
"timeseries": {
"key": "counter",
"unit": "Count",
"displayname": "Counter"
}
}
]
}

The extension creates the custom.remote.python.log_demo subfolder with the LogPluginRemote.log file where it logs the messages:

2019-09-17 11:20:11.911 UTC INFO \[Python]\[17956881948133727]\[my_endpoint]\[140679152801536]\[ThreadPoolExecutor-0\_0] - \[query] LogPluginRemote query is called
2019-09-17 11:20:19.909 UTC INFO \[Python]\[17956881948133727]\[my_endpoint]\[140679152801536]\[ThreadPoolExecutor-0\_0] - \[event_set_configuration] event_set_configuration, plugin: \<RemotePluginEngine, meta_name:custom.remote.python.log_demo id:0x7ff26b36fb38> config: {}
2019-09-17 11:20:19.910 UTC INFO \[Python]\[17956881948133727]\[my_endpoint]\[140679152801536]\[ThreadPoolExecutor-0\_0] - \[query] LogPluginRemote query is called
2019-09-17 11:21:01.950 UTC INFO \[Python]\[17956881948133727]\[my_endpoint]\[140679144408832]\[ThreadPoolExecutor-0\_1] - \[query] LogPluginRemote query is called

Create your own logs

As a last resort, you can create your own logger and log suspicious data or behavior, as shown in the examples below:

from ruxit.api.base_plugin import RemoteBasePlugin
import logging
logger = logging.getLogger(__name__)
class MyRemotePlugin(RemoteBasePlugin):
def query(self):
logger.debug("MyPluginRemote query method")
{
"name": "custom.remote.python.my_remote_plugin",
"version": "1.001",
"type": "python",
"entity": "CUSTOM_DEVICE",
"metricGroup": "remote_demo",
"processTypeNames": ["PYTHON"],
"technologies": ["example technology"],
"source": {
"package": "my_remote_plugin",
"className": "MyRemotePlugin",
"activation": "Remote"
}
}

Debugging

You can use a remote debugger for deep diagnosis of extension issues.

  1. Install Eclipse with pydev or PyCharm.

  2. Copy the debugger libraries to
    C:\Program Files\Dynatrace\remotepluginmodule\agent\plugin\engine (on Windows)
    or /opt/dynatrace/remotepluginmodule/agent/plugin/engine (on Linux).

  3. Add the following to your plugin Python code:

    import pydevd
    pydevd.settrace()
  4. Start the remote debugger from your developer environment and restart the Remote Plugin Module.