Unable to Pass Javaagent as JVM argument in Tomcat Server

I am uanbale to install java agent on my tomcat server.
how to pass the -javaagent argument to the jvm new relic

I follwed the steps mentioned in https://docs.newrelic.com/docs/agents/java-agent/installation/install-java-agent.
I have mentioned in catalina.bat file as
“set JAVA_OPTS=%JAVA_OPTS% -javaagent:C:/Program Files/Apache Software Foundation/Tomcat 9.0/opt/newrelic/newrelic.jar”
but Tomcat is not picking up my -javaagent from JVM arguements.
I am unable to see my application in new relic APM.
please help me on this asap.


Hello @rakeshcse590, thank you for reaching out. it looks like you are trying to configure the agent on windows. Did you try following the below link instead?

Also, have you verified the -javaagent flag being picked up by running the command given under step 3 from the doc here: https://docs.newrelic.com/docs/agents/java-agent/troubleshooting/no-data-appears-java

Let us know! Cheers!

@mlavania thanks for the reply. This issue is sorted out. I passed in java agent n tomcat monitoring>java>javaoptions>apply>ok.

I have another doubt that what is the ideal or apdex score to be considered for any j2ee application.

Quick help much appreciated.

Thanks ,

Hello, @rakeshcse590: There is not a single ideal Apdex threshold; it varies for each application. You may find this article helpful: https://blog.newrelic.com/product-news/how-to-choose-apdex-t/.


@rakeshcse590, bingo, I believe that did the trick. Happy to know that. You can mark that response as solved. This is for other users who might want to use this post as an example to install the agent on windows.

With regards to the other query, the link that @philweber shared is the best to follow and honestly, it depends on the application itself. I am afraid that the new relic is not in the position to recommend that. I would say run the below query to get an idea of what it can be.

select percentile(duration, 90) from Transaction where appId=NNNNN since 24 hours ago



@mlavania. Thanks for the reply.

Hi @mlavania and @philweber,

I have deployed jpetstore application in my tomcat which has dependency HSQL database, I am able to see database operation like select ,insert and update etc in newrelic but unable to see which query is taking how much time. Completed query information.

Could you please help.?

What is the difference between the tab which shown in APM->Monitoring->Databases and Plugin. Please clarify.


@rakeshcse590, thank you for following-up. Can you please share the permalink of the application in questions. Are you not able to see which query is taking more time from the transaction traces, during the execution of a transaction? Once you will share the permalink, I will be able to take a look at it better. From the screenshot, it does seem that the call is getting recorded. If you don’t want to review in traces then the database page itself will give you an idea of the time taken by the query.

With regards to plugins, the document below will help you gather more information around it. https://docs.newrelic.com/docs/plugins



Hi @mlavania,
Thanks for the reply, below is the permlink for the application.


I have another doubt that i want to monitor mysql database which installed on Amazon Linux EC2 instance.

I have gone through below link,

it says that mysql installtion should be done in Amazon ECS but i want to know can we directly integrate my ec2 instance with new relic for monitoring mysql without creating an ECS cluster in AWS.

Thanks in advance.


Hello @rakeshcse590, thank you for providing that detail. I can see the queries are very fast. These are not even taking 1 ms to complete its execution. Permalink. This could be a reason why the queries are not been captured.

Could you please try reducing the explain_threshold value and see if that helps. Currently, it is set to 0.5 in your environment. The threshold in seconds for query execution time below which the slow query and the EXPLAIN plan (if supported) will not be captured. Relevant to slow queries only when record_sql is set to raw or obfuscated.

Also, I believe, If MySQL is not running on Kubernetes or Amazon ECS, you must have the Infrastructure agent installed on a Linux OS host that’s running MySQL. Later, you can start following the steps from this doc: https://docs.newrelic.com/docs/integrations/host-integrations/host-integrations-list/mysql-monitoring-integration#linux-install

Let me know if that helps.

@mlavania I understand about the on host installation but what i want is can we integrate the mysql which is running on Amazon linux ec2 instance witout creating ECS.


@rakeshcse590, I can get in touch with the infrastructure folks to confirm this. Thanks