djoos-cookbooks / newrelic

Development repository for the newrelic cookbook
https://supermarket.chef.io/cookbooks/newrelic
MIT License
143 stars 245 forks source link

Trim_stats config item for Java/ruby agent #378

Closed maxwell-gregory closed 5 years ago

maxwell-gregory commented 5 years ago

There is an issue with FedCI not auto accepting the licenses.

There are also unrelated issues with test-kitchen on this cookbook with how java is run:

      * newrelic_agent_java[Install] action install
           * directory[/opt/tomcat_java_test_app] action create
             - change mode from '0750' to '0775'
             - change owner from 'tomcat_user' to 'root'
             - change group from 'tomcat_group' to 'root'
             - restore selinux security context
           * yum_package[unzip] action install (up to date)
           * remote_file[/opt/tomcat_java_test_app/newrelic.zip] action create (up to date)
           * execute[newrelic-extract-jar] action nothing (skipped due to action :nothing)
           * template[/opt/tomcat_java_test_app/newrelic.yml] action create (up to date)
           * execute[newrelic_install_newrelic.jar] action run

             ================================================================================
             Error executing action `run` on resource 'execute[newrelic_install_newrelic.jar]'
             ================================================================================

             Mixlib::ShellOut::ShellCommandFailed
             ------------------------------------
             Expected process to exit with [0], but received '1'
             ---- Begin output of sudo java -jar newrelic.jar -s /opt/tomcat_java_test_app install ----
             STDOUT: New Relic Agent Version 5.1.1
             usage: java -jar newrelic.jar
       -h         Prints help
       -v         Prints the agent version
       -version   Prints the agent version

             Commands:
             instrument    [OPTIONS]                Validates a custom instrumentation
             xml configuration file.
             deployment    [OPTIONS] [description]  Records a deployment
             STDERR: Error parsing arguments
             ---- End output of sudo java -jar newrelic.jar -s /opt/tomcat_java_test_app install ----
             Ran sudo java -jar newrelic.jar -s /opt/tomcat_java_test_app install returned 1

Rspec passes all tests regarding java/ruby agent using the newrelic lwrp unit test. I had some issues regarding apache cookbook not being properly referenced that I had trouble resolving but this fails only php_agent and this PR performs no changes to php_agent

maxwell-gregory commented 5 years ago

@djoos Can I get an update on merging this PR? This is a valid config item

djoos commented 5 years ago

Thanks for the contribution @NoMotion!

netzere commented 5 years ago

@djoos @NoMotion Hey guys, my installation fails since this release.

undefined method trim_stats for Custom resource newrelic_yml from cookbook newrelic

on line #187
185:   enable_custom_tracing: <%= @resource.enable_custom_tracing %>
186:
187:   trim_stats: <%= @resource.trim_stats %>
188:
189:   # Transaction tracer captures deep information about slow
djoos commented 5 years ago

@EranNetzerel - could you retry with 2.40.2? (just shipped) Thanks in advance for your feedback!

netzere commented 5 years ago

@djoos Thanks for the fast response! but now i get this error:

Error executing action generate on resource 'newrelic_yml

on line 319
317:   # Garbage collection CPU threshold: 10%
318:   circuitbreaker:
319:   <% if @resource.circuitbreaker_enabled.nil? -%>
320:     enabled: false
321:   <% else -%>
djoos commented 5 years ago

@EranNetzerel - sorry, the testing on the YML LWRP is really poor. I've added in the circuitbreaker attributes now (v2.40.3) and will try making time to add in tests so we can catch these issues sooner going forward...

netzere commented 5 years ago

@djoos Works now, thanks :)