Fork me on GitHub
#datomic
<
2021-10-31
>
Yi01:10:43

Hi, everyone! I am trying to add datadog JVM agent to Datomic transactor (on prem) java process but it doesn't seem the -javaagent JVM setting is being picked up. I noticed this https://ask.datomic.com/index.php/458/can-you-start-the-datomic-jvm-with-a-custom-jvm-agent while investigating. Is adding a JVM agent doable with Datomic on prem? We are at 0.9.6045.

favila04:10:07

Take a look at the startup script at bin/transactor. Either you can find an env var it reads and use it to set Java opts, or you can replicate what it does yourself and add more args (it’s not very complex).

Yi04:10:05

Thanks @U09R86PA4, yes, I added a javaagent . Here is the process

00:02:33 java -server -cp resources:datomic-transactor-pro-0.9.6045.jar:lib/*:samples/clj:bin: -Xmx4g -Xms4g -XX:+UseG1G
C -XX:MaxGCPauseMillis=50 -XX:+ExitOnOutOfMemoryError -XX:HeapDumpPath=/opt/datomic-pro-0.9.6045 -Ddatomic.peerConnectionTTLMsec=60000 -javaagent:./dd-java-age
nt.jar clojure.main --main datomic.launcher /opt/datomic-pro-0.9.6045/config/transactor.properties
But I don't see any startup log which should appear if it is working fine https://docs.datadoghq.com/tracing/troubleshooting/tracer_startup_logs I have ruled out a few possibilities • the log is muted • the dd-java-agent.jar is corrupted • datadog-agent APM agent is not running fine After seeing the mentioned post, I am wondering if it is just custom JVM agent is disabled for transactor (on prem or cloud)

favila04:10:45

I believe a javaagent param may need to go before jar or cp params to work? I notice dd also has some other configuration you can add to make it noisier to make sure it’s loading and working https://docs.datadoghq.com/tracing/setup_overview/setup/java/?tab=containers

favila04:10:37

I’m not aware of any way a Java program can disable or circumvent a static agent. I’m not sure how that link gave you that impression

Yi05:10:27

you are absolutely correct that javaagent param needs to go before jar or cp params. @U09R86PA4! Thanks a lot~