newrelic_rpm 9.14.0 → 9.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.build_ignore +1 -0
- data/CHANGELOG.md +139 -5
- data/CONTRIBUTING.md +2 -2
- data/lib/boot/strap.rb +4 -3
- data/lib/new_relic/agent/agent.rb +4 -0
- data/lib/new_relic/agent/agent_helpers/connect.rb +3 -0
- data/lib/new_relic/agent/agent_helpers/harvest.rb +3 -0
- data/lib/new_relic/agent/agent_helpers/shutdown.rb +3 -0
- data/lib/new_relic/agent/agent_helpers/start_worker_thread.rb +1 -0
- data/lib/new_relic/agent/agent_helpers/startup.rb +7 -0
- data/lib/new_relic/agent/aws.rb +6 -0
- data/lib/new_relic/agent/configuration/default_source.rb +336 -115
- data/lib/new_relic/agent/configuration/manager.rb +1 -1
- data/lib/new_relic/agent/configuration/yaml_source.rb +6 -1
- data/lib/new_relic/agent/database.rb +41 -1
- data/lib/new_relic/agent/distributed_tracing.rb +2 -2
- data/lib/new_relic/agent/health_check.rb +136 -0
- data/lib/new_relic/agent/http_clients/uri_util.rb +1 -1
- data/lib/new_relic/agent/instrumentation/active_record.rb +1 -8
- data/lib/new_relic/agent/instrumentation/active_record_helper.rb +5 -1
- data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +9 -16
- data/lib/new_relic/agent/instrumentation/active_support_broadcast_logger.rb +0 -2
- data/lib/new_relic/agent/instrumentation/active_support_logger.rb +0 -2
- data/lib/new_relic/agent/instrumentation/async_http.rb +1 -2
- data/lib/new_relic/agent/instrumentation/aws_sdk_firehose/chain.rb +21 -0
- data/lib/new_relic/agent/instrumentation/aws_sdk_firehose/instrumentation.rb +66 -0
- data/lib/new_relic/agent/instrumentation/aws_sdk_firehose/prepend.rb +15 -0
- data/lib/new_relic/agent/instrumentation/aws_sdk_firehose.rb +22 -0
- data/lib/new_relic/agent/instrumentation/aws_sdk_kinesis/chain.rb +21 -0
- data/lib/new_relic/agent/instrumentation/aws_sdk_kinesis/instrumentation.rb +91 -0
- data/lib/new_relic/agent/instrumentation/aws_sdk_kinesis/prepend.rb +15 -0
- data/lib/new_relic/agent/instrumentation/aws_sdk_kinesis.rb +22 -0
- data/lib/new_relic/agent/instrumentation/aws_sdk_lambda/chain.rb +33 -0
- data/lib/new_relic/agent/instrumentation/aws_sdk_lambda/instrumentation.rb +93 -0
- data/lib/new_relic/agent/instrumentation/aws_sdk_lambda/prepend.rb +23 -0
- data/lib/new_relic/agent/instrumentation/aws_sdk_lambda.rb +23 -0
- data/lib/new_relic/agent/instrumentation/aws_sqs.rb +0 -2
- data/lib/new_relic/agent/instrumentation/bunny.rb +3 -4
- data/lib/new_relic/agent/instrumentation/concurrent_ruby.rb +0 -2
- data/lib/new_relic/agent/instrumentation/curb.rb +3 -4
- data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +0 -4
- data/lib/new_relic/agent/instrumentation/dynamodb/instrumentation.rb +3 -4
- data/lib/new_relic/agent/instrumentation/dynamodb.rb +0 -2
- data/lib/new_relic/agent/instrumentation/elasticsearch/instrumentation.rb +1 -0
- data/lib/new_relic/agent/instrumentation/elasticsearch.rb +0 -2
- data/lib/new_relic/agent/instrumentation/ethon.rb +0 -4
- data/lib/new_relic/agent/instrumentation/fiber.rb +0 -2
- data/lib/new_relic/agent/instrumentation/grape/instrumentation.rb +0 -3
- data/lib/new_relic/agent/instrumentation/grape.rb +1 -3
- data/lib/new_relic/agent/instrumentation/httpclient.rb +0 -1
- data/lib/new_relic/agent/instrumentation/httprb.rb +0 -1
- data/lib/new_relic/agent/instrumentation/httpx.rb +0 -4
- data/lib/new_relic/agent/instrumentation/logger.rb +1 -3
- data/lib/new_relic/agent/instrumentation/logstasher.rb +0 -2
- data/lib/new_relic/agent/instrumentation/memcache.rb +0 -1
- data/lib/new_relic/agent/instrumentation/net_http/instrumentation.rb +3 -3
- data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +0 -2
- data/lib/new_relic/agent/instrumentation/opensearch.rb +0 -2
- data/lib/new_relic/agent/instrumentation/padrino.rb +3 -3
- data/lib/new_relic/agent/instrumentation/rake.rb +0 -1
- data/lib/new_relic/agent/instrumentation/rdkafka/chain.rb +2 -1
- data/lib/new_relic/agent/instrumentation/rdkafka/prepend.rb +2 -1
- data/lib/new_relic/agent/instrumentation/rdkafka.rb +0 -2
- data/lib/new_relic/agent/instrumentation/redis.rb +0 -1
- data/lib/new_relic/agent/instrumentation/resque.rb +7 -5
- data/lib/new_relic/agent/instrumentation/roda.rb +4 -4
- data/lib/new_relic/agent/instrumentation/ruby_kafka/prepend.rb +14 -4
- data/lib/new_relic/agent/instrumentation/ruby_kafka.rb +0 -2
- data/lib/new_relic/agent/instrumentation/sidekiq/extensions/delay_extensions.rb +24 -0
- data/lib/new_relic/agent/instrumentation/sidekiq/extensions/delayed_class.rb +1 -1
- data/lib/new_relic/agent/instrumentation/sidekiq.rb +9 -1
- data/lib/new_relic/agent/instrumentation/sinatra.rb +3 -6
- data/lib/new_relic/agent/instrumentation/thread.rb +0 -2
- data/lib/new_relic/agent/instrumentation/tilt.rb +0 -4
- data/lib/new_relic/agent/instrumentation/typhoeus.rb +0 -1
- data/lib/new_relic/agent/instrumentation/view_component/instrumentation.rb +11 -8
- data/lib/new_relic/agent/instrumentation/view_component.rb +0 -2
- data/lib/new_relic/agent/local_log_decorator.rb +12 -2
- data/lib/new_relic/agent/log_event_aggregator.rb +28 -2
- data/lib/new_relic/agent/new_relic_service.rb +8 -2
- data/lib/new_relic/agent/span_event_primitive.rb +4 -2
- data/lib/new_relic/agent/threading/backtrace_node.rb +10 -1
- data/lib/new_relic/agent/transaction/message_broker_segment.rb +3 -0
- data/lib/new_relic/agent/transaction/tracing.rb +4 -5
- data/lib/new_relic/agent/transaction.rb +2 -1
- data/lib/new_relic/agent/utilization_data.rb +15 -5
- data/lib/new_relic/agent.rb +2 -2
- data/lib/new_relic/control/frameworks/rails4.rb +1 -5
- data/lib/new_relic/control/instance_methods.rb +5 -0
- data/lib/new_relic/dependency_detection.rb +11 -13
- data/lib/new_relic/environment_report.rb +1 -5
- data/lib/new_relic/helper.rb +15 -0
- data/lib/new_relic/language_support.rb +1 -5
- data/lib/new_relic/version.rb +1 -1
- data/lib/sequel/extensions/new_relic_instrumentation.rb +1 -1
- data/lib/tasks/helpers/newrelicyml.rb +4 -2
- data/newrelic.yml +174 -66
- data/test/agent_helper.rb +8 -1
- metadata +17 -19
- data/lib/tasks/instrumentation_generator/README.md +0 -63
- data/lib/tasks/instrumentation_generator/TODO.md +0 -33
- data/lib/tasks/instrumentation_generator/instrumentation.thor +0 -130
- data/lib/tasks/instrumentation_generator/templates/Envfile.tt +0 -9
- data/lib/tasks/instrumentation_generator/templates/chain.tt +0 -21
- data/lib/tasks/instrumentation_generator/templates/chain_method.tt +0 -7
- data/lib/tasks/instrumentation_generator/templates/dependency_detection.tt +0 -29
- data/lib/tasks/instrumentation_generator/templates/instrumentation.tt +0 -13
- data/lib/tasks/instrumentation_generator/templates/instrumentation_method.tt +0 -3
- data/lib/tasks/instrumentation_generator/templates/newrelic.yml.tt +0 -19
- data/lib/tasks/instrumentation_generator/templates/prepend.tt +0 -13
- data/lib/tasks/instrumentation_generator/templates/prepend_method.tt +0 -3
- data/lib/tasks/instrumentation_generator/templates/test.tt +0 -15
data/newrelic.yml
CHANGED
@@ -40,9 +40,11 @@ common: &default_settings
|
|
40
40
|
|
41
41
|
# If false, LLM instrumentation (OpenAI only for now) will not capture input and
|
42
42
|
# output content on specific LLM events.
|
43
|
+
#
|
43
44
|
# The excluded attributes include:
|
44
|
-
#
|
45
|
-
#
|
45
|
+
# - content from LlmChatCompletionMessage events
|
46
|
+
# - input from LlmEmbedding events
|
47
|
+
#
|
46
48
|
# This is an optional security setting to prevent recording sensitive data sent
|
47
49
|
# to and received from your LLMs.
|
48
50
|
# ai_monitoring.record_content.enabled: true
|
@@ -65,21 +67,31 @@ common: &default_settings
|
|
65
67
|
# If true, the agent captures log records emitted by your application.
|
66
68
|
# application_logging.forwarding.enabled: true
|
67
69
|
|
70
|
+
# If true, the agent attaches labels to log records.
|
71
|
+
# application_logging.forwarding.labels.enabled: false
|
72
|
+
|
73
|
+
# A case-insensitive array or comma-delimited string containing the labels to
|
74
|
+
# exclude from log records.
|
75
|
+
# application_logging.forwarding.labels.exclude: []
|
76
|
+
|
68
77
|
# Sets the minimum level a log event must have to be forwarded to New Relic.
|
69
|
-
#
|
70
|
-
#
|
78
|
+
#
|
79
|
+
# This is based on the integer values of Ruby's Logger::Severity constants.
|
80
|
+
#
|
71
81
|
# The intention is to forward logs with the level given to the configuration, as
|
72
82
|
# well as any logs with a higher level of severity.
|
83
|
+
#
|
73
84
|
# For example, setting this value to "debug" will forward all log events to New
|
74
85
|
# Relic. Setting this value to "error" will only forward log events with the
|
75
86
|
# levels "error", "fatal", and "unknown".
|
87
|
+
#
|
76
88
|
# Valid values (ordered lowest to highest):
|
77
|
-
#
|
78
|
-
#
|
79
|
-
#
|
80
|
-
#
|
81
|
-
#
|
82
|
-
#
|
89
|
+
# - "debug"
|
90
|
+
# - "info"
|
91
|
+
# - "warn"
|
92
|
+
# - "error"
|
93
|
+
# - "fatal"
|
94
|
+
# - "unknown"
|
83
95
|
# application_logging.forwarding.log_level: debug
|
84
96
|
|
85
97
|
# Defines the maximum number of log records to buffer in memory at a time.
|
@@ -114,13 +126,13 @@ common: &default_settings
|
|
114
126
|
# audit_log.path: log/newrelic_audit.log
|
115
127
|
|
116
128
|
# An array of CLASS#METHOD (for instance methods) and/or CLASS.METHOD (for class
|
117
|
-
# methods) strings representing Ruby methods
|
118
|
-
# custom instrumentation to
|
119
|
-
# that defines the methods.
|
120
|
-
#
|
129
|
+
# methods) strings representing Ruby methods that the agent can automatically
|
130
|
+
# add custom instrumentation to. This doesn't require any modifications of the
|
131
|
+
# source code that defines the methods.
|
132
|
+
#
|
121
133
|
# Use fully qualified class names (using the :: delimiter) that include any
|
122
134
|
# module or class namespacing.
|
123
|
-
#
|
135
|
+
#
|
124
136
|
# Here is some Ruby source code that defines a render_png instance method for an
|
125
137
|
# Image class and a notify class method for a User class, both within a
|
126
138
|
# MyCompany module namespace:
|
@@ -131,7 +143,7 @@ common: &default_settings
|
|
131
143
|
# # code to render a PNG
|
132
144
|
# end
|
133
145
|
# end
|
134
|
-
#
|
146
|
+
#
|
135
147
|
# class User
|
136
148
|
# def self.notify
|
137
149
|
# # code to notify users
|
@@ -139,25 +151,30 @@ common: &default_settings
|
|
139
151
|
# end
|
140
152
|
# end
|
141
153
|
#
|
154
|
+
#
|
142
155
|
# Given that source code, the newrelic.yml config file might request
|
143
156
|
# instrumentation for both of these methods like so:
|
144
157
|
#
|
145
158
|
# automatic_custom_instrumentation_method_list:
|
146
|
-
#
|
147
|
-
#
|
148
|
-
#
|
159
|
+
# - MyCompany::Image#render_png
|
160
|
+
# - MyCompany::User.notify
|
161
|
+
#
|
162
|
+
#
|
149
163
|
# That configuration example uses YAML array syntax to specify both methods.
|
150
|
-
# Alternatively, a comma-delimited string
|
164
|
+
# Alternatively, you can use a comma-delimited string:
|
165
|
+
#
|
166
|
+
# automatic_custom_instrumentation_method_list: 'MyCompany::Image#render_png,
|
167
|
+
# MyCompany::User.notify'
|
151
168
|
#
|
152
|
-
# automatic_custom_instrumentation_method_list: 'MyCompany::Image#render_png, MyCompany::User.notify'
|
153
169
|
#
|
154
170
|
# Whitespace around the comma(s) in the list is optional. When configuring the
|
155
171
|
# agent with a list of methods via the
|
156
172
|
# NEW_RELIC_AUTOMATIC_CUSTOM_INSTRUMENTATION_METHOD_LIST environment variable,
|
157
|
-
# this comma-delimited string format
|
158
|
-
#
|
159
|
-
# export NEW_RELIC_AUTOMATIC_CUSTOM_INSTRUMENTATION_METHOD_LIST='MyCompany::Image#render_png, MyCompany::User.notify'
|
173
|
+
# use this comma-delimited string format:
|
160
174
|
#
|
175
|
+
# export
|
176
|
+
# NEW_RELIC_AUTOMATIC_CUSTOM_INSTRUMENTATION_METHOD_LIST='MyCompany::Image#render_png,
|
177
|
+
# MyCompany::User.notify'
|
161
178
|
# automatic_custom_instrumentation_method_list: []
|
162
179
|
|
163
180
|
# Specify a list of constants that should prevent the agent from starting
|
@@ -197,9 +214,8 @@ common: &default_settings
|
|
197
214
|
# monitoring scripts. For now, auto-injection only works with Rails 5.2+.
|
198
215
|
# browser_monitoring.content_security_policy_nonce: true
|
199
216
|
|
200
|
-
# Manual override for the path to your local CA bundle. This CA bundle
|
201
|
-
#
|
202
|
-
# service.
|
217
|
+
# Manual override for the path to your local CA bundle. This CA bundle validates
|
218
|
+
# the SSL certificate presented by New Relic's data collection service.
|
203
219
|
# ca_bundle_path: nil
|
204
220
|
|
205
221
|
# Enable or disable the capture of memcache keys from transaction traces.
|
@@ -207,6 +223,7 @@ common: &default_settings
|
|
207
223
|
|
208
224
|
# When true, the agent captures HTTP request parameters and attaches them to
|
209
225
|
# transaction traces, traced errors, and TransactionError events.
|
226
|
+
#
|
210
227
|
# When using the capture_params setting, the Ruby agent will not attempt to
|
211
228
|
# filter secret information. Recommendation: To filter secret information from
|
212
229
|
# request parameters, use the attributes.include setting instead. For more
|
@@ -216,6 +233,9 @@ common: &default_settings
|
|
216
233
|
# If true, the agent will clear Tracer::State in Agent.drop_buffered_data.
|
217
234
|
# clear_transaction_state_after_fork: false
|
218
235
|
|
236
|
+
# The AWS account ID for the AWS account associated with this app
|
237
|
+
# cloud.aws.account_id: nil
|
238
|
+
|
219
239
|
# If true, the agent will report source code level metrics for traced methods.
|
220
240
|
# See:
|
221
241
|
# https://docs.newrelic.com/docs/apm/agents/ruby-agent/features/ruby-codestream-integration/
|
@@ -223,10 +243,10 @@ common: &default_settings
|
|
223
243
|
|
224
244
|
# Path to newrelic.yml. If undefined, the agent checks the following directories
|
225
245
|
# (in order):
|
226
|
-
#
|
227
|
-
#
|
228
|
-
#
|
229
|
-
#
|
246
|
+
# - config/newrelic.yml
|
247
|
+
# - newrelic.yml
|
248
|
+
# - $HOME/.newrelic/newrelic.yml
|
249
|
+
# - $HOME/newrelic.yml
|
230
250
|
# config_path: newrelic.yml
|
231
251
|
|
232
252
|
# If false, custom attributes will not be sent on events.
|
@@ -235,9 +255,9 @@ common: &default_settings
|
|
235
255
|
# If true, the agent captures custom events.
|
236
256
|
# custom_insights_events.enabled: true
|
237
257
|
|
238
|
-
#
|
239
|
-
#
|
240
|
-
# ensures the agent captures the maximum amount of LLM events.
|
258
|
+
# - Specify a maximum number of custom events to buffer in memory at a time.
|
259
|
+
# - When configuring the agent for AI monitoring, set to max value 100000.
|
260
|
+
# This ensures the agent captures the maximum amount of LLM events.
|
241
261
|
# custom_insights_events.max_samples_stored: 3000
|
242
262
|
|
243
263
|
# If false, the agent will not add database_name parameter to transaction or
|
@@ -290,6 +310,7 @@ common: &default_settings
|
|
290
310
|
|
291
311
|
# If true, the agent won't wrap third-party middlewares in instrumentation
|
292
312
|
# (regardless of whether they are installed via Rack::Builder or Rails).
|
313
|
+
#
|
293
314
|
# When middleware instrumentation is disabled, if an application is using
|
294
315
|
# middleware that could alter the response code, the HTTP status code reported
|
295
316
|
# on the transaction may not reflect the altered value.
|
@@ -312,18 +333,18 @@ common: &default_settings
|
|
312
333
|
# If true, disables agent middleware for Sinatra. This middleware is responsible
|
313
334
|
# for advanced feature support such as cross application tracing, page load
|
314
335
|
# timing, and error collection.
|
336
|
+
#
|
315
337
|
# Cross application tracing is deprecated in favor of distributed tracing.
|
316
338
|
# Distributed tracing is on by default for Ruby agent versions 8.0.0 and above.
|
317
339
|
# Middlewares are not required to support distributed tracing.
|
340
|
+
#
|
318
341
|
# To continue using cross application tracing, update the following options in
|
319
342
|
# your newrelic.yml configuration file:
|
320
|
-
#
|
321
|
-
# # newrelic.yml
|
343
|
+
#
|
322
344
|
# cross_application_tracer:
|
323
|
-
#
|
345
|
+
# enabled: true
|
324
346
|
# distributed_tracing:
|
325
|
-
#
|
326
|
-
# ``
|
347
|
+
# enabled: false
|
327
348
|
# disable_sinatra_auto_middleware: false
|
328
349
|
|
329
350
|
# If true, disables view instrumentation.
|
@@ -338,6 +359,10 @@ common: &default_settings
|
|
338
359
|
# enable this feature.
|
339
360
|
# distributed_tracing.enabled: true
|
340
361
|
|
362
|
+
# If true, the agent captures the Elasticsearch cluster name in transaction
|
363
|
+
# traces.
|
364
|
+
# elasticsearch.capture_cluster_name: true
|
365
|
+
|
341
366
|
# If true, the agent captures Elasticsearch queries in transaction traces.
|
342
367
|
# elasticsearch.capture_queries: true
|
343
368
|
|
@@ -384,7 +409,7 @@ common: &default_settings
|
|
384
409
|
# classes specified here occurs, if its error message contains one of the
|
385
410
|
# strings corresponding to it here, that error will be ignored.
|
386
411
|
# This option can't be set via environment variable.
|
387
|
-
# error_collector.ignore_messages: {}
|
412
|
+
# error_collector.ignore_messages: {"ThreadError" => ["queue empty"]}
|
388
413
|
|
389
414
|
# A comma separated list of status codes, possibly including ranges. Errors
|
390
415
|
# associated with these status codes, where applicable, will be ignored.
|
@@ -430,9 +455,9 @@ common: &default_settings
|
|
430
455
|
# sending each span individually.
|
431
456
|
# infinite_tracing.batching: true
|
432
457
|
|
433
|
-
# Configure the compression level for data sent to the trace observer.
|
434
|
-
#
|
435
|
-
#
|
458
|
+
# Configure the compression level for data sent to the trace observer. May be
|
459
|
+
# one of: :none, :low, :medium, :high. Set the level to :none to disable
|
460
|
+
# compression.
|
436
461
|
# infinite_tracing.compression_level: high
|
437
462
|
|
438
463
|
# Configures the hostname for the trace observer Host. When configured, enables
|
@@ -455,6 +480,18 @@ common: &default_settings
|
|
455
480
|
# prepend, chain, disabled.
|
456
481
|
# instrumentation.async_http: auto
|
457
482
|
|
483
|
+
# Controls auto-instrumentation of the aws-sdk-firehose library at start-up. May
|
484
|
+
# be one of auto, prepend, chain, disabled.
|
485
|
+
# instrumentation.aws_sdk_firehose: auto
|
486
|
+
|
487
|
+
# Controls auto-instrumentation of the aws-sdk-kinesis library at start-up. May
|
488
|
+
# be one of auto, prepend, chain, disabled.
|
489
|
+
# instrumentation.aws_sdk_kinesis: auto
|
490
|
+
|
491
|
+
# Controls auto-instrumentation of the aws_sdk_lambda library at start-up. May
|
492
|
+
# be one of auto, prepend, chain, disabled.
|
493
|
+
# instrumentation.aws_sdk_lambda: auto
|
494
|
+
|
458
495
|
# Controls auto-instrumentation of the aws-sdk-sqs library at start-up. May be
|
459
496
|
# one of: auto, prepend, chain, disabled.
|
460
497
|
# instrumentation.aws_sqs: auto
|
@@ -719,8 +756,8 @@ common: &default_settings
|
|
719
756
|
|
720
757
|
# If true, the agent will operate in a streamlined mode suitable for use with
|
721
758
|
# short-lived serverless functions. NOTE: Only AWS Lambda functions are
|
722
|
-
# supported currently and this option
|
723
|
-
#
|
759
|
+
# supported currently and this option isn't intended for use without New Relic's
|
760
|
+
# Ruby Lambda layer offering.
|
724
761
|
# serverless_mode.enabled: false
|
725
762
|
|
726
763
|
# An array of strings that will collectively serve as a denylist for filtering
|
@@ -775,9 +812,9 @@ common: &default_settings
|
|
775
812
|
# If true, enables span event sampling.
|
776
813
|
# span_events.enabled: true
|
777
814
|
|
778
|
-
#
|
815
|
+
# - Defines the maximum number of span events reported from a single harvest.
|
779
816
|
# Any Integer between 1 and 10000 is valid.'
|
780
|
-
#
|
817
|
+
# - When configuring the agent for AI monitoring, set to max value 10000.This
|
781
818
|
# ensures the agent captures the maximum amount of distributed traces.
|
782
819
|
# span_events.max_samples_stored: 2000
|
783
820
|
|
@@ -791,7 +828,7 @@ common: &default_settings
|
|
791
828
|
# strip_exception_messages.allowed_classes: ""
|
792
829
|
|
793
830
|
# If true, the agent strips messages from all exceptions except those in the
|
794
|
-
#
|
831
|
+
# allowed classes list. Enabled automatically in high security mode.
|
795
832
|
# strip_exception_messages.enabled: false
|
796
833
|
|
797
834
|
# An array of strings to specify which keys and/or values inside a Stripe
|
@@ -799,17 +836,17 @@ common: &default_settings
|
|
799
836
|
# not be reported to New Relic. Each string in this array will be turned into a
|
800
837
|
# regular expression via
|
801
838
|
# Regexp.new to permit advanced matching. For each hash pair, if either the key
|
802
|
-
# or value is matched the
|
803
|
-
#
|
804
|
-
#
|
805
|
-
#
|
839
|
+
# or value is matched the pair
|
840
|
+
# isn't reported. By default, no user_data is reported. Use this option only if
|
841
|
+
# the
|
842
|
+
# stripe.user_data.include option is also used.
|
806
843
|
# stripe.user_data.exclude: []
|
807
844
|
|
808
845
|
# An array of strings to specify which keys inside a Stripe event's user_data
|
809
846
|
# hash should be reported
|
810
847
|
# to New Relic. Each string in this array will be turned into a regular
|
811
848
|
# expression via Regexp.new to
|
812
|
-
#
|
849
|
+
# enable advanced matching. Setting the value to ["."] will report all
|
813
850
|
# user_data.
|
814
851
|
# stripe.user_data.include: []
|
815
852
|
|
@@ -873,7 +910,7 @@ common: &default_settings
|
|
873
910
|
|
874
911
|
# If true, enables the collection of explain plans in transaction traces. This
|
875
912
|
# setting will also apply to explain plans in slow SQL traces if
|
876
|
-
# slow_sql.explain_enabled
|
913
|
+
# slow_sql.explain_enabled isn't set separately.
|
877
914
|
# transaction_tracer.explain_enabled: true
|
878
915
|
|
879
916
|
# Threshold (in seconds) above which the agent will collect explain plans.
|
@@ -952,28 +989,99 @@ common: &default_settings
|
|
952
989
|
# security.agent.enabled: false
|
953
990
|
|
954
991
|
# The port the application is listening on. This setting is mandatory for
|
955
|
-
# Passenger servers.
|
992
|
+
# Passenger servers. The agent detects other servers by default.
|
956
993
|
# security.application_info.port: nil
|
957
994
|
|
958
|
-
# If true,
|
959
|
-
# security.
|
995
|
+
# If true, the security agent is started (the agent runs in its event loop)
|
996
|
+
# security.enabled: false
|
997
|
+
|
998
|
+
# Defines API paths the security agent should ignore in IAST scans. Accepts an
|
999
|
+
# array of regex patterns matching the URI to ignore. The regex pattern should
|
1000
|
+
# find a complete match for the URL without the endpoint. For example,
|
1001
|
+
# [".*account.*"], [".*/\api\/v1\/.*?\/login"]
|
1002
|
+
# security.exclude_from_iast_scan.api: []
|
960
1003
|
|
961
|
-
#
|
962
|
-
#
|
1004
|
+
# An array of HTTP request body keys the security agent should ignore in IAST
|
1005
|
+
# scans.
|
1006
|
+
# security.exclude_from_iast_scan.http_request_parameters.body: []
|
963
1007
|
|
964
|
-
#
|
965
|
-
#
|
1008
|
+
# An array of HTTP request headers the security agent should ignore in IAST
|
1009
|
+
# scans. The array should specify a list of patterns matching the headers to
|
1010
|
+
# ignore.
|
1011
|
+
# security.exclude_from_iast_scan.http_request_parameters.header: []
|
966
1012
|
|
967
|
-
#
|
968
|
-
#
|
1013
|
+
# An array of HTTP request query parameters the security agent should ignore in
|
1014
|
+
# IAST scans. The array should specify a list of patterns matching the HTTP
|
1015
|
+
# request query parameters to ignore.
|
1016
|
+
# security.exclude_from_iast_scan.http_request_parameters.query: []
|
1017
|
+
|
1018
|
+
# If true, disables system command injection detection in IAST scans.
|
1019
|
+
# security.exclude_from_iast_scan.iast_detection_category.command_injection: false
|
1020
|
+
|
1021
|
+
# If true, disables the detection of low-severity insecure settings. For
|
1022
|
+
# example, hash, crypto, cookie, random generators, trust boundary).
|
1023
|
+
# security.exclude_from_iast_scan.iast_detection_category.insecure_settings: false
|
1024
|
+
|
1025
|
+
# If true, disables file operation-related IAST detections (File Access &
|
1026
|
+
# Application integrity violation)
|
1027
|
+
# security.exclude_from_iast_scan.iast_detection_category.invalid_file_access: false
|
1028
|
+
|
1029
|
+
# If true, disables Javascript injection detection in IAST scans.
|
1030
|
+
# security.exclude_from_iast_scan.iast_detection_category.javascript_injection: false
|
1031
|
+
|
1032
|
+
# If true, disables LDAP injection detection in IAST scans.
|
1033
|
+
# security.exclude_from_iast_scan.iast_detection_category.ldap_injection: false
|
1034
|
+
|
1035
|
+
# If true, disables NOSQL injection detection in IAST scans.
|
1036
|
+
# security.exclude_from_iast_scan.iast_detection_category.nosql_injection: false
|
1037
|
+
|
1038
|
+
# If true, disables Reflected Cross-Site Scripting (RXSS) detection in IAST
|
1039
|
+
# scans.
|
1040
|
+
# security.exclude_from_iast_scan.iast_detection_category.rxss: false
|
1041
|
+
|
1042
|
+
# If true, disables SQL injection detection in IAST scans.
|
1043
|
+
# security.exclude_from_iast_scan.iast_detection_category.sql_injection: false
|
1044
|
+
|
1045
|
+
# If true, disables Sever-Side Request Forgery (SSRF) detection in IAST scans.
|
1046
|
+
# security.exclude_from_iast_scan.iast_detection_category.ssrf: false
|
1047
|
+
|
1048
|
+
# If true, disables XPATH injection detection in IAST scans.
|
1049
|
+
# security.exclude_from_iast_scan.iast_detection_category.xpath_injection: false
|
1050
|
+
|
1051
|
+
# A unique test identifier when runnning IAST in a CI/CD environment to
|
1052
|
+
# differentiate between different test runs. For example, a build number.
|
1053
|
+
# security.iast_test_identifier: nil
|
969
1054
|
|
970
1055
|
# Defines the mode for the security agent to operate in. Currently only IAST is
|
971
1056
|
# supported
|
972
1057
|
# security.mode: IAST
|
973
1058
|
|
974
|
-
#
|
975
|
-
# default value is
|
976
|
-
# security.
|
1059
|
+
# Sets the maximum number of HTTP requests allowed for the IAST scan per minute.
|
1060
|
+
# Any Integer between 12 and 3600 is valid. The default value is 3600.
|
1061
|
+
# security.scan_controllers.iast_scan_request_rate_limit: 3600
|
1062
|
+
|
1063
|
+
# If true, enables the sending of HTTP responses bodies. Disabling this also
|
1064
|
+
# disables Reflected Cross-Site Scripting (RXSS) vulnerability detection.
|
1065
|
+
# security.scan_controllers.report_http_response_body: true
|
1066
|
+
|
1067
|
+
# The number of application instances for a specific entity to perform IAST
|
1068
|
+
# analysis on.
|
1069
|
+
# security.scan_controllers.scan_instance_count: 0
|
1070
|
+
|
1071
|
+
# If true, allows IAST to continuously gather trace data in the background. The
|
1072
|
+
# security agent uses collected data to perform an IAST scan at the scheduled
|
1073
|
+
# time.
|
1074
|
+
# security.scan_schedule.always_sample_traces: false
|
1075
|
+
|
1076
|
+
# Specifies the delay time (in minutes) before the IAST scan begins after the
|
1077
|
+
# application starts.
|
1078
|
+
# security.scan_schedule.delay: 0
|
1079
|
+
|
1080
|
+
# Indicates the duration (in minutes) for which the IAST scan will be performed.
|
1081
|
+
# security.scan_schedule.duration: 0
|
1082
|
+
|
1083
|
+
# Specifies a cron expression that sets when the IAST scan should run.
|
1084
|
+
# security.scan_schedule.schedule: ""
|
977
1085
|
|
978
1086
|
# Defines the endpoint URL for posting security-related data
|
979
1087
|
# security.validator_service_url: wss://csec.nr-data.net
|
data/test/agent_helper.rb
CHANGED
@@ -112,7 +112,14 @@ def assert_log_contains(log, message)
|
|
112
112
|
lines = log.array
|
113
113
|
|
114
114
|
assert (lines.any? { |line| line.match(message) }),
|
115
|
-
"Could not find message. Log contained: #{lines.join("\n")}"
|
115
|
+
"Could not find message: '#{message.inspect}'. Log contained: #{lines.join("\n")}"
|
116
|
+
end
|
117
|
+
|
118
|
+
def refute_log_contains(log, message)
|
119
|
+
lines = log.array
|
120
|
+
|
121
|
+
refute (lines.any? { |line| line.match(message) }),
|
122
|
+
"Found message: '#{message.inspect}'. Log contained: #{lines.join("\n")}"
|
116
123
|
end
|
117
124
|
|
118
125
|
def assert_audit_log_contains(audit_log_contents, needle)
|
metadata
CHANGED
@@ -1,17 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: newrelic_rpm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.
|
4
|
+
version: 9.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tanna McClure
|
8
8
|
- Kayla Reopelle
|
9
9
|
- James Bunch
|
10
10
|
- Hannah Ramadan
|
11
|
-
autorequire:
|
12
11
|
bindir: bin
|
13
12
|
cert_chain: []
|
14
|
-
date:
|
13
|
+
date: 2025-04-02 00:00:00.000000000 Z
|
15
14
|
dependencies:
|
16
15
|
- !ruby/object:Gem::Dependency
|
17
16
|
name: bundler
|
@@ -344,6 +343,7 @@ files:
|
|
344
343
|
- lib/new_relic/agent/external.rb
|
345
344
|
- lib/new_relic/agent/guid_generator.rb
|
346
345
|
- lib/new_relic/agent/harvester.rb
|
346
|
+
- lib/new_relic/agent/health_check.rb
|
347
347
|
- lib/new_relic/agent/heap.rb
|
348
348
|
- lib/new_relic/agent/hostname.rb
|
349
349
|
- lib/new_relic/agent/http_clients/abstract.rb
|
@@ -392,6 +392,18 @@ files:
|
|
392
392
|
- lib/new_relic/agent/instrumentation/async_http/chain.rb
|
393
393
|
- lib/new_relic/agent/instrumentation/async_http/instrumentation.rb
|
394
394
|
- lib/new_relic/agent/instrumentation/async_http/prepend.rb
|
395
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_firehose.rb
|
396
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_firehose/chain.rb
|
397
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_firehose/instrumentation.rb
|
398
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_firehose/prepend.rb
|
399
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_kinesis.rb
|
400
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_kinesis/chain.rb
|
401
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_kinesis/instrumentation.rb
|
402
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_kinesis/prepend.rb
|
403
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_lambda.rb
|
404
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_lambda/chain.rb
|
405
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_lambda/instrumentation.rb
|
406
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_lambda/prepend.rb
|
395
407
|
- lib/new_relic/agent/instrumentation/aws_sqs.rb
|
396
408
|
- lib/new_relic/agent/instrumentation/aws_sqs/chain.rb
|
397
409
|
- lib/new_relic/agent/instrumentation/aws_sqs/instrumentation.rb
|
@@ -543,6 +555,7 @@ files:
|
|
543
555
|
- lib/new_relic/agent/instrumentation/sequel_helper.rb
|
544
556
|
- lib/new_relic/agent/instrumentation/sidekiq.rb
|
545
557
|
- lib/new_relic/agent/instrumentation/sidekiq/client.rb
|
558
|
+
- lib/new_relic/agent/instrumentation/sidekiq/extensions/delay_extensions.rb
|
546
559
|
- lib/new_relic/agent/instrumentation/sidekiq/extensions/delayed_class.rb
|
547
560
|
- lib/new_relic/agent/instrumentation/sidekiq/server.rb
|
548
561
|
- lib/new_relic/agent/instrumentation/sinatra.rb
|
@@ -734,19 +747,6 @@ files:
|
|
734
747
|
- lib/tasks/helpers/prompt.rb
|
735
748
|
- lib/tasks/helpers/version_bump.rb
|
736
749
|
- lib/tasks/install.rake
|
737
|
-
- lib/tasks/instrumentation_generator/README.md
|
738
|
-
- lib/tasks/instrumentation_generator/TODO.md
|
739
|
-
- lib/tasks/instrumentation_generator/instrumentation.thor
|
740
|
-
- lib/tasks/instrumentation_generator/templates/Envfile.tt
|
741
|
-
- lib/tasks/instrumentation_generator/templates/chain.tt
|
742
|
-
- lib/tasks/instrumentation_generator/templates/chain_method.tt
|
743
|
-
- lib/tasks/instrumentation_generator/templates/dependency_detection.tt
|
744
|
-
- lib/tasks/instrumentation_generator/templates/instrumentation.tt
|
745
|
-
- lib/tasks/instrumentation_generator/templates/instrumentation_method.tt
|
746
|
-
- lib/tasks/instrumentation_generator/templates/newrelic.yml.tt
|
747
|
-
- lib/tasks/instrumentation_generator/templates/prepend.tt
|
748
|
-
- lib/tasks/instrumentation_generator/templates/prepend_method.tt
|
749
|
-
- lib/tasks/instrumentation_generator/templates/test.tt
|
750
750
|
- lib/tasks/newrelic.rb
|
751
751
|
- lib/tasks/newrelicyml.rake
|
752
752
|
- lib/tasks/tests.rake
|
@@ -763,7 +763,6 @@ metadata:
|
|
763
763
|
documentation_uri: https://docs.newrelic.com/docs/agents/ruby-agent
|
764
764
|
source_code_uri: https://github.com/newrelic/newrelic-ruby-agent
|
765
765
|
homepage_uri: https://newrelic.com/ruby
|
766
|
-
post_install_message:
|
767
766
|
rdoc_options: []
|
768
767
|
require_paths:
|
769
768
|
- lib
|
@@ -778,8 +777,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
778
777
|
- !ruby/object:Gem::Version
|
779
778
|
version: 1.3.1
|
780
779
|
requirements: []
|
781
|
-
rubygems_version: 3.
|
782
|
-
signing_key:
|
780
|
+
rubygems_version: 3.6.2
|
783
781
|
specification_version: 4
|
784
782
|
summary: New Relic Ruby Agent
|
785
783
|
test_files: []
|
@@ -1,63 +0,0 @@
|
|
1
|
-
# Instrumentation Generator
|
2
|
-
|
3
|
-
## Usage
|
4
|
-
|
5
|
-
`thor list` can be passed to get a list of all available thor commands
|
6
|
-
|
7
|
-
### instrumentation:scaffold
|
8
|
-
|
9
|
-
This task requires one parameter by default: the name of the library or class you are instrumenting. This task generates the basic file structure needed to add new instrumentation to the Ruby agent.
|
10
|
-
|
11
|
-
Run it using:
|
12
|
-
|
13
|
-
`thor instrumentation:scaffold gem_name`
|
14
|
-
|
15
|
-
It accepts two optional parameters:
|
16
|
-
|
17
|
-
- `--method`: the name of a method to instrument. Only one method can be accepted at this time. Defaults to `method_to_instrument`
|
18
|
-
- `--args`: the arguments for the instrumented method. A comma-separated list can be given if there are multiple arguments. Defaults to `*args`.
|
19
|
-
|
20
|
-
With the optional parameters, the task can be run like so:
|
21
|
-
|
22
|
-
`thor instrumentation:scaffold gem_name --method=method_to_instrument --args=arg1,arg2,arg3`
|
23
|
-
|
24
|
-
### WIP: instrumentation:add_new_method
|
25
|
-
|
26
|
-
Are you trying add instrumentation for a method within library we already instrument? This task is for you! Instead of building the entire scaffold, this task inserts only the changes needed within the `instrumentation.rb` and test files to instrument the new method. It requires one argument, the name of the existing instrumentation to add the method to. If the instrumented library does not already exist, it will create a new scaffold for that library.
|
27
|
-
|
28
|
-
Run it using:
|
29
|
-
|
30
|
-
`thor instrumentation:scaffold gem_name`
|
31
|
-
|
32
|
-
It accepts two optional parameters:
|
33
|
-
|
34
|
-
- `--method`: the name of a method to instrument. Only one method can be accepted at this time. Defaults to `method_to_instrument`
|
35
|
-
- `--args`: the arguments for the instrumented method. A comma-separated list can be given if there are multiple arguments. Defaults to `*args`.
|
36
|
-
|
37
|
-
With the optional parameters, the task can be run like so:
|
38
|
-
|
39
|
-
`thor instrumentation:add_new_method gem_name --method=method_to_instrument --args=arg1,arg2,arg3`
|
40
|
-
|
41
|
-
## Idea
|
42
|
-
|
43
|
-
Create a CLI, similar to Rails’ generators and scaffold scripts, to create the required files and basic classes for instrumenting new libraries. The hope is that the parts of adding new instrumentation that is repetitive can be eliminated and/or reduced so that it takes less time to add new instrumentation and we can spend development time considering the best attributes to collect and interactions to measure. I also hope this project will reduce the overall toil related to adding new instrumentation.
|
44
|
-
|
45
|
-
The files we create with little variation besides library and method names are:
|
46
|
-
|
47
|
-
- Lib
|
48
|
-
- Dependency detection
|
49
|
-
- Chain
|
50
|
-
- Prepend
|
51
|
-
- Instrumentation
|
52
|
-
- Tests
|
53
|
-
- configuration/newrelic.yml
|
54
|
-
- Envfile
|
55
|
-
- Test file
|
56
|
-
|
57
|
-
Furthermore, we also create very similar snippets inside the default source configuration file that could be generated by this project as well.
|
58
|
-
|
59
|
-
## Outcome
|
60
|
-
|
61
|
-
A prototype outside the agent was first created. This prototype generated the required files to add instrumentation. The prototype accepted three arguments: name (name of the library), method (method to instrument), args (arguments for the method). This prototype has evolved into the current directory.
|
62
|
-
|
63
|
-
This project leverages the Ruby gem Thor, a toolkit for building powerful command-line interfaces used in Bundler, Vagrant, Rails and others powers this CLI.
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# TODO
|
2
|
-
|
3
|
-
# - [X] Create instrumentation file
|
4
|
-
|
5
|
-
# - [X] Create chain file
|
6
|
-
|
7
|
-
# - [X] Create prepend file
|
8
|
-
|
9
|
-
# - [X] Create dependency detection file
|
10
|
-
|
11
|
-
# - [X] Add config to default source
|
12
|
-
|
13
|
-
# - [X] Create multiverse suite
|
14
|
-
|
15
|
-
# - [X] Create Envfile
|
16
|
-
|
17
|
-
# - [X] Create test file with examples
|
18
|
-
|
19
|
-
# - [X] Create option for method names to instrument
|
20
|
-
|
21
|
-
# - [X] Add entry to newrelic.yml
|
22
|
-
|
23
|
-
# - [ ] Append a new method to instrument to an existing instrumentation class (with tests?)
|
24
|
-
|
25
|
-
# - [ ] Documentation: examples of what to add in each gap (Good examples of tests, instrumentation, etc. as comments to guide users)
|
26
|
-
|
27
|
-
# - [ ] Handle multi-word gem names (camel case for classes, handle hyphens, concurrent-ruby as example)
|
28
|
-
|
29
|
-
# - [ ] Allow multiple method arguments to be passed to the command line
|
30
|
-
|
31
|
-
# - [ ] Add tests for the instrumentation_generator code
|
32
|
-
|
33
|
-
# - [ ] See if instrumentation PRs can get automatically generated when an already instrumented library adds methods to its codebase
|