{"id":14235,"date":"2020-06-03T23:09:48","date_gmt":"2020-06-03T23:09:48","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=14235"},"modified":"2021-11-05T10:58:37","modified_gmt":"2021-11-05T10:58:37","slug":"how-to-disable-newrelic-agent-completly-or-disable-for-specific-app-in-java","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/how-to-disable-newrelic-agent-completly-or-disable-for-specific-app-in-java\/","title":{"rendered":"How to disable newrelic agent completly or disable for specific app in JAVA?"},"content":{"rendered":"\n<p>There are three main ways to disable the Java agent:<\/p>\n\n\n\n<p><strong>Method 1 &#8211; Set agent_enabled to false in newrelic.yml(linux), then restart the JVM.<\/strong><\/p>\n\n\n\n<p><strong>Method 2 &#8211; Use the JVM command line flag:<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>-Dnewrelic.config.agent_enabled=false<\/p><\/blockquote>\n\n\n\n<p>Then restart the JVM.<\/p>\n\n\n\n<p><strong>Method 3 &#8211; Remove the newrelic.jar or newrelic.yml file from specified location, then restart the JVM.<\/strong><\/p>\n\n\n\n<p>Note &#8211; After you disable the agent, it may take several minutes for data to stop showing up.<\/p>\n\n\n\n<p><strong>Method 4 &#8211; To permanently disable APM, uninstall the agent.<\/strong><\/p>\n\n\n\n<p>To remove the Java agent: Delete the newrelic folder from your app server&#8217;s root directory. Remove the JVM argument you used to include the agent in your startup script. After you complete these steps, restart your app.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"897\" height=\"623\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/disable-newrelic-agent-JAVA1.jpg\" alt=\"\" class=\"wp-image-14236\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/disable-newrelic-agent-JAVA1.jpg 897w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/disable-newrelic-agent-JAVA1-300x208.jpg 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/disable-newrelic-agent-JAVA1-768x533.jpg 768w\" sizes=\"auto, (max-width: 897px) 100vw, 897px\" \/><\/figure>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_60374\"><iframe loading=\"lazy\"  id=\"_ytid_93058\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_60374\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>There are three main ways to disable the Java agent: Method 1 &#8211; Set agent_enabled to false in newrelic.yml(linux), then restart the JVM. Method 2 &#8211; Use the JVM command&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[1],"tags":[],"class_list":["post-14235","post","type-post","status-publish","format-standard","hentry","category-sql"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/14235","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=14235"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/14235\/revisions"}],"predecessor-version":[{"id":24804,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/14235\/revisions\/24804"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=14235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=14235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=14235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}