newrelic_rpm 9.17.0 → 9.21.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 +105 -1
- data/lib/new_relic/agent/agent.rb +2 -0
- data/lib/new_relic/agent/agent_helpers/connect.rb +3 -3
- data/lib/new_relic/agent/agent_helpers/harvest.rb +3 -3
- data/lib/new_relic/agent/agent_helpers/shutdown.rb +1 -1
- data/lib/new_relic/agent/agent_helpers/start_worker_thread.rb +1 -1
- data/lib/new_relic/agent/agent_helpers/startup.rb +4 -4
- data/lib/new_relic/agent/configuration/default_source.rb +145 -120
- data/lib/new_relic/agent/configuration/manager.rb +5 -2
- data/lib/new_relic/agent/configuration/yaml_source.rb +4 -4
- data/lib/new_relic/agent/database.rb +1 -1
- data/lib/new_relic/agent/database_adapter.rb +1 -1
- data/lib/new_relic/agent/datastores/redis.rb +1 -1
- data/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +1 -1
- data/lib/new_relic/agent/distributed_tracing.rb +2 -0
- data/lib/new_relic/agent/external.rb +2 -0
- data/lib/new_relic/agent/http_clients/uri_util.rb +1 -1
- data/lib/new_relic/agent/instrumentation/action_dispatch.rb +1 -1
- data/lib/new_relic/agent/instrumentation/action_dispatch_subscriber.rb +1 -1
- data/lib/new_relic/agent/instrumentation/action_mailbox.rb +1 -1
- data/lib/new_relic/agent/instrumentation/action_mailer.rb +1 -1
- data/lib/new_relic/agent/instrumentation/active_job.rb +1 -1
- data/lib/new_relic/agent/instrumentation/active_job_subscriber.rb +6 -2
- data/lib/new_relic/agent/instrumentation/active_record.rb +6 -4
- data/lib/new_relic/agent/instrumentation/active_record_helper.rb +2 -2
- data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +11 -9
- data/lib/new_relic/agent/instrumentation/active_record_prepend.rb +2 -2
- data/lib/new_relic/agent/instrumentation/async_http.rb +1 -1
- data/lib/new_relic/agent/instrumentation/aws_sdk_kinesis/instrumentation.rb +1 -1
- data/lib/new_relic/agent/instrumentation/concurrent_ruby.rb +1 -1
- data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +4 -0
- data/lib/new_relic/agent/instrumentation/curb.rb +1 -1
- data/lib/new_relic/agent/instrumentation/elasticsearch/chain.rb +1 -2
- data/lib/new_relic/agent/instrumentation/elasticsearch/instrumentation.rb +1 -0
- data/lib/new_relic/agent/instrumentation/elasticsearch.rb +1 -1
- data/lib/new_relic/agent/instrumentation/ethon.rb +1 -1
- data/lib/new_relic/agent/instrumentation/excon.rb +1 -1
- data/lib/new_relic/agent/instrumentation/fiber/chain.rb +1 -1
- data/lib/new_relic/agent/instrumentation/fiber/prepend.rb +1 -1
- data/lib/new_relic/agent/instrumentation/httpclient.rb +1 -4
- data/lib/new_relic/agent/instrumentation/httpx/instrumentation.rb +1 -1
- data/lib/new_relic/agent/instrumentation/httpx.rb +1 -1
- data/lib/new_relic/agent/instrumentation/logstasher.rb +1 -1
- data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +1 -1
- data/lib/new_relic/agent/instrumentation/memcache/helper.rb +2 -2
- data/lib/new_relic/agent/instrumentation/memcache/instrumentation.rb +1 -1
- data/lib/new_relic/agent/instrumentation/memcache/prepend.rb +1 -1
- data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +1 -1
- data/lib/new_relic/agent/instrumentation/net_http/instrumentation.rb +3 -3
- data/lib/new_relic/agent/instrumentation/net_http.rb +2 -1
- data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +0 -2
- data/lib/new_relic/agent/instrumentation/rake.rb +1 -1
- data/lib/new_relic/agent/instrumentation/rdkafka/chain.rb +2 -2
- data/lib/new_relic/agent/instrumentation/rdkafka/prepend.rb +2 -2
- data/lib/new_relic/agent/instrumentation/redis/constants.rb +2 -2
- data/lib/new_relic/agent/instrumentation/resque.rb +2 -2
- data/lib/new_relic/agent/instrumentation/roda.rb +1 -1
- data/lib/new_relic/agent/instrumentation/ruby_kafka/prepend.rb +1 -1
- data/lib/new_relic/agent/instrumentation/ruby_openai.rb +2 -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/stripe.rb +1 -1
- data/lib/new_relic/agent/instrumentation/typhoeus/instrumentation.rb +2 -2
- data/lib/new_relic/agent/llm/chat_completion_summary.rb +1 -1
- data/lib/new_relic/agent/llm/embedding.rb +1 -1
- data/lib/new_relic/agent/local_log_decorator.rb +1 -1
- data/lib/new_relic/agent/logging.rb +1 -1
- data/lib/new_relic/agent/messaging.rb +5 -0
- data/lib/new_relic/agent/method_tracer.rb +3 -0
- data/lib/new_relic/agent/monitors/inbound_request_monitor.rb +1 -1
- data/lib/new_relic/agent/monitors/synthetics_monitor.rb +1 -1
- data/lib/new_relic/agent/new_relic_service/json_marshaller.rb +2 -2
- data/lib/new_relic/agent/new_relic_service.rb +2 -2
- data/lib/new_relic/agent/opentelemetry/context/propagation/trace_propagator.rb +66 -0
- data/lib/new_relic/agent/opentelemetry/context/propagation.rb +15 -0
- data/lib/{tasks/instrumentation_generator/templates/Envfile.tt → new_relic/agent/opentelemetry/context.rb} +9 -5
- data/lib/new_relic/agent/opentelemetry/trace/span.rb +31 -0
- data/lib/new_relic/agent/opentelemetry/trace/tracer.rb +129 -0
- data/lib/new_relic/agent/opentelemetry/trace/tracer_provider.rb +18 -0
- data/lib/new_relic/agent/opentelemetry/trace.rb +15 -0
- data/lib/new_relic/agent/opentelemetry/transaction_patch.rb +69 -0
- data/lib/new_relic/agent/opentelemetry_bridge.rb +32 -0
- data/lib/new_relic/agent/parameter_filtering.rb +1 -1
- data/lib/new_relic/agent/samplers/cpu_sampler.rb +1 -1
- data/lib/new_relic/agent/samplers/memory_sampler.rb +1 -1
- data/lib/new_relic/agent/serverless_handler.rb +7 -1
- data/lib/new_relic/agent/span_event_primitive.rb +8 -1
- data/lib/new_relic/agent/tracer.rb +1 -1
- data/lib/new_relic/agent/transaction/abstract_segment.rb +2 -1
- data/lib/new_relic/agent/transaction/datastore_segment.rb +1 -1
- data/lib/new_relic/agent/transaction/distributed_tracer.rb +3 -3
- data/lib/new_relic/agent/transaction/message_broker_segment.rb +1 -1
- data/lib/new_relic/agent/transaction/request_attributes.rb +1 -6
- data/lib/new_relic/agent/transaction/trace_context.rb +33 -4
- data/lib/new_relic/agent/transaction/tracing.rb +3 -3
- data/lib/new_relic/agent/transaction.rb +2 -1
- data/lib/new_relic/agent/transaction_time_aggregator.rb +1 -1
- data/lib/new_relic/agent/utilization/ecs.rb +22 -0
- data/lib/new_relic/agent/utilization/ecs_v4.rb +22 -0
- data/lib/new_relic/agent/utilization_data.rb +40 -5
- data/lib/new_relic/agent/vm/c_ruby_vm.rb +3 -3
- data/lib/new_relic/agent.rb +28 -0
- data/lib/new_relic/constants.rb +1 -0
- data/lib/new_relic/control/instance_methods.rb +5 -0
- data/lib/new_relic/control/instrumentation.rb +1 -1
- data/lib/new_relic/dependency_detection.rb +0 -1
- data/lib/new_relic/helper.rb +7 -0
- data/lib/new_relic/version.rb +1 -1
- data/lib/sequel/extensions/new_relic_instrumentation.rb +1 -1
- data/lib/tasks/helpers/newrelicyml.rb +6 -2
- data/newrelic.yml +80 -43
- data/newrelic_rpm.gemspec +1 -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/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 -32
- 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
@@ -387,9 +387,9 @@ module NewRelic
|
|
387
387
|
:allowed_from_server => false,
|
388
388
|
:description => <<~DESCRIPTION
|
389
389
|
An array of ActiveSupport custom event names to subscribe to and instrument. For example,
|
390
|
-
|
391
|
-
|
392
|
-
|
390
|
+
\t\t- one.custom.event
|
391
|
+
\t\t- another.event
|
392
|
+
\t\t- a.third.event
|
393
393
|
DESCRIPTION
|
394
394
|
},
|
395
395
|
:'ai_monitoring.enabled' => {
|
@@ -407,11 +407,11 @@ module NewRelic
|
|
407
407
|
:description => <<~DESCRIPTION
|
408
408
|
If `false`, LLM instrumentation (OpenAI only for now) will not capture input and output content on specific LLM events.
|
409
409
|
|
410
|
-
|
411
|
-
|
412
|
-
|
410
|
+
\tThe excluded attributes include:
|
411
|
+
\t- `content` from LlmChatCompletionMessage events
|
412
|
+
\t- `input` from LlmEmbedding events
|
413
413
|
|
414
|
-
|
414
|
+
\tThis is an optional security setting to prevent recording sensitive data sent to and received from your LLMs.
|
415
415
|
DESCRIPTION
|
416
416
|
},
|
417
417
|
# this is only set via server side config
|
@@ -460,9 +460,9 @@ module NewRelic
|
|
460
460
|
:description => <<~DESCRIPTION
|
461
461
|
When `true`, the agent captures HTTP request parameters and attaches them to transaction traces, traced errors, and [`TransactionError` events](/attribute-dictionary?attribute_name=&events_tids%5B%5D=8241).
|
462
462
|
|
463
|
-
|
464
|
-
|
465
|
-
|
463
|
+
<Callout variant="caution">
|
464
|
+
\tWhen using the `capture_params` setting, the Ruby agent will not attempt to filter secret information. `Recommendation:` To filter secret information from request parameters, use the [`attributes.include` setting](/docs/agents/ruby-agent/attributes/enable-disable-attributes-ruby) instead. For more information, see the <a href="/docs/agents/ruby-agent/attributes/ruby-attribute-examples#ex_req_params">Ruby attribute examples</a>.
|
465
|
+
</Callout>
|
466
466
|
DESCRIPTION
|
467
467
|
},
|
468
468
|
:'clear_transaction_state_after_fork' => {
|
@@ -487,10 +487,10 @@ module NewRelic
|
|
487
487
|
:allowed_from_server => false,
|
488
488
|
:description => <<~DESC
|
489
489
|
Path to `newrelic.yml`. If undefined, the agent checks the following directories (in order):
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
490
|
+
\t- `config/newrelic.yml`
|
491
|
+
\t- `newrelic.yml`
|
492
|
+
\t- `$HOME/.newrelic/newrelic.yml`
|
493
|
+
\t- `$HOME/newrelic.yml`
|
494
494
|
DESC
|
495
495
|
},
|
496
496
|
:'exclude_newrelic_header' => {
|
@@ -674,13 +674,13 @@ module NewRelic
|
|
674
674
|
:public => true,
|
675
675
|
:type => String,
|
676
676
|
:allowed_from_server => true,
|
677
|
-
:description =>
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
677
|
+
:description => <<~DESC
|
678
|
+
Obfuscation level for SQL queries reported in transaction trace nodes.
|
679
|
+
\tBy default, this is set to `obfuscated`, which strips out the numeric and string literals.
|
680
|
+
\t- If you do not want the agent to capture query information, set this to `none`.
|
681
|
+
\t- If you want the agent to capture all query information in its original form, set this to `raw`.
|
682
|
+
\t- When you enable [high security mode](/docs/agents/manage-apm-agents/configuration/high-security-mode), this is automatically set to `obfuscated`.
|
683
|
+
DESC
|
684
684
|
},
|
685
685
|
|
686
686
|
:'transaction_tracer.stack_trace_threshold' => {
|
@@ -698,20 +698,6 @@ module NewRelic
|
|
698
698
|
:description => 'Specify a threshold in seconds. Transactions with a duration longer than this threshold are eligible for transaction traces. Specify a float value or the string `apdex_f`.'
|
699
699
|
},
|
700
700
|
# Error collector
|
701
|
-
:'error_collector.ignore_classes' => {
|
702
|
-
:default => ['ActionController::RoutingError', 'Sinatra::NotFound'],
|
703
|
-
:public => true,
|
704
|
-
:type => Array,
|
705
|
-
:allowed_from_server => true,
|
706
|
-
:dynamic_name => true,
|
707
|
-
:description => <<~DESCRIPTION
|
708
|
-
A list of error classes that the agent should ignore.
|
709
|
-
|
710
|
-
<Callout variant="caution">
|
711
|
-
This option can't be set via environment variable.
|
712
|
-
</Callout>
|
713
|
-
DESCRIPTION
|
714
|
-
},
|
715
701
|
:'error_collector.capture_events' => {
|
716
702
|
:default => value_of(:'error_collector.enabled'),
|
717
703
|
:documentation_default => true,
|
@@ -736,10 +722,9 @@ module NewRelic
|
|
736
722
|
:dynamic_name => true,
|
737
723
|
:description => <<~DESCRIPTION
|
738
724
|
A list of error classes that the agent should treat as expected.
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
</Callout>
|
725
|
+
\t<Callout variant="caution">
|
726
|
+
\t\tThis option can't be set via environment variable.
|
727
|
+
\t</Callout>
|
743
728
|
DESCRIPTION
|
744
729
|
},
|
745
730
|
:'error_collector.expected_messages' => {
|
@@ -750,10 +735,9 @@ module NewRelic
|
|
750
735
|
:dynamic_name => true,
|
751
736
|
:description => <<~DESCRIPTION
|
752
737
|
A map of error classes to a list of messages. When an error of one of the classes specified here occurs, if its error message contains one of the strings corresponding to it here, that error will be treated as expected.
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
</Callout>
|
738
|
+
\t<Callout variant="caution">
|
739
|
+
\t\tThis option can't be set via environment variable.
|
740
|
+
\t</Callout>
|
757
741
|
DESCRIPTION
|
758
742
|
},
|
759
743
|
:'error_collector.expected_status_codes' => {
|
@@ -764,19 +748,35 @@ module NewRelic
|
|
764
748
|
:dynamic_name => true,
|
765
749
|
:description => 'A comma separated list of status codes, possibly including ranges. Errors associated with these status codes, where applicable, will be treated as expected.'
|
766
750
|
},
|
767
|
-
|
751
|
+
:'error_collector.ignore_classes' => {
|
752
|
+
:default => ['ActionController::RoutingError', 'Sinatra::NotFound'],
|
753
|
+
:public => true,
|
754
|
+
:type => Array,
|
755
|
+
:allowed_from_server => true,
|
756
|
+
:dynamic_name => true,
|
757
|
+
:description => <<~DESCRIPTION
|
758
|
+
A list of error classes that the agent should ignore.
|
759
|
+
\t<Callout variant="caution">
|
760
|
+
\t\tThis option can't be set via environment variable.
|
761
|
+
\t</Callout>
|
762
|
+
DESCRIPTION
|
763
|
+
},
|
768
764
|
:'error_collector.ignore_messages' => {
|
769
|
-
|
765
|
+
# we have to keep the hash rocket in the actual default so the
|
766
|
+
# class name key is treated like a string rather than a symbol.
|
767
|
+
# however, this isn't valid yaml, so document something that is
|
768
|
+
# valid yaml
|
769
|
+
:default => {'ThreadError' => ['queue empty']},
|
770
|
+
:documentation_default => {'ThreadError': ['queue empty']},
|
770
771
|
:public => true,
|
771
772
|
:type => Hash,
|
772
773
|
:allowed_from_server => true,
|
773
774
|
:dynamic_name => true,
|
774
775
|
:description => <<~DESCRIPTION
|
775
776
|
A map of error classes to a list of messages. When an error of one of the classes specified here occurs, if its error message contains one of the strings corresponding to it here, that error will be ignored.
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
</Callout>
|
777
|
+
\t<Callout variant="caution">
|
778
|
+
\t\tThis option can't be set via environment variable.
|
779
|
+
\t</Callout>
|
780
780
|
DESCRIPTION
|
781
781
|
},
|
782
782
|
:'error_collector.ignore_status_codes' => {
|
@@ -858,19 +858,19 @@ module NewRelic
|
|
858
858
|
:description => <<~DESCRIPTION
|
859
859
|
Sets the minimum level a log event must have to be forwarded to New Relic.
|
860
860
|
|
861
|
-
|
861
|
+
\tThis is based on the integer values of [Ruby's `Logger::Severity` constants](https://github.com/ruby/logger/blob/113b82a06b3076b93a71cd467e1605b23afb3088/lib/logger/severity.rb).
|
862
862
|
|
863
|
-
|
863
|
+
\tThe intention is to forward logs with the level given to the configuration, as well as any logs with a higher level of severity.
|
864
864
|
|
865
|
-
|
865
|
+
\tFor example, setting this value to "debug" will forward all log events to New Relic. Setting this value to "error" will only forward log events with the levels "error", "fatal", and "unknown".
|
866
866
|
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
867
|
+
\tValid values (ordered lowest to highest):
|
868
|
+
\t- "debug"
|
869
|
+
\t- "info"
|
870
|
+
\t- "warn"
|
871
|
+
\t- "error"
|
872
|
+
\t- "fatal"
|
873
|
+
\t- "unknown"
|
874
874
|
DESCRIPTION
|
875
875
|
},
|
876
876
|
:'application_logging.forwarding.custom_attributes' => {
|
@@ -1153,7 +1153,7 @@ module NewRelic
|
|
1153
1153
|
:public => true,
|
1154
1154
|
:type => Boolean,
|
1155
1155
|
:allowed_from_server => true,
|
1156
|
-
:description => "If `true`, the agent will report source code level metrics for traced methods.\
|
1156
|
+
:description => "If `true`, the agent will report source code level metrics for traced methods.\n\tSee: " \
|
1157
1157
|
'https://docs.newrelic.com/docs/apm/agents/ruby-agent/features/ruby-codestream-integration/'
|
1158
1158
|
},
|
1159
1159
|
# Cross application tracer
|
@@ -1165,7 +1165,7 @@ module NewRelic
|
|
1165
1165
|
:deprecated => true,
|
1166
1166
|
:description => deprecated_description(
|
1167
1167
|
:'distributed_tracing.enabled',
|
1168
|
-
'If `true`, enables [cross-application tracing](/docs/agents/ruby-agent/features/cross-application-tracing-ruby/) when `distributed_tracing.enabled` is set to `false`.'
|
1168
|
+
' If `true`, enables [cross-application tracing](/docs/agents/ruby-agent/features/cross-application-tracing-ruby/) when `distributed_tracing.enabled` is set to `false`.'
|
1169
1169
|
)
|
1170
1170
|
},
|
1171
1171
|
# Custom attributes
|
@@ -1185,45 +1185,45 @@ module NewRelic
|
|
1185
1185
|
:description => <<~DESCRIPTION
|
1186
1186
|
An array of `CLASS#METHOD` (for instance methods) and/or `CLASS.METHOD` (for class methods) strings representing Ruby methods that the agent can automatically add custom instrumentation to. This doesn't require any modifications of the source code that defines the methods.
|
1187
1187
|
|
1188
|
-
|
1188
|
+
\tUse fully qualified class names (using the `::` delimiter) that include any module or class namespacing.
|
1189
1189
|
|
1190
|
-
|
1190
|
+
\tHere is some Ruby source code that defines a `render_png` instance method for an `Image` class and a `notify` class method for a `User` class, both within a `MyCompany` module namespace:
|
1191
1191
|
|
1192
|
-
```rb
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1192
|
+
\t```rb
|
1193
|
+
\t\tmodule MyCompany
|
1194
|
+
\t\t\tclass Image
|
1195
|
+
\t\t\t\tdef render_png
|
1196
|
+
\t\t\t\t\t# code to render a PNG
|
1197
|
+
\t\t\t\tend
|
1198
|
+
\t\t\tend
|
1199
1199
|
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
```
|
1200
|
+
\t\t\tclass User
|
1201
|
+
\t\t\t\tdef self.notify
|
1202
|
+
\t\t\t\t\t# code to notify users
|
1203
|
+
\t\t\t\tend
|
1204
|
+
\t\t\tend
|
1205
|
+
\t\tend
|
1206
|
+
\t```
|
1207
1207
|
|
1208
|
-
|
1208
|
+
\tGiven that source code, the `newrelic.yml` config file might request instrumentation for both of these methods like so:
|
1209
1209
|
|
1210
|
-
```yaml
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
```
|
1210
|
+
\t```yaml
|
1211
|
+
\t\tautomatic_custom_instrumentation_method_list:
|
1212
|
+
\t\t\t- MyCompany::Image#render_png
|
1213
|
+
\t\t\t- MyCompany::User.notify
|
1214
|
+
\t```
|
1215
1215
|
|
1216
|
-
|
1216
|
+
\tThat configuration example uses YAML array syntax to specify both methods. Alternatively, you can use a comma-delimited string:
|
1217
1217
|
|
1218
|
-
```yaml
|
1219
|
-
|
1220
|
-
```
|
1218
|
+
\t```yaml
|
1219
|
+
\t\tautomatic_custom_instrumentation_method_list: 'MyCompany::Image#render_png, MyCompany::User.notify'
|
1220
|
+
\t```
|
1221
1221
|
|
1222
|
-
|
1222
|
+
\tWhitespace around the comma(s) in the list is optional. When configuring the agent with a list of methods via the `NEW_RELIC_AUTOMATIC_CUSTOM_INSTRUMENTATION_METHOD_LIST` environment variable, use this comma-delimited string format:
|
1223
1223
|
|
1224
|
-
```sh
|
1225
|
-
|
1226
|
-
```
|
1224
|
+
\t```sh
|
1225
|
+
\t\texport NEW_RELIC_AUTOMATIC_CUSTOM_INSTRUMENTATION_METHOD_LIST='MyCompany::Image#render_png, MyCompany::User.notify'
|
1226
|
+
\t```
|
1227
1227
|
DESCRIPTION
|
1228
1228
|
},
|
1229
1229
|
# Custom events
|
@@ -1242,8 +1242,8 @@ module NewRelic
|
|
1242
1242
|
:dynamic_name => true,
|
1243
1243
|
# Keep the extra two-space indent before the second bullet to appease translation tool
|
1244
1244
|
:description => <<~DESC
|
1245
|
-
|
1246
|
-
|
1245
|
+
- Specify a maximum number of custom events to buffer in memory at a time.
|
1246
|
+
- When configuring the agent for [AI monitoring](/docs/ai-monitoring/intro-to-ai-monitoring), \
|
1247
1247
|
set to max value `100000`. This ensures the agent captures the maximum amount of LLM events.
|
1248
1248
|
DESC
|
1249
1249
|
},
|
@@ -1385,9 +1385,9 @@ module NewRelic
|
|
1385
1385
|
:description => <<~DESCRIPTION
|
1386
1386
|
If `true`, the agent won't wrap third-party middlewares in instrumentation (regardless of whether they are installed via `Rack::Builder` or Rails).
|
1387
1387
|
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1388
|
+
<Callout variant="important">
|
1389
|
+
When middleware instrumentation is disabled, if an application is using middleware that could alter the response code, the HTTP status code reported on the transaction may not reflect the altered value.
|
1390
|
+
</Callout>
|
1391
1391
|
DESCRIPTION
|
1392
1392
|
},
|
1393
1393
|
:disable_samplers => {
|
@@ -1426,20 +1426,18 @@ module NewRelic
|
|
1426
1426
|
:description => <<~DESCRIPTION
|
1427
1427
|
If `true`, disables agent middleware for Sinatra. This middleware is responsible for advanced feature support such as [cross application tracing](/docs/apm/transactions/cross-application-traces/cross-application-tracing), [page load timing](/docs/browser/new-relic-browser/getting-started/new-relic-browser), and [error collection](/docs/apm/applications-menu/events/view-apm-error-analytics).
|
1428
1428
|
|
1429
|
-
|
1430
|
-
|
1429
|
+
\t<Callout variant="important">
|
1430
|
+
\t\tCross application tracing is deprecated in favor of [distributed tracing](/docs/apm/distributed-tracing/getting-started/introduction-distributed-tracing). Distributed tracing is on by default for Ruby agent versions 8.0.0 and above. Middlewares are not required to support distributed tracing.
|
1431
1431
|
|
1432
|
-
|
1432
|
+
\t\tTo continue using cross application tracing, update the following options in your `newrelic.yml` configuration file:
|
1433
1433
|
|
1434
|
-
|
1435
|
-
|
1436
|
-
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1440
|
-
|
1441
|
-
```
|
1442
|
-
</Callout>
|
1434
|
+
\t\t```yaml
|
1435
|
+
\t\t\tcross_application_tracer:
|
1436
|
+
\t\t\t\tenabled: true
|
1437
|
+
\t\t\tdistributed_tracing:
|
1438
|
+
\t\t\t\tenabled: false
|
1439
|
+
\t\t```
|
1440
|
+
\t</Callout>
|
1443
1441
|
DESCRIPTION
|
1444
1442
|
},
|
1445
1443
|
:disable_view_instrumentation => {
|
@@ -1465,7 +1463,28 @@ module NewRelic
|
|
1465
1463
|
:allowed_from_server => true,
|
1466
1464
|
:description => 'Distributed tracing lets you see the path that a request takes through your distributed system. Enabling distributed tracing changes the behavior of some New Relic features, so carefully consult the [transition guide](/docs/transition-guide-distributed-tracing) before you enable this feature.'
|
1467
1465
|
},
|
1466
|
+
:'distributed_tracing.sampler.remote_parent_sampled' => {
|
1467
|
+
:default => 'default',
|
1468
|
+
:public => true,
|
1469
|
+
:type => String,
|
1470
|
+
:allowed_from_server => true,
|
1471
|
+
:description => 'This setting controls the behavior of transaction sampling when a remote parent is sampled and the trace flag is set in the traceparent. Available values are `default`, `always_on`, and `always_off`.'
|
1472
|
+
},
|
1473
|
+
:'distributed_tracing.sampler.remote_parent_not_sampled' => {
|
1474
|
+
:default => 'default',
|
1475
|
+
:public => true,
|
1476
|
+
:type => String,
|
1477
|
+
:allowed_from_server => true,
|
1478
|
+
:description => 'This setting controls the behavior of transaction sampling when a remote parent is not sampled and the trace flag is not set in the traceparent. Available values are `default`, `always_on`, and `always_off`.'
|
1479
|
+
},
|
1468
1480
|
# Elasticsearch
|
1481
|
+
:'elasticsearch.capture_cluster_name' => {
|
1482
|
+
:default => true,
|
1483
|
+
:public => true,
|
1484
|
+
:type => Boolean,
|
1485
|
+
:allowed_from_server => true,
|
1486
|
+
:description => 'If `true`, the agent captures the Elasticsearch cluster name in transaction traces.'
|
1487
|
+
},
|
1469
1488
|
:'elasticsearch.capture_queries' => {
|
1470
1489
|
:default => true,
|
1471
1490
|
:public => true,
|
@@ -1942,10 +1961,10 @@ module NewRelic
|
|
1942
1961
|
:transform => DefaultSource.method(:convert_to_list),
|
1943
1962
|
:description => <<~DESCRIPTION
|
1944
1963
|
An array of strings to specify which keys and/or values inside a Stripe event's `user_data` hash should
|
1945
|
-
|
1946
|
-
`Regexp.new` to permit advanced matching. For each hash pair, if either the key or value is matched the pair
|
1947
|
-
|
1948
|
-
`stripe.user_data.include` option is also used.
|
1964
|
+
\tnot be reported to New Relic. Each string in this array will be turned into a regular expression via
|
1965
|
+
\t`Regexp.new` to permit advanced matching. For each hash pair, if either the key or value is matched the pair
|
1966
|
+
\tisn't reported. By default, no `user_data` is reported. Use this option only if the
|
1967
|
+
\t`stripe.user_data.include` option is also used.
|
1949
1968
|
DESCRIPTION
|
1950
1969
|
},
|
1951
1970
|
:'instrumentation.thread' => {
|
@@ -2046,7 +2065,7 @@ module NewRelic
|
|
2046
2065
|
If `true`, when the agent is in an application using Ruby on Rails, it will start after `config/initializers` run.
|
2047
2066
|
|
2048
2067
|
<Callout variant="caution">
|
2049
|
-
|
2068
|
+
\tThis option may only be set by environment variable.
|
2050
2069
|
</Callout>
|
2051
2070
|
DESCRIPTION
|
2052
2071
|
},
|
@@ -2184,8 +2203,8 @@ module NewRelic
|
|
2184
2203
|
:allowed_from_server => true,
|
2185
2204
|
# Keep the extra two-space indent before the second bullet to appease translation tool
|
2186
2205
|
:description => <<~DESC
|
2187
|
-
|
2188
|
-
|
2206
|
+
- Defines the maximum number of span events reported from a single harvest. Any Integer between `1` and `10000` is valid.'
|
2207
|
+
- When configuring the agent for [AI monitoring](/docs/ai-monitoring/intro-to-ai-monitoring), set to max value `10000`.\
|
2189
2208
|
This ensures the agent captures the maximum amount of distributed traces.
|
2190
2209
|
DESC
|
2191
2210
|
},
|
@@ -2490,6 +2509,14 @@ module NewRelic
|
|
2490
2509
|
:allowed_from_server => true,
|
2491
2510
|
:description => 'Number of seconds betwixt connections to the New Relic span event collection services.'
|
2492
2511
|
},
|
2512
|
+
# TODO: Sync with the other agents to see what the config should be named, how it should be enabled, how it should be described
|
2513
|
+
:'opentelemetry_bridge.enabled' => {
|
2514
|
+
:default => false,
|
2515
|
+
:public => false,
|
2516
|
+
:type => Boolean,
|
2517
|
+
:allowed_from_server => false,
|
2518
|
+
:description => 'Enables the creation of Transaction Trace segments and timeslice metrics from OpenTelemetry Spans. This will help drive New Relic UI experience for opentelemetry spans. **WARNING**: This is not feature complete and is not intended to be enabled yet.'
|
2519
|
+
},
|
2493
2520
|
:force_reconnect => {
|
2494
2521
|
:default => false,
|
2495
2522
|
:public => false,
|
@@ -2528,11 +2555,9 @@ module NewRelic
|
|
2528
2555
|
:allowlist => %i[none low medium high],
|
2529
2556
|
:external => :infinite_tracing,
|
2530
2557
|
:description => <<~DESC
|
2531
|
-
Configure the compression level for data sent to the trace observer.
|
2532
|
-
|
2533
|
-
|
2534
|
-
|
2535
|
-
Set the level to `:none` to disable compression.
|
2558
|
+
Configure the compression level for data sent to the trace observer. \
|
2559
|
+
May be one of: `:none`, `:low`, `:medium`, `:high`. \
|
2560
|
+
Set the level to `:none` to disable compression.
|
2536
2561
|
DESC
|
2537
2562
|
},
|
2538
2563
|
:js_agent_file => {
|
@@ -382,6 +382,7 @@ module NewRelic
|
|
382
382
|
@security_policy_source = nil
|
383
383
|
@high_security_source = nil
|
384
384
|
@environment_source = EnvironmentSource.new
|
385
|
+
log_config(:add, @environment_source) # this is the only place the EnvironmentSource is ever created, so we should log it
|
385
386
|
@server_source = nil
|
386
387
|
@manual_source = nil
|
387
388
|
@yaml_source = nil
|
@@ -424,8 +425,10 @@ module NewRelic
|
|
424
425
|
# actually going to be logging the message based on our current log
|
425
426
|
# level, so use a `do` block.
|
426
427
|
NewRelic::Agent.logger.debug do
|
427
|
-
|
428
|
-
|
428
|
+
source_hash = source.dup.to_h.delete_if { |k, _v| DEFAULTS.fetch(k, {}).fetch(:exclude_from_reported_settings, false) }
|
429
|
+
final_hash = flattened.delete_if { |k, _h| DEFAULTS.fetch(k, {}).fetch(:exclude_from_reported_settings, false) }
|
430
|
+
|
431
|
+
"Updating config (#{direction}) from #{source.class} with values: #{source_hash}. \nConfig Stack Results: #{final_hash.inspect}"
|
429
432
|
end
|
430
433
|
end
|
431
434
|
|
@@ -36,7 +36,7 @@ module NewRelic
|
|
36
36
|
erb_file = process_erb(raw_file)
|
37
37
|
config = process_yaml(erb_file, env, config, @file_path)
|
38
38
|
rescue ScriptError, StandardError => e
|
39
|
-
NewRelic::Agent.agent
|
39
|
+
NewRelic::Agent.agent&.health_check&.update_status(NewRelic::Agent::HealthCheck::FAILED_TO_PARSE_CONFIG)
|
40
40
|
log_failure("Failed to read or parse configuration file at #{path}", e)
|
41
41
|
end
|
42
42
|
|
@@ -67,7 +67,7 @@ module NewRelic
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def warn_missing_config_file(path)
|
70
|
-
based_on =
|
70
|
+
based_on = NewRelic::UNKNOWN_LOWER
|
71
71
|
source = ::NewRelic::Agent.config.source(:config_path)
|
72
72
|
candidate_paths = [path]
|
73
73
|
|
@@ -100,10 +100,10 @@ module NewRelic
|
|
100
100
|
file.gsub!(/^\s*#.*$/, '#')
|
101
101
|
ERB.new(file).result(binding)
|
102
102
|
rescue ScriptError, StandardError => e
|
103
|
-
NewRelic::Agent.agent
|
103
|
+
NewRelic::Agent.agent&.health_check&.update_status(NewRelic::Agent::HealthCheck::FAILED_TO_PARSE_CONFIG)
|
104
104
|
message = 'Failed ERB processing configuration file. This is typically caused by a Ruby error in <% %> templating blocks in your newrelic.yml file.'
|
105
105
|
failure_array = [message, e]
|
106
|
-
failure_array << e.backtrace[0] if
|
106
|
+
failure_array << e.backtrace[0] if NewRelic::Helper.version_satisfied?(RUBY_VERSION, '>=', '3.4.0')
|
107
107
|
log_failure(*failure_array)
|
108
108
|
nil
|
109
109
|
end
|
@@ -123,7 +123,7 @@ module NewRelic
|
|
123
123
|
return @supports_with_connection if defined?(@supports_with_connection)
|
124
124
|
|
125
125
|
@supports_with_connection = defined?(::ActiveRecord::VERSION::STRING) &&
|
126
|
-
|
126
|
+
NewRelic::Helper.version_satisfied?(ActiveRecord::VERSION::STRING, '>=', '7.2.0')
|
127
127
|
end
|
128
128
|
|
129
129
|
def close_connections
|
@@ -25,7 +25,7 @@ module NewRelic
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def value
|
28
|
-
match = VERSIONS.keys.find { |key| version >=
|
28
|
+
match = VERSIONS.keys.find { |key| NewRelic::Helper.version_satisfied?(version, '>=', key) }
|
29
29
|
return unless match
|
30
30
|
|
31
31
|
VERSIONS[match].call(env)
|
@@ -39,6 +39,7 @@ module NewRelic
|
|
39
39
|
# @return {Transaction} The transaction the headers were inserted from,
|
40
40
|
# or +nil+ if headers were not inserted.
|
41
41
|
#
|
42
|
+
# @!scope class
|
42
43
|
# @api public
|
43
44
|
#
|
44
45
|
def insert_distributed_trace_headers(headers = {})
|
@@ -93,6 +94,7 @@ module NewRelic
|
|
93
94
|
#
|
94
95
|
# @return {Transaction} if successful, +nil+ otherwise
|
95
96
|
#
|
97
|
+
# @!scope class
|
96
98
|
# @api public
|
97
99
|
#
|
98
100
|
def accept_distributed_trace_headers(headers, transport_type = NewRelic::HTTP)
|
@@ -29,6 +29,7 @@ module NewRelic
|
|
29
29
|
#
|
30
30
|
# @param request_metadata [String] received obfuscated request metadata
|
31
31
|
#
|
32
|
+
# @!scope class
|
32
33
|
# @api public
|
33
34
|
#
|
34
35
|
def process_request_metadata(request_metadata)
|
@@ -74,6 +75,7 @@ module NewRelic
|
|
74
75
|
#
|
75
76
|
# @return [String] obfuscated response metadata to send
|
76
77
|
#
|
78
|
+
# @!scope class
|
77
79
|
# @api public
|
78
80
|
#
|
79
81
|
def get_response_metadata
|
@@ -16,7 +16,7 @@ DependencyDetection.defer do
|
|
16
16
|
defined?(ActionDispatch) &&
|
17
17
|
defined?(ActionPack) &&
|
18
18
|
ActionPack.respond_to?(:gem_version) &&
|
19
|
-
ActionPack.gem_version >=
|
19
|
+
NewRelic::Helper.version_satisfied?(ActionPack.gem_version, '>=', '6.0.0') && # notifications for dispatch added in Rails 6
|
20
20
|
!NewRelic::Agent::Instrumentation::ActionDispatchSubscriber.subscribed?
|
21
21
|
end
|
22
22
|
|
@@ -15,7 +15,7 @@ DependencyDetection.defer do
|
|
15
15
|
defined?(ActiveSupport) &&
|
16
16
|
defined?(ActionMailbox) &&
|
17
17
|
ActionMailbox.respond_to?(:gem_version) && # 'require "action_mailbox"' doesn't require version...
|
18
|
-
ActionMailbox.gem_version >=
|
18
|
+
NewRelic::Helper.version_satisfied?(ActionMailbox.gem_version, '>=', '7.1.0.alpha') && # notifications added in Rails 7.1
|
19
19
|
!NewRelic::Agent::Instrumentation::ActionMailboxSubscriber.subscribed?
|
20
20
|
end
|
21
21
|
|
@@ -15,7 +15,7 @@ DependencyDetection.defer do
|
|
15
15
|
defined?(ActiveSupport) &&
|
16
16
|
defined?(ActionMailer) &&
|
17
17
|
ActionMailer.respond_to?(:gem_version) &&
|
18
|
-
ActionMailer.gem_version >=
|
18
|
+
NewRelic::Helper.version_satisfied?(ActionMailer.gem_version, '>=', '5.0') &&
|
19
19
|
!NewRelic::Agent::Instrumentation::ActionMailerSubscriber.subscribed?
|
20
20
|
end
|
21
21
|
|
@@ -30,7 +30,7 @@ DependencyDetection.defer do
|
|
30
30
|
executes do
|
31
31
|
if defined?(ActiveSupport) &&
|
32
32
|
ActiveJob.respond_to?(:gem_version) &&
|
33
|
-
ActiveJob.gem_version >=
|
33
|
+
NewRelic::Helper.version_satisfied?(ActiveJob.gem_version, '>=', '6.0.0') &&
|
34
34
|
!NewRelic::Agent.config[:disable_activejob] &&
|
35
35
|
!NewRelic::Agent::Instrumentation::ActiveJobSubscriber.subscribed?
|
36
36
|
NewRelic::Agent.logger.info('Installing notifications based ActiveJob instrumentation')
|