{"id":14247,"date":"2020-06-04T01:28:24","date_gmt":"2020-06-04T01:28:24","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=14247"},"modified":"2021-11-05T10:53:51","modified_gmt":"2021-11-05T10:53:51","slug":"understanding-of-newrelic-agent-configuration-file-newrelic-yml-vs-newrelic-config","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/understanding-of-newrelic-agent-configuration-file-newrelic-yml-vs-newrelic-config\/","title":{"rendered":"Understanding of Newrelic agent configuration file newrelic.yml vs newrelic.config"},"content":{"rendered":"\n<p>The New Relic agent reads its configuration from the newrelic.yml or newrelic.config. New Relic APM agent configuration options allow you to control some aspects of how the agent behaves. Some of these config options are part of the basic install process.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td>Go agent<\/td><td>newrelic.Config<\/td><\/tr><tr><td>Java agent<\/td><td>newrelic.Config<\/td><\/tr><tr><td>DOT NET agent<\/td><td>newrelic.config<\/td><\/tr><tr><td>Node.js agent<\/td><td>newrelic.js<\/td><\/tr><tr><td>Node.js agent<\/td><td>newrelic.js<\/td><\/tr><tr><td>Python agent<\/td><td>newrelic.ini<\/td><\/tr><tr><td>Ruby agent<\/td><td>newrelic.yml<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Newrelic Java Agent<\/strong><\/p>\n\n\n\n<p>The Java agent requires the license_key and app_name settings at startup. All the other settings are optional. The New Relic Java agent reads its configuration from the newrelic.yml file. By default the agent looks for this file in the directory that contains newrelic.jar.<\/p>\n\n\n\n<p>You can override the config file&#8217;s location by setting the newrelic.config.file system property to a fully qualified file name.<\/p>\n\n\n\n<p><strong>System property<\/strong><\/p>\n\n\n\n<p>system property means, these property you can set in app runtime environment such jvm or dotnet.<\/p>\n\n\n\n<p>Such as in tomcat catlina.bat<br>export JAVA_OPTS=&#8221;$JAVA_OPTS -javaagent:\/var\/lib\/tomcat8\/webapps\/newrelic\/newrelic.jar&#8221;<br>or catlina.sh<br>SET JAVA_OPTS=%JAVA_OPTS% -javaagent:\/full\/path\/to\/newrelic.jar<br>Where as -javaagent is system property. You can override the config file&#8217;s location by setting the newrelic.config.file system property to a fully qualified file name.<br>i.e java -Dnewrelic.config.file=\/opt\/tomcat\/newrelic\/newrelic.yml<\/p>\n\n\n\n<p><strong>The Newrelic configuration file such newrelic.yml file is split into stanzas corresponding to different environments:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Test<\/li><li>Development<\/li><li>Staging<\/li><li>Production (default)<\/li><\/ul>\n\n\n\n<p>New Relic applies settings in the common stanza to each of these environments. You can select other environments as the default by setting the newrelic.environment system property to the environment name.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"554\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-config-file-stanzas-environments1-1024x554.jpg\" alt=\"\" class=\"wp-image-14248\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-config-file-stanzas-environments1-1024x554.jpg 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-config-file-stanzas-environments1-300x162.jpg 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-config-file-stanzas-environments1-768x416.jpg 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-config-file-stanzas-environments1-1536x831.jpg 1536w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-config-file-stanzas-environments1.jpg 1656w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>General configuration settings in Java agent newrelic.yml Specification<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">license_key (REQUIRED)\napp_name (REQUIRED)\nagent_enabled\napdex_t (DEPRECATED)\nappserver_port\naudit_mode\nca_bundle_path\nenable_auto_app_naming\nenable_auto_transaction_naming\nenable_custom_tracing\nextensions.dir\nhigh_security\ninsert_api_key\nlabels\nmax_stack_trace_lines\nproxy_host\nproxy_password\nproxy_port\nproxy_user\nproxy_scheme\nsend_data_on_exit\nsend_data_on_exit_threshold\nsend_environment_info\nsend_jvm_props\nssl (DEPRECATED)\nsync_startup\nscala_futures_as_segments<\/pre>\n\n\n\n<p><strong>Configuration settings precedence<\/strong><\/p>\n\n\n\n<p>Configuration settings precedence<\/p>\n\n\n\n<p>To override any setting in the config file, use a system property override. In certain environments, environment variables can also be used to override both the config file and the system properties. The environment variables primarily exist to support Heroku.<\/p>\n\n\n\n<p><strong>With the Java agent,<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>server-side configuration overrides all other settings.<\/li><li>Environment variables override Java system properties.<\/li><li>Java properties override user configuration settings in your newrelic.yml file.<\/li><li>User settings in App custome override the newrelic.yml default settings.<\/li><\/ul>\n\n\n\n<p><strong>Newrelic Configuration settings precedence Java Agent<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"395\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-Java-Agent.png\" alt=\"\" class=\"wp-image-14249\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-Java-Agent.png 700w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-Java-Agent-300x169.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-Java-Agent-355x199.png 355w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/figure>\n\n\n\n<p><strong>Newrelic Configuration settings precedence Go agent<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"583\" height=\"285\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-Go-agent.png\" alt=\"\" class=\"wp-image-14250\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-Go-agent.png 583w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-Go-agent-300x147.png 300w\" sizes=\"auto, (max-width: 583px) 100vw, 583px\" \/><\/figure>\n\n\n\n<p><strong>Newrelic Configuration settings precedence DOT NET Agent<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"510\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-DOT-NET-Agent-1024x510.png\" alt=\"\" class=\"wp-image-14251\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-DOT-NET-Agent-1024x510.png 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-DOT-NET-Agent-300x149.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-DOT-NET-Agent-768x383.png 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-DOT-NET-Agent-1536x765.png 1536w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-DOT-NET-Agent-2048x1020.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Newrelic Configuration settings precedence Node.js agent<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"583\" height=\"358\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-Node-js-agent.png\" alt=\"\" class=\"wp-image-14252\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-Node-js-agent.png 583w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-Node-js-agent-300x184.png 300w\" sizes=\"auto, (max-width: 583px) 100vw, 583px\" \/><\/figure>\n\n\n\n<p><strong>Newrelic Configuration settings precedence PHP agent<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"324\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-PHP-agent.png\" alt=\"\" class=\"wp-image-14253\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-PHP-agent.png 700w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-PHP-agent-300x139.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/figure>\n\n\n\n<p><strong>Newrelic Configuration settings precedence Python agent<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"378\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-Python-agent.png\" alt=\"\" class=\"wp-image-14254\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-Python-agent.png 700w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-Python-agent-300x162.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/figure>\n\n\n\n<p><strong>Newrelic Configuration settings precedence Ruby agent<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"378\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-Ruby-agent.png\" alt=\"\" class=\"wp-image-14255\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-Ruby-agent.png 700w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/Newrelic-Configuration-settings-precedence-Ruby-agent-300x162.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/figure>\n\n\n\n<p><strong>Reference<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/docs.newrelic.com\/docs\/agents\/go-agent\/configuration\/go-agent-configuration\" target=\"_blank\" rel=\"noopener\">Go agent<\/a><\/li><li><a href=\"https:\/\/docs.newrelic.com\/docs\/agents\/java-agent\/configuration\/java-agent-configuration-config-file\" target=\"_blank\" rel=\"noopener\">Java Agent<\/a><\/li><li><a href=\"https:\/\/docs.newrelic.com\/docs\/agents\/net-agent\/configuration\/net-agent-configuration\" target=\"_blank\" rel=\"noopener\">DOT NET Agent<\/a><\/li><li><a href=\"https:\/\/docs.newrelic.com\/docs\/agents\/nodejs-agent\/installation-configuration\/nodejs-agent-configuration\" target=\"_blank\" rel=\"noopener\">Node.js agent<\/a><\/li><li><a href=\"https:\/\/docs.newrelic.com\/docs\/agents\/php-agent\/configuration\/php-agent-configuration\" target=\"_blank\" rel=\"noopener\">PHP agent<\/a><\/li><li><a href=\"https:\/\/docs.newrelic.com\/docs\/agents\/python-agent\/configuration\/python-agent-configuration\" target=\"_blank\" rel=\"noopener\">Python agent<\/a><\/li><li><a href=\"https:\/\/docs.newrelic.com\/docs\/agents\/ruby-agent\/configuration\/ruby-agent-configuration\" target=\"_blank\" rel=\"noopener\">Ruby agent<\/a><\/li><\/ul>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_49935\"><figure class=\"wp-block-embed wp-block-embed-youtube is-type-video is-provider-youtube epyt-figure\"><div class=\"wp-block-embed__wrapper\"><iframe loading=\"lazy\"  id=\"_ytid_85799\"  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_49935\"  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><\/figure><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>The New Relic agent reads its configuration from the newrelic.yml or newrelic.config. New Relic APM agent configuration options allow you to control some aspects of how the agent behaves. Some of these config options are part of the basic install process. Go agent newrelic.Config Java agent newrelic.Config DOT NET agent newrelic.config Node.js agent newrelic.js Node.js&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[1],"tags":[],"class_list":["post-14247","post","type-post","status-publish","format-standard","hentry","category-sql"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/14247","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=14247"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/14247\/revisions"}],"predecessor-version":[{"id":24800,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/14247\/revisions\/24800"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=14247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=14247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=14247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}