Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Unable to Pass Javaagent as JVM argument in Tomcat Server

jvm
tomcat-server

#1

Hi,
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.

Thanks,
Rakesh


#2

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!


#3

@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 ,
Rakesh


#4

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


#5

@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

Cheers.


#6

@mlavania. Thanks for the reply.


#7

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.

Thanks,
Rakesh


#8

@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

Thanks


#9

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

https://rpm.newrelic.com/accounts/2107777/applications/540603347?tw[end]=1590256380&tw[start]=1590252672

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

I have gone through below link,
https://docs.newrelic.com/docs/integrations/host-integrations/host-integrations-list/mysql-monitoring-integration

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.

Regards,
Rakesh


#10

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.


#11

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

Thanks,
Rakesh


#12

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