20 Sep 2017 01:46 AM - last edited on 08 Dec 2021 04:47 AM by MaciejNeumann
we are making a trial with Dynatrace OneAgent and we don't really know how does Dynatrace inject byte code for Java Applications without updating its start script. We know how it is done by AppMon not by Dynatrace and in the documentation we don't figure out how is it made.
Thanks in advance.
Solved! Go to Solution.
It's being automatically injected, there is no requirement to modify configuration files or startup scripts for applications. Dynatrace oneagent uses a custom library that is pre-loaded with every new process.This library together with agent code does the injection for known technologies. That's why root/administrator access is needed to install Oneagent.
OK, I understand that it maked its magic inside for inyecting bytecode but if I run a ps to the Java process y don't see any reference to oneagent in the process itself. How can I check using OS commads that a process is beeing instrumented? On the other hand, can I specify a Java process of the machine to be instrumented and not the rest of ones?
No you won't see anything in the ps output, but you can see oneagent libraries opened by the process using lsof if process is monitored. Also you can see it in the oneagent log files that proces is being monitored. If you need to see more details, for Java the log files are in /opt/dynatrace/oneagent/log/java . There are two log files for each java process (bootstrap and the log itself). If there are any issues such as unsupported JVM version, you can find it here.
By default all processes are monitored, but you can disable monitoring for each process in the GUI.
Curiously, what would happen to the ps output if the process was manually configured to use a native agent like a "classic" AppMon agent (configured with JVM option "agentpath")? Will the command line change after the process is restarted and monitored using automatic OneAgent injection?
No, it won't be changed. AFAIK it's done by linking a library to every process and for JVM it uses different approach (not java agent).
We are seeing a strange issue after installing one agent on Ibm websphere application server . Not sure it is one agent related , but as per this Ibm doc it looks like possible with java byte code injection
We are getting exact same error as mentioned in doc.any comment or feedback is appreciated
Please post your question to a new thread. This thread is already answered and quite old. You're also posting a question about Dynatrace on the AppMon forum. Please be sure to use the correct forum based on which product you are using.