Hello
I'm trying to create an OneAgent plugin which will monitor used system descriptors by Java app (executed by Tomcat).
Here is plugin.json for it:
{
"name": "custom.python.descriptors_counter_plugin",
"version": "0.01",
"type": "python",
"entity": "PROCESS_GROUP_INSTANCE",
"metricGroup": "descriptors_counter_metrics",
"processTypeNames": [
"JAVA"
],
"source": {
"package": "descriptors_counter_plugin",
"className": "DescriptorsPlugin",
"activation": "Singleton"
},
"metrics": [
{
"timeseries": {
"key": "used_descriptors",
"unit": "Count",
"displayname": "Used descriptors count"
}
}
],
"configUI": {
"displayName": "OneAgent Used Descriptors Plugin"
}
}
And how it gets Process Group:
pgi = self.find_single_process_group(pgi_name('tomcat'))
On the server exists several tomcat groups.
I build it and uploaded it to Dynatrace but didn't find any changes for the tomcat section in UI.
Therefore several questions:
1. How to make sure that my plugin actually reached the hosts? I grep'ed through /opt/dynatrace/oneagent/log name of the plugin on one of them didn't find any mentions about my plugin;
2. What processTypeNames should I use in plugin.json JAVA or TOMCAT?
Thanks in advance.
Solved! Go to Solution.
Not sure what you mean by "system descriptors" but you can get FileDescriptor counts very easily via JMX and the java.lang.OperatingSystem MBean.
Attached is a custom JMX plugin that determines OpenFileDescriptorCount and MaxFileDescriptorCount for any Java process:
Dear Andrii,
please replace the processTypeNames property by the technologies property in the form:
"technologies": [ "TOMCAT" ]
The value of the technologies can be taken from the UI - on the process level you can find 'Main technology' property for the process, see the attached snapshot:
You can also find this info in Activation tips of Plugin life cycle in the most recent documentation available in our SDK.
Best regards,
Peter