Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add max_stack_trace_lines for Java Agent config #261

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions .idea/newrelic.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 0 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,57 +392,6 @@ The `newrelic_agent_java` resource will handle the requirements to install java

#### Attribute parameters

* `'license'` - New Relic license key
* `'version'` - New Relic Java Agent version to use. To find the current version, check New Relic repo
* `'https_download'` - The url to download the jar for the New Relic Java agent. If you override version parameter, you must also update this.
* `'jar_file'` - The name of the newrelic jar file that will be used locally, defaults to `newrelic-agent-version.jar`
* `'install_dir'` - The directory to install the newrelic jar and config file
* `'app_user'` - The user that runs the Java application that will use the New Relic Java agent
* `'app_group'` - The group for the app_user
* `'audit_mode'` - Boolean, log all data to and from New Relic in plain text
* `'log_file_count'` - The number of log files to use
* `'log_limit_in_kbytes'` - The maximum number of bytes to write to any one log file
* `'log_daily'` - Override other log rolling configuration and roll the logs daily
* `'agent_action'` - Agent action, defaults to `:install`
* `'execute_agent_action'` - Execute the agent action or not, defaults to true
* `'app_location'` - Application's location, defaults to `install_dir`
* `'template_cookbook'` - Sets cookbook for template, defaults to 'newrelic'
* `'template_source'` - Sets source for template, defaults to `agent/newrelic.yml.erb`

#### Advanced parameters

* `'enabled'` - Defaults to true
* `'high_security'` - Defaults to false
* `'owner'` - Defaults to 'newrelic'
* `'group'` - Defaults to 'newrelic'
* `'logfile'` - Defaults to nil
* `'logfile_path'` - Defaults to nil
* `'loglevel'` - Defaults to nil
* `'audit_mode'` - Defaults to false
* `'log_file_count'` - Defaults to nil
* `'log_limit_in_kbytes'` - Defaults to nil
* `'log_daily'` - Defaults to false
* `'daemon_ssl'` - Defaults to true
* `'daemon_proxy'` - Defaults to nil
* `'daemon_proxy_host'` - Defaults to nil
* `'daemon_proxy_port'` - Defaults to nil
* `'daemon_proxy_user'` - Defaults to nil
* `'daemon_proxy_password'` - Defaults to nil
* `'capture_params'` - Defaults to nil
* `'ignored_params'` - Defaults to nil
* `'transaction_tracer_enable'` - Defaults to true
* `'transaction_tracer_threshold'` - Defaults to nil
* `'transaction_tracer_record_sql'` - Defaults to nil
* `'transaction_tracer_stack_trace_threshold'` - Defaults to nil
* `'transaction_tracer_slow_sql'` - Defaults to nil
* `'transaction_tracer_explain_threshold'` - Defaults to nil
* `'error_collector_enable'` - Defaults to true
* `'error_collector_ignore_errors'` - Defaults to nil
* `'error_collector_ignore_status_codes'` - Defaults to nil
* `'browser_monitoring_auto_instrument'` - Defaults to nil
* `'cross_application_tracer_enable'` - Defaults to true
* `'thread_profiler_enable'` - Defaults to true

#### Example
```ruby
newrelic_agent_java 'Install' do
Expand Down
1 change: 1 addition & 0 deletions recipes/java_agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
enabled node['newrelic']['application_monitoring']['enabled'] unless node['newrelic']['application_monitoring']['enabled'].nil?
app_name node['newrelic']['application_monitoring']['app_name'] unless node['newrelic']['application_monitoring']['app_name'].nil?
high_security NewRelic.to_boolean(node['newrelic']['application_monitoring']['high_security']) unless node['newrelic']['application_monitoring']['high_security'].nil?
max_stack_trace_lines node['newrelic']['java_agent']['max_stack_trace_lines'] unless node['newrelic']['java_agent']['max_stack_trace_lines'].nil?
app_user node['newrelic']['java_agent']['app_user'] unless node['newrelic']['java_agent']['app_user'].nil?
app_group node['newrelic']['java_agent']['app_group'] unless node['newrelic']['java_agent']['app_group'].nil?
logfile node['newrelic']['application_monitoring']['logfile'] unless node['newrelic']['application_monitoring']['logfile'].nil?
Expand Down
1 change: 1 addition & 0 deletions resources/agent_java.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
attribute :enabled, :kind_of => [TrueClass, FalseClass], :default => true
attribute :app_name, :kind_of => String, :default => nil
attribute :high_security, :kind_of => [TrueClass, FalseClass], :default => false
attribute :max_stack_trace_lines, :kind_of => String, :default => nil
attribute :logfile, :kind_of => String, :default => nil
attribute :logfile_path, :kind_of => String, :default => nil
attribute :loglevel, :kind_of => String, :default => nil
Expand Down
1 change: 1 addition & 0 deletions resources/agent_ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
attribute :enabled, :kind_of => [TrueClass, FalseClass], :default => true
attribute :app_name, :kind_of => String, :default => nil
attribute :high_security, :kind_of => [TrueClass, FalseClass], :default => false
attribute :max_stack_trace_lines, :kind_of => String, :default => nil
attribute :owner, :kind_of => String, :default => 'newrelic'
attribute :group, :kind_of => String, :default => 'newrelic'
attribute :logfile, :kind_of => String, :default => 'newrelic-daemon.log'
Expand Down
79 changes: 58 additions & 21 deletions templates/default/agent/newrelic.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -162,28 +162,34 @@ common: &default_settings
proxy_password: <%= @resource.daemon_proxy_password %>
<% end %>

# Tells transaction tracer and error collector (when enabled)
# whether or not to capture HTTP params. When true, frameworks can
# exclude HTTP parameters from being captured.
# Default is false.
<% if @resource.capture_params.nil? %>
capture_params: false
<% else %>
capture_params: <%= @resource.capture_params %>
<% end %>

# Tells transaction tracer and error collector to not to collect
# specific http request parameters.
<% if @resource.ignored_params.nil? %>
# ignored_params: credit_card, ssn, password
<% else %>
ignored_params: <%= @resource.ignored_params %>
<% end %>

# Configure New Relic to detect custom traces
# https://docs.newrelic.com/docs/agents/java-agent/custom-instrumentation/java-instrumentation-annotation
enable_custom_tracing: <%= @resource.enable_custom_tracing %>

# Limits the number of lines the agent collects from each stack trace.
# Increasing this value may impact performance, because it increases the amount of memory the agent uses and
# the amount of data sent to New Relic.
# Default is 30.
<% unless @resource.max_stack_trace_lines.nil? %>
max_stack_trace_lines: <%= @resource.max_stack_trace_lines %>
<% end %>

# Provides the ability to configure the attributes sent to New Relic. These
# attributes can be found in transaction traces, traced errors, Insight's
# transaction events, and Insight's page views.
attributes:

# When true, attributes will be sent to New Relic. The default is true.
enabled: true

#A comma separated list of attribute keys whose values should
# be sent to New Relic.
#include:

# A comma separated list of attribute keys whose values should
# not be sent to New Relic.
#exclude:

# Transaction tracer captures deep information about slow
# transactions and sends this to the New Relic service once a
# minute. Included in the transaction is the exact call sequence of
Expand Down Expand Up @@ -267,7 +273,6 @@ common: &default_settings
# Default is 20.
top_n: 20


# Error collector captures information about uncaught exceptions and
# sends them to New Relic for viewing
error_collector:
Expand Down Expand Up @@ -298,10 +303,22 @@ common: &default_settings
ignore_status_codes: <%= @resource.error_collector_ignore_status_codes %>
<% end %>

# Transaction Events are used for Histograms and Percentiles. Unaggregated data is collected
# for each web transaction and sent to the server on harvest.
transaction_events:

# Set to false to disable transaction events.
# Default is true.
enabled: true

# Events are collected up to the configured amount. Afterwards, events are sampled to
# maintain an even distribution across the harvest cycle.
# Default is 2000. Setting to 0 will disable.
max_samples_stored: 2000

# Cross Application Tracing adds request and response headers to
# external calls using the Apache HttpClient libraries to provided better
# external calls using supported HTTP libraries to provide better
# performance data when calling applications monitored by other New Relic Agents.
#
cross_application_tracer:
# Set to true to enable cross application tracing.
# Default is true.
Expand Down Expand Up @@ -350,6 +367,26 @@ common: &default_settings
# Default is true.
enabled: true

class_transformer:
# This instrumentation reports the name of the user principal returned from
# HttpServletRequest.getUserPrincipal() when servlets and filters are invoked.
com.newrelic.instrumentation.servlet-user:
enabled: false

com.newrelic.instrumentation.spring-aop-2:
enabled: false

# Classes loaded by classloaders in this list will not be instrumented.
# This is a useful optimization for runtimes which use classloaders to
# load dynamic classes which the agent would not instrument.
classloader_excludes:
groovy.lang.GroovyClassLoader$InnerLoader,
org.codehaus.groovy.runtime.callsite.CallSiteClassLoader,
com.collaxa.cube.engine.deployment.BPELClassLoader,
org.springframework.data.convert.ClassGeneratingEntityInstantiator$ObjectInstantiatorClassGenerator,
org.mvel2.optimizers.impl.asm.ASMAccessorOptimizer$ContextClassLoader,
gw.internal.gosu.compiler.SingleServingGosuClassLoader,

# Application Environments
# ------------------------------------------
# Environment specific settings are in this section.
Expand Down