1

It is a black magic for attaching the javaagent to java process in dynatrace in the agent.

I did not found the env JAVA_TOOL_OPTIONS or JAVA_OPTS in the nodes.

But I found that some agent jars is added into the boot path(sun.boot.class.path).

I want to know more about the java black magic. anyone can explain that?

Angle Tom
  • 1,060
  • 1
  • 11
  • 29

1 Answers1

0

It probably uses a JVM API called JVMTI, see https://en.wikipedia.org/wiki/Java_Virtual_Machine_Tools_Interface, this allows to inject agent-code into a started Java application which inspects the byte code and can also modify byte code for doing it's work.

This requires native code as the interface is below the actual execution of the Java class.

There is also a java agent, see here and here for some description. This is used by other monitoring tools, but using a native agent allows to read and control more aspects of the application in respect to reading monitoring and performance information, which explains some of the more powerful things that Dynatrace can do.

centic
  • 15,565
  • 9
  • 68
  • 125
  • I know JVMTI. We have to add agentlib or set the env variable `JAVA_TOOL_OPTIONS ` before the java process startup if we want it works. – Angle Tom Jul 22 '18 at 03:01
  • Dynatrace somehow automatically sets these options during process start without the user needing to do that manually. Details are likely part of the IP and thus not described in details publicly. – centic Jul 22 '18 at 09:24
  • You mean that startup a daemon process to do that? – Angle Tom Jul 23 '18 at 12:11