cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

OneAgent Plugin: Oracle Process Group Instance Names

STiAT
Advisor

Hi there,


I've been trying to implement a custom plugin for Oracle, since Insights does not fully fit our needs. The issue I seem to have is plugin activation respectively actually finding the process group instances.


If I see that correctly in dynatrace, the process group name should be "Oralce Database", the technology "ORACLE_DB".

from the plugin.json

"entity": "PROCESS_GROUP_INSTANCE",
    "technologies": [
      "ORACLE_DB"
    ],


In the simulator I've used the following

        {
            "group_name": "Oracle Database",
            "group_instance_id":2,
            "processes":[
                {
                    "process_name":"Oracle Database (gccon)"
                }
            ],
            "properties": {"Technologies": "ORACLE_DB"}
        },


After the simulator is triggered, I read the process_name:

p_list = self.find_all_processes(lambda entry: entry.process_name.startswith("Oracle Database"))
            active_dbs = {}
            for process in p_list:
                m = re.search("^.*?\((.*)?\)$", process[1].process_name)
                if(m):
                    active_dbs[m.group(1)] = process[0].group_instance_id


The issue is, that this does not trigger the plugin on the actual server, at least it does not seem as if I do get any "active_dbs". Looking at the support archives, it seems that "Oracle Database (gccon)" is actually not the process name but the "inherited name", and my guess is entry.process_name.startswith("Oracle Database") does not find it since process_name seems not to be what it displays in Dynatrace.

What's the proper way to get the process group instances for the oracle database in this case? The inherited name is a nice thing, since I can identify the actual database instance to connect to.


Best regards,

Georg

6 REPLIES 6

Mike_L
Dynatrace Guru
Dynatrace Guru

Hi, if you're sure that the query method is executing (just do a logger as the first line) then what I would do if I were you is to change the extension to run once per Oracle process by setting this in the plugin.json:

"activation": "SnapshotEntry"

Once the extension is initiated once per process you can log the full snapshot of the entity that each extension thread connects to, by doing this:

logger.info(kwargs["associated_entity"])

From there on you can change your code to get any property that Dynatrace has seen.

Out of curiosity, what are you missing in the Oracle DB Insights?

Mike

Mike

Hi there, thanks for the answer.

I've done that, but the "entity" seems to name it only "Oracle Database", there seems to be no hint which instance it is:

  1. { key=entityid=ce4f7357c3bf4ed5 ; name="Oracle Database" ; type="Oracle" }

Is there a way to get "more" information to that entity? The name is the Process Groups one, not the instance name itself as it seems.



Mike_L
Dynatrace Guru
Dynatrace Guru

If the above command (when executed as part of a deployed OneAgent Extension, not through the simulator) doesn’t have the information then you are out of luck and might have to get it from somewhere else than the snapshot.

If you do get something else back when it is deployed then you can take that output and drop it into your process snapshot.

Mike

Mike

Mike_L
Dynatrace Guru
Dynatrace Guru

Unless the ORACLE_DB technology type doesn't bring back the correct entity. But my post in the other question regarding the process snapshot location would help you with that.

Mike

What would probably be interesting in this case is to get a full process snapshot of the host to test with in a json as expected by the simulator_snapshot.json... that would make testing a lot easier. Is there a way to do that?

Mike_L
Dynatrace Guru
Dynatrace Guru

Not simply. The process snapshot (but in a bit different format) can be found in the logs of the plugin agent once a custom extension has been deployed. It is usually easier to use the method I wrote about in the other reply.

Mike

Featured Posts