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

Java byte code injection

ajdimanuel
Inactive

Hi,

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.

 

8 REPLIES 8

Julius_Loman
DynaMight Legend
DynaMight Legend

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.

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

ajdimanuel
Inactive

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?

Thanks.

A.

Julius_Loman
DynaMight Legend
DynaMight Legend

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.

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

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).

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

rputhen
Guide

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

https://www.ibm.com/developerworks/community/forums/html/topic?id=903ed96d-1e0c-431d-8210-2de1739fd0...

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.


rputhen
Guide

thanks @Joseph M. H. sure will create a new thread.


Featured Posts