newrelic_rpm 9.2.1 → 9.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.build_ignore +21 -0
- data/CHANGELOG.md +65 -2
- data/README.md +4 -4
- data/lib/new_relic/agent/configuration/default_source.rb +77 -29
- data/lib/new_relic/agent/configuration/manager.rb +3 -2
- data/lib/new_relic/agent/configuration/yaml_source.rb +13 -0
- data/lib/new_relic/agent/instrumentation/active_record.rb +1 -1
- data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +2 -1
- data/lib/new_relic/agent/instrumentation/concurrent_ruby/chain.rb +1 -1
- data/lib/new_relic/agent/instrumentation/concurrent_ruby/instrumentation.rb +1 -2
- data/lib/new_relic/agent/instrumentation/concurrent_ruby/prepend.rb +1 -1
- data/lib/new_relic/agent/instrumentation/fiber/chain.rb +10 -3
- data/lib/new_relic/agent/instrumentation/fiber/instrumentation.rb +1 -2
- data/lib/new_relic/agent/instrumentation/fiber/prepend.rb +10 -3
- data/lib/new_relic/agent/instrumentation/memcache/instrumentation.rb +3 -3
- data/lib/new_relic/agent/instrumentation/rails_notifications/action_cable.rb +1 -1
- data/lib/new_relic/agent/instrumentation/thread/chain.rb +1 -1
- data/lib/new_relic/agent/instrumentation/thread/instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/thread/prepend.rb +1 -1
- data/lib/new_relic/agent/log_event_aggregator.rb +49 -2
- data/lib/new_relic/agent/log_event_attributes.rb +115 -0
- data/lib/new_relic/agent/logging.rb +4 -4
- data/lib/new_relic/agent/method_tracer_helpers.rb +26 -5
- data/lib/new_relic/agent/tracer.rb +2 -2
- data/lib/new_relic/agent/transaction.rb +1 -1
- data/lib/new_relic/agent.rb +37 -0
- data/lib/new_relic/dependency_detection.rb +6 -0
- data/lib/new_relic/latest_changes.rb +1 -1
- data/lib/new_relic/supportability_helper.rb +1 -0
- data/lib/new_relic/traced_thread.rb +2 -3
- data/lib/new_relic/version.rb +2 -2
- data/lib/sequel/extensions/new_relic_instrumentation.rb +1 -1
- data/lib/tasks/bump_version.rake +21 -0
- data/lib/tasks/helpers/newrelicyml.rb +144 -0
- data/lib/tasks/helpers/version_bump.rb +62 -0
- data/lib/tasks/multiverse.rb +0 -8
- data/lib/tasks/newrelicyml.rake +13 -0
- data/newrelic.yml +307 -266
- data/newrelic_rpm.gemspec +5 -4
- metadata +12 -22
- data/.gitignore +0 -43
- data/.project +0 -23
- data/.rubocop.yml +0 -1845
- data/.rubocop_todo.yml +0 -61
- data/.simplecov +0 -16
- data/.snyk +0 -11
- data/.yardopts +0 -27
- data/Brewfile +0 -13
- data/DOCKER.md +0 -167
- data/Dockerfile +0 -10
- data/Guardfile +0 -27
- data/config/database.yml +0 -5
- data/config.dot +0 -278
- data/docker-compose.yml +0 -107
- data/lefthook.yml +0 -9
- data/test/agent_helper.rb +0 -1027
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4538568787069b9254f2ae6e51761daba690c0936a62bd725503df73a807c225
|
4
|
+
data.tar.gz: c413c62d9b122964b48631be9a5cf240200dad7ee44a84b1d92a76f0f0bf52e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 351addff95df2919f155541fcb1b74a17d98f04c1ac1527383c969e38c50480a169e41ddaf725a31624f38517e7cdf1e2d172f10da6ca3ace290a757810df34d
|
7
|
+
data.tar.gz: 9e1da523b1fc5aad52e1ceda6f5afd780fcf104bf5a06db370ba21364fa10d115371e876a994fd7c445ca5ccb5c56447b84a39ba472991afc9bee5c083a43f47
|
data/.build_ignore
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
.github
|
2
|
+
.gitignore
|
3
|
+
.project
|
4
|
+
.rubocop.yml
|
5
|
+
.rubocop_todo.yml
|
6
|
+
.simplecov
|
7
|
+
.snyk
|
8
|
+
.yardopts
|
9
|
+
Brewfile
|
10
|
+
CONTRIBUTING.md
|
11
|
+
Dockerfile
|
12
|
+
DOCKER.md
|
13
|
+
docker-compose.yml
|
14
|
+
config/
|
15
|
+
config.dot
|
16
|
+
infinite_tracing/
|
17
|
+
Guardfile
|
18
|
+
lefthook.yml
|
19
|
+
log/
|
20
|
+
README.md
|
21
|
+
test/
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,68 @@
|
|
1
1
|
# New Relic Ruby Agent Release Notes
|
2
2
|
|
3
|
+
## v9.3.0
|
4
|
+
|
5
|
+
Version 9.3.0 of the agent adds log-level filtering, adds custom attributes for log events, and updates instrumentation for Action Cable. It also provides fixes for how `Fiber` args are treated, Code-Level Metrics, unnecessary files being included in the gem, and `NewRelic::Agent::Logging::DecoratingFormatter#clear_tags!` being incorrectly private.
|
6
|
+
|
7
|
+
- **Feature: Filter forwarded logs based on level**
|
8
|
+
|
9
|
+
Previously, all log events, regardless of their level, were forwarded to New Relic when log forwarding was enabled. Now, you may specify the lowest log level you'd like forwarded to New Relic.
|
10
|
+
|
11
|
+
| Configuration name | Default | Behavior | Valid values |
|
12
|
+
| --------------------------- | ------- | ------------------------------------------------------ | ------ |
|
13
|
+
| `application_logging.forwarding.log_level` | `debug` | Sets the minimum log level for events forwarded to New Relic | `debug`, `info`, `warn`, `error`, `fatal`, `unknown` |
|
14
|
+
|
15
|
+
This setting uses [Ruby's Logger::Severity constants integer values](https://github.com/ruby/ruby/blob/master/lib/logger/severity.rb#L6-L17) to determine precedence.
|
16
|
+
|
17
|
+
- **Feature: Custom attributes for logs**
|
18
|
+
|
19
|
+
You can now add custom attributes to log events forwarded to New Relic! You can pass these attributes using an API and/or a configuration option.
|
20
|
+
|
21
|
+
| Configuration name | Default | Behavior |
|
22
|
+
| --------------------------- | ------- | ------------------------------------------------------ |
|
23
|
+
| `application_logging.forwarding.custom_attributes` | `{}` | A hash with key/value pairs to add as custom attributes to all log events forwarded to New Relic. If sending using an environment variable, the value must be formatted like: "key1=value1,key2=value2" |
|
24
|
+
|
25
|
+
|
26
|
+
Call the API using `NewRelic::Agent.add_custom_log_attributes` and passing your attributes as a hash. For example, you could call: `NewRelic::Agent.add_custom_log_attributes(dyno: ENV['DYNO'], pod_name: ENV['POD_NAME'])`, to add the attributes `dyno` and `pod_name` to your log events.
|
27
|
+
|
28
|
+
Attributes passed to the API or the configuration will be added to all log events.
|
29
|
+
|
30
|
+
Thanks to [@rajpawar02](https://github.com/rajpawar02) for raising this issue and [@askreet](https://github.com/askreet) for helping us with the solution. [Issue#1141](https://github.com/newrelic/newrelic-ruby-agent/issues/1141), [PR#2084](https://github.com/newrelic/newrelic-ruby-agent/pull/2084), [PR#2087](https://github.com/newrelic/newrelic-ruby-agent/pull/2087)
|
31
|
+
|
32
|
+
- **Feature: Instrument transmit_subscription-related Action Cable actions**
|
33
|
+
|
34
|
+
This change subscribes the agent to the Active Support notifications for:
|
35
|
+
* `transmit_subscription_confirmation.action_cable`
|
36
|
+
* `transmit_subscription_rejection.action_cable`
|
37
|
+
|
38
|
+
- **Bugfix: Removed unwanted files from being included in file_list in gemspec**
|
39
|
+
|
40
|
+
Previously, the agent was including some files in the gem that were not needed but added to the size of the gem. These files will no longer be included. Thanks to [@manuraj17](https://github.com/manuraj17) for the contribution! [PR#2089](https://github.com/newrelic/newrelic-ruby-agent/pull/2089)
|
41
|
+
|
42
|
+
- **Bugfix: Report Code-Level Metrics for Rails controller methods**
|
43
|
+
|
44
|
+
Controllers in Rails automatically render views with names that correspond to valid routes. This means that a controller method may not have a corresponding method in the controller class. Code-Level Metrics now report on these methods and don't log false warnings. Thanks to [@jcrisp](https://github.com/jcrisp) for reporting this issue. [PR#2061](https://github.com/newrelic/newrelic-ruby-agent/pull/2061)
|
45
|
+
|
46
|
+
- **Bugfix: Code-Level Metrics for ActiveRecord models**
|
47
|
+
|
48
|
+
Classes that inherit from ActiveRecord were not reporting Code-Level Metrics due to an error in the agent when identifying the class name. This has been fixed and Code-Level Metrics will now report for ActiveRecord models. Thanks to [@abigail-rolling](https://github.com/abigail-rolling) for reporting this issue. [PR#2092](https://github.com/newrelic/newrelic-ruby-agent/pull/2092).
|
49
|
+
|
50
|
+
- **Bugfix: Private method `clear_tags!` for NewRelic::Agent::Logging::DecoratingFormatter**
|
51
|
+
|
52
|
+
As part of a refactor included in a previous release of the agent, the method `NewRelic::Agent::Logging::DecoratingFormatter#clear_tags!` was incorrectly made private. This method is now public again. Thanks to [@dark-panda](https://github.com/dark-panda) for reporting this issue. [PR#](https://github.com/newrelic/newrelic-ruby-agent/pull/2078)
|
53
|
+
|
54
|
+
- **Bugfix: Fix the way args are handled for Fibers**
|
55
|
+
|
56
|
+
Previously, the agent treated Fiber args the same as it was treating Thread args, which is not correct. Args are passed to `Fiber#resume`, and not `Fiber.new`. This has been fixed, and the agent will properly preserve args for both Fiber and Thread classes. This also caused an error to occur when using Async 2.6.2, due to mismatching initalize definitions for Fiber prepended modules. This has been fixed as well. Thanks to [@travisbell](https://github.com/travisbell) for bringing this to our attention. [PR#2083](https://github.com/newrelic/newrelic-ruby-agent/pull/2083)
|
57
|
+
|
58
|
+
## v9.2.2
|
59
|
+
|
60
|
+
Version 9.2.2 of the agent fixes a bug with the `Transaction#finished?` method.
|
61
|
+
|
62
|
+
- **Bugfix: Transaction#finished? no longer throws a NoMethodError when initial_segment is nil**
|
63
|
+
|
64
|
+
This change adds a safe navigation operator to `Transaction#finished?` to prevent `NoMethodErrors` when a transaction does not have any segments. Our thanks goes to [@JulienDefrance](https://github.com/JulienDefrance) for reporting this issue. [PR#1983](https://github.com/newrelic/newrelic-ruby-agent/pull/1983)
|
65
|
+
|
3
66
|
## v9.2.1
|
4
67
|
|
5
68
|
Version 9.2.1 fixes a bug causing the agent to continue storing data on finished transactions, and a bug preventing errors from being expected.
|
@@ -21,8 +84,8 @@
|
|
21
84
|
|
22
85
|
- **Feature: Enhance performance for handling high numbers of nested actions**
|
23
86
|
|
24
|
-
With [Issue#1910](https://github.com/newrelic/newrelic-ruby-agent/issues/1910) community members [@parkerfinch](https://github.com/parkerfinch) and [@travisbell](https://github.com/travisbell) informed us of some CPU spikes and process hangs seen only when using the agent's thread instrumentation, which was enabled by default with v9.0. When thread instrumentation is enabled, instrumented actions taking place within threads are seen and reported on by the agent whereas they would have previously gone unnoticed. This is a great improvement to the agent's usefulness in an async context, and also makes it easier for higher numbers of nested actions to be observed.
|
25
|
-
For example, if an instrumented background job framework (Sidekiq, Resque) kicks off a job that the agent notices and then that job in turn performs actions such as database queries that the agent also instruments, nested actions are seen. However, with very high (10,000+) numbers of actions nested within a single instrumented outer action, the agent would struggle to efficiently crunch through all of the collected data at the time when the outer action finished.
|
87
|
+
With [Issue#1910](https://github.com/newrelic/newrelic-ruby-agent/issues/1910) community members [@parkerfinch](https://github.com/parkerfinch) and [@travisbell](https://github.com/travisbell) informed us of some CPU spikes and process hangs seen only when using the agent's thread instrumentation, which was enabled by default with v9.0. When thread instrumentation is enabled, instrumented actions taking place within threads are seen and reported on by the agent whereas they would have previously gone unnoticed. This is a great improvement to the agent's usefulness in an async context, and also makes it easier for higher numbers of nested actions to be observed.
|
88
|
+
For example, if an instrumented background job framework (Sidekiq, Resque) kicks off a job that the agent notices and then that job in turn performs actions such as database queries that the agent also instruments, nested actions are seen. However, with very high (10,000+) numbers of actions nested within a single instrumented outer action, the agent would struggle to efficiently crunch through all of the collected data at the time when the outer action finished.
|
26
89
|
The agent should now be much more efficient when any observed action with lots of nested actions is finished. Our performance testing was conducted with hundreds of thousands of nested actions taking place, and we hope that the benefits of thread tracing can now be enjoyed without any drawbacks. Thanks very much [@parkerfinch](https://github.com/parkerfinch) and [@travisbell](https://github.com/travisbell)! [PR#1927](https://github.com/newrelic/newrelic-ruby-agent/pull/1927)
|
27
90
|
|
28
91
|
- **Feature: The agent configuration will now reflect whether module prepending or method chaining was used for instrumentation**
|
data/README.md
CHANGED
@@ -9,7 +9,7 @@ You can also extend the agent's performance monitoring to
|
|
9
9
|
to help you improve the customer experience and make data-driven business decisions.
|
10
10
|
|
11
11
|
The New Relic Ruby agent is dual-purposed as either a Gem or a Rails plugin,
|
12
|
-
hosted on [
|
12
|
+
hosted on [GitHub](https://github.com/newrelic/newrelic-ruby-agent).
|
13
13
|
|
14
14
|
This code is actively maintained by New Relic engineering teams and delivered here in GitHub. See below for troubleshooting and defect reporting instructions.
|
15
15
|
|
@@ -25,7 +25,7 @@ Environments" section below.
|
|
25
25
|
|
26
26
|
## Installing and Using
|
27
27
|
|
28
|
-
The latest released gem for the Ruby agent can be found at [
|
28
|
+
The latest released gem for the Ruby agent can be found at [RubyGems.org](https://rubygems.org/gems/newrelic_rpm)
|
29
29
|
|
30
30
|
### Quick Start
|
31
31
|
|
@@ -88,7 +88,7 @@ for more information.
|
|
88
88
|
|
89
89
|
Should you need assistance with New Relic products, you are in good hands with several support diagnostic tools and support channels.
|
90
90
|
|
91
|
-
This [troubleshooting framework](https://
|
91
|
+
This [troubleshooting framework](https://forum.newrelic.com/s/hubtopic/aAX8W0000008bSgWAI/ruby-troubleshooting-framework-install) steps you through common troubleshooting questions.
|
92
92
|
|
93
93
|
New Relic offers NRDiag, [a client-side diagnostic utility](https://docs.newrelic.com/docs/using-new-relic/cross-product-functions/troubleshooting/new-relic-diagnostics) that automatically detects common problems with New Relic agents. If NRDiag detects a problem, it suggests troubleshooting steps. NRDiag can also automatically attach troubleshooting data to a New Relic Support ticket.
|
94
94
|
|
@@ -97,7 +97,7 @@ If the issue has been confirmed as a bug or is a Feature request, please file a
|
|
97
97
|
**Support Channels**
|
98
98
|
|
99
99
|
* [New Relic Documentation](https://docs.newrelic.com/docs/agents/ruby-agent): Comprehensive guidance for using our platform
|
100
|
-
* [New Relic Community](https://
|
100
|
+
* [New Relic Community](https://forum.newrelic.com): The best place to engage in troubleshooting questions
|
101
101
|
* [New Relic Developer](https://developer.newrelic.com/): Resources for building a custom observability applications
|
102
102
|
* [New Relic University](https://learn.newrelic.com/): A range of online training for New Relic users of every level
|
103
103
|
* [New Relic Technical Support](https://support.newrelic.com/) 24/7/365 ticketed support. Read more about our [Technical Support Offerings](https://docs.newrelic.com/docs/licenses/license-information/general-usage-licenses/support-plan).
|
@@ -211,6 +211,22 @@ module NewRelic
|
|
211
211
|
end
|
212
212
|
end
|
213
213
|
|
214
|
+
def self.convert_to_hash(value)
|
215
|
+
return value if value.is_a?(Hash)
|
216
|
+
|
217
|
+
if value.is_a?(String)
|
218
|
+
return value.split(',').each_with_object({}) do |item, hash|
|
219
|
+
key, value = item.split('=')
|
220
|
+
hash[key] = value
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
raise ArgumentError.new(
|
225
|
+
"Config value '#{value}' of " \
|
226
|
+
"class #{value.class} couldn't be turned into a Hash."
|
227
|
+
)
|
228
|
+
end
|
229
|
+
|
214
230
|
SEMICOLON = ';'.freeze
|
215
231
|
def self.convert_to_list_on_semicolon(value)
|
216
232
|
case value
|
@@ -427,7 +443,7 @@ module NewRelic
|
|
427
443
|
'Known use-case for this option is where Sinatra is running as an embedded service within another framework ' \
|
428
444
|
'and the agent is detecting the Sinatra app and skipping the `at_exit` handler as a result. Sinatra classically ' \
|
429
445
|
'runs the entire application in an `at_exit` block and would otherwise misbehave if the Agent\'s `at_exit` handler ' \
|
430
|
-
'was also installed in those circumstances.
|
446
|
+
'was also installed in those circumstances. Note: `send_data_on_exit` should also be set to `true` in tandem with this setting.'
|
431
447
|
},
|
432
448
|
:high_security => {
|
433
449
|
:default => false,
|
@@ -588,8 +604,7 @@ module NewRelic
|
|
588
604
|
|
589
605
|
- If you do not want the agent to capture query information, set this to `none`.
|
590
606
|
- If you want the agent to capture all query information in its original form, set this to `raw`.
|
591
|
-
- When you enable [high security mode](/docs/agents/manage-apm-agents/configuration/high-security-mode), this is automatically set to `obfuscated`.
|
592
|
-
'
|
607
|
+
- When you enable [high security mode](/docs/agents/manage-apm-agents/configuration/high-security-mode), this is automatically set to `obfuscated`.'
|
593
608
|
},
|
594
609
|
|
595
610
|
:'transaction_tracer.stack_trace_threshold' => {
|
@@ -749,6 +764,37 @@ module NewRelic
|
|
749
764
|
:allowed_from_server => false,
|
750
765
|
:description => 'If `true`, the agent captures log records emitted by your application.'
|
751
766
|
},
|
767
|
+
:'application_logging.forwarding.log_level' => {
|
768
|
+
:default => 'debug',
|
769
|
+
:public => true,
|
770
|
+
:type => String,
|
771
|
+
:allowed_from_server => false,
|
772
|
+
:description => <<~DESCRIPTION
|
773
|
+
Sets the minimum level a log event must have to be forwarded to New Relic.
|
774
|
+
|
775
|
+
This is based on the integer values of Ruby's `Logger::Severity` constants: https://github.com/ruby/ruby/blob/master/lib/logger/severity.rb
|
776
|
+
|
777
|
+
The intention is to forward logs with the level given to the configuration, as well as any logs with a higher level of severity.
|
778
|
+
|
779
|
+
For 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".
|
780
|
+
|
781
|
+
Valid values (ordered lowest to highest):
|
782
|
+
* "debug"
|
783
|
+
* "info"
|
784
|
+
* "warn"
|
785
|
+
* "error"
|
786
|
+
* "fatal"
|
787
|
+
* "unknown"
|
788
|
+
DESCRIPTION
|
789
|
+
},
|
790
|
+
:'application_logging.forwarding.custom_attributes' => {
|
791
|
+
:default => {},
|
792
|
+
:public => true,
|
793
|
+
:type => Hash,
|
794
|
+
:transform => DefaultSource.method(:convert_to_hash),
|
795
|
+
:allowed_from_server => false,
|
796
|
+
:description => 'A hash with key/value pairs to add as custom attributes to all log events forwarded to New Relic. If sending using an environment variable, the value must be formatted like: "key1=value1,key2=value2"'
|
797
|
+
},
|
752
798
|
:'application_logging.forwarding.max_samples_stored' => {
|
753
799
|
:default => 10000,
|
754
800
|
:public => true,
|
@@ -951,7 +997,7 @@ module NewRelic
|
|
951
997
|
},
|
952
998
|
:'audit_log.path' => {
|
953
999
|
:default => DefaultSource.audit_log_path,
|
954
|
-
:documentation_default => '
|
1000
|
+
:documentation_default => 'log/newrelic_audit.log',
|
955
1001
|
:public => true,
|
956
1002
|
:type => String,
|
957
1003
|
:allowed_from_server => false,
|
@@ -1104,11 +1150,12 @@ module NewRelic
|
|
1104
1150
|
:allowed_from_server => false,
|
1105
1151
|
:description => 'If `true`, disables Active Support instrumentation.'
|
1106
1152
|
},
|
1107
|
-
:
|
1153
|
+
:disable_active_record_instrumentation => {
|
1108
1154
|
:default => value_of(:skip_ar_instrumentation),
|
1109
1155
|
:documentation_default => false,
|
1110
1156
|
:public => true,
|
1111
1157
|
:type => Boolean,
|
1158
|
+
:aliases => %i[disable_activerecord_instrumentation],
|
1112
1159
|
:allowed_from_server => false,
|
1113
1160
|
:description => 'If `true`, disables Active Record instrumentation.'
|
1114
1161
|
},
|
@@ -1117,6 +1164,7 @@ module NewRelic
|
|
1117
1164
|
:public => true,
|
1118
1165
|
:type => Boolean,
|
1119
1166
|
:dynamic_name => true,
|
1167
|
+
:aliases => %i[disable_activerecord_notifications],
|
1120
1168
|
:allowed_from_server => false,
|
1121
1169
|
:description => 'If `true`, disables instrumentation for Active Record 4+'
|
1122
1170
|
},
|
@@ -1318,7 +1366,7 @@ module NewRelic
|
|
1318
1366
|
:type => String,
|
1319
1367
|
:dynamic_name => true,
|
1320
1368
|
:allowed_from_server => false,
|
1321
|
-
:description => 'Controls auto-instrumentation of Curb at start up.
|
1369
|
+
:description => 'Controls auto-instrumentation of Curb at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1322
1370
|
},
|
1323
1371
|
:'instrumentation.delayed_job' => {
|
1324
1372
|
:default => 'auto',
|
@@ -1327,7 +1375,7 @@ module NewRelic
|
|
1327
1375
|
:type => String,
|
1328
1376
|
:dynamic_name => true,
|
1329
1377
|
:allowed_from_server => false,
|
1330
|
-
:description => 'Controls auto-instrumentation of Delayed Job at start up.
|
1378
|
+
:description => 'Controls auto-instrumentation of Delayed Job at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1331
1379
|
},
|
1332
1380
|
:'instrumentation.elasticsearch' => {
|
1333
1381
|
:default => 'auto',
|
@@ -1344,7 +1392,7 @@ module NewRelic
|
|
1344
1392
|
:type => String,
|
1345
1393
|
:dynamic_name => true,
|
1346
1394
|
:allowed_from_server => false,
|
1347
|
-
:description => 'Controls auto-instrumentation of Excon at start up.
|
1395
|
+
:description => 'Controls auto-instrumentation of Excon at start up. May be one of: `enabled`, `disabled`.'
|
1348
1396
|
},
|
1349
1397
|
:'instrumentation.grape' => {
|
1350
1398
|
:default => 'auto',
|
@@ -1352,7 +1400,7 @@ module NewRelic
|
|
1352
1400
|
:type => String,
|
1353
1401
|
:dynamic_name => true,
|
1354
1402
|
:allowed_from_server => false,
|
1355
|
-
:description => 'Controls auto-instrumentation of Grape at start up.
|
1403
|
+
:description => 'Controls auto-instrumentation of Grape at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1356
1404
|
},
|
1357
1405
|
:'instrumentation.grpc_client' => {
|
1358
1406
|
:default => 'auto',
|
@@ -1361,7 +1409,7 @@ module NewRelic
|
|
1361
1409
|
:type => String,
|
1362
1410
|
:dynamic_name => true,
|
1363
1411
|
:allowed_from_server => false,
|
1364
|
-
:description => 'Controls auto-instrumentation of gRPC clients at start up.
|
1412
|
+
:description => 'Controls auto-instrumentation of gRPC clients at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1365
1413
|
},
|
1366
1414
|
:'instrumentation.grpc.host_denylist' => {
|
1367
1415
|
:default => [],
|
@@ -1378,7 +1426,7 @@ module NewRelic
|
|
1378
1426
|
:type => String,
|
1379
1427
|
:dynamic_name => true,
|
1380
1428
|
:allowed_from_server => false,
|
1381
|
-
:description => 'Controls auto-instrumentation of gRPC servers at start up.
|
1429
|
+
:description => 'Controls auto-instrumentation of gRPC servers at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1382
1430
|
},
|
1383
1431
|
:'instrumentation.httpclient' => {
|
1384
1432
|
:default => 'auto',
|
@@ -1387,7 +1435,7 @@ module NewRelic
|
|
1387
1435
|
:type => String,
|
1388
1436
|
:dynamic_name => true,
|
1389
1437
|
:allowed_from_server => false,
|
1390
|
-
:description => 'Controls auto-instrumentation of HTTPClient at start up.
|
1438
|
+
:description => 'Controls auto-instrumentation of HTTPClient at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1391
1439
|
},
|
1392
1440
|
:'instrumentation.httprb' => {
|
1393
1441
|
:default => 'auto',
|
@@ -1396,7 +1444,7 @@ module NewRelic
|
|
1396
1444
|
:type => String,
|
1397
1445
|
:dynamic_name => true,
|
1398
1446
|
:allowed_from_server => false,
|
1399
|
-
:description => 'Controls auto-instrumentation of http.rb gem at start up.
|
1447
|
+
:description => 'Controls auto-instrumentation of http.rb gem at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1400
1448
|
},
|
1401
1449
|
:'instrumentation.logger' => {
|
1402
1450
|
:default => instrumentation_value_from_boolean(:'application_logging.enabled'),
|
@@ -1405,7 +1453,7 @@ module NewRelic
|
|
1405
1453
|
:type => String,
|
1406
1454
|
:dynamic_name => true,
|
1407
1455
|
:allowed_from_server => false,
|
1408
|
-
:description => 'Controls auto-instrumentation of Ruby standard library Logger at start up.
|
1456
|
+
:description => 'Controls auto-instrumentation of Ruby standard library Logger at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1409
1457
|
},
|
1410
1458
|
:'instrumentation.memcache' => {
|
1411
1459
|
:default => 'auto',
|
@@ -1413,7 +1461,7 @@ module NewRelic
|
|
1413
1461
|
:type => String,
|
1414
1462
|
:dynamic_name => true,
|
1415
1463
|
:allowed_from_server => false,
|
1416
|
-
:description => 'Controls auto-instrumentation of dalli gem for Memcache at start up.
|
1464
|
+
:description => 'Controls auto-instrumentation of dalli gem for Memcache at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1417
1465
|
},
|
1418
1466
|
:'instrumentation.memcached' => {
|
1419
1467
|
:default => 'auto',
|
@@ -1422,7 +1470,7 @@ module NewRelic
|
|
1422
1470
|
:type => String,
|
1423
1471
|
:dynamic_name => true,
|
1424
1472
|
:allowed_from_server => false,
|
1425
|
-
:description => 'Controls auto-instrumentation of memcached gem for Memcache at start up.
|
1473
|
+
:description => 'Controls auto-instrumentation of memcached gem for Memcache at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1426
1474
|
},
|
1427
1475
|
:'instrumentation.memcache_client' => {
|
1428
1476
|
:default => 'auto',
|
@@ -1431,7 +1479,7 @@ module NewRelic
|
|
1431
1479
|
:type => String,
|
1432
1480
|
:dynamic_name => true,
|
1433
1481
|
:allowed_from_server => false,
|
1434
|
-
:description => 'Controls auto-instrumentation of memcache-client gem for Memcache at start up.
|
1482
|
+
:description => 'Controls auto-instrumentation of memcache-client gem for Memcache at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1435
1483
|
},
|
1436
1484
|
:'instrumentation.mongo' => {
|
1437
1485
|
:default => 'enabled',
|
@@ -1440,7 +1488,7 @@ module NewRelic
|
|
1440
1488
|
:type => String,
|
1441
1489
|
:dynamic_name => true,
|
1442
1490
|
:allowed_from_server => false,
|
1443
|
-
:description => 'Controls auto-instrumentation of Mongo at start up.
|
1491
|
+
:description => 'Controls auto-instrumentation of Mongo at start up. May be one of: `enabled`, `disabled`.'
|
1444
1492
|
},
|
1445
1493
|
:'instrumentation.net_http' => {
|
1446
1494
|
:default => 'auto',
|
@@ -1449,7 +1497,7 @@ module NewRelic
|
|
1449
1497
|
:type => String,
|
1450
1498
|
:dynamic_name => true,
|
1451
1499
|
:allowed_from_server => false,
|
1452
|
-
:description => 'Controls auto-instrumentation of `Net::HTTP` at start up.
|
1500
|
+
:description => 'Controls auto-instrumentation of `Net::HTTP` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1453
1501
|
},
|
1454
1502
|
:'instrumentation.puma_rack' => {
|
1455
1503
|
:default => value_of(:'instrumentation.rack'),
|
@@ -1460,7 +1508,7 @@ module NewRelic
|
|
1460
1508
|
:allowed_from_server => false,
|
1461
1509
|
:description => 'Controls auto-instrumentation of `Puma::Rack`. When enabled, the agent hooks into the ' \
|
1462
1510
|
'`to_app` method in `Puma::Rack::Builder` to find gems to instrument during ' \
|
1463
|
-
'application startup.
|
1511
|
+
'application startup. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1464
1512
|
},
|
1465
1513
|
:'instrumentation.puma_rack_urlmap' => {
|
1466
1514
|
:default => value_of(:'instrumentation.rack_urlmap'),
|
@@ -1469,7 +1517,7 @@ module NewRelic
|
|
1469
1517
|
:type => String,
|
1470
1518
|
:dynamic_name => true,
|
1471
1519
|
:allowed_from_server => false,
|
1472
|
-
:description => 'Controls auto-instrumentation of `Puma::Rack::URLMap` at start up.
|
1520
|
+
:description => 'Controls auto-instrumentation of `Puma::Rack::URLMap` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1473
1521
|
},
|
1474
1522
|
:'instrumentation.rack' => {
|
1475
1523
|
:default => 'auto',
|
@@ -1480,7 +1528,7 @@ module NewRelic
|
|
1480
1528
|
:allowed_from_server => false,
|
1481
1529
|
:description => 'Controls auto-instrumentation of Rack. When enabled, the agent hooks into the ' \
|
1482
1530
|
'`to_app` method in `Rack::Builder` to find gems to instrument during ' \
|
1483
|
-
'application startup.
|
1531
|
+
'application startup. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1484
1532
|
},
|
1485
1533
|
:'instrumentation.rack_urlmap' => {
|
1486
1534
|
:default => 'auto',
|
@@ -1489,7 +1537,7 @@ module NewRelic
|
|
1489
1537
|
:type => String,
|
1490
1538
|
:dynamic_name => true,
|
1491
1539
|
:allowed_from_server => false,
|
1492
|
-
:description => 'Controls auto-instrumentation of `Rack::URLMap` at start up.
|
1540
|
+
:description => 'Controls auto-instrumentation of `Rack::URLMap` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1493
1541
|
},
|
1494
1542
|
:'instrumentation.rake' => {
|
1495
1543
|
:default => 'auto',
|
@@ -1497,7 +1545,7 @@ module NewRelic
|
|
1497
1545
|
:type => String,
|
1498
1546
|
:dynamic_name => true,
|
1499
1547
|
:allowed_from_server => false,
|
1500
|
-
:description => 'Controls auto-instrumentation of rake at start up.
|
1548
|
+
:description => 'Controls auto-instrumentation of rake at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1501
1549
|
},
|
1502
1550
|
:'instrumentation.redis' => {
|
1503
1551
|
:default => 'auto',
|
@@ -1505,7 +1553,7 @@ module NewRelic
|
|
1505
1553
|
:type => String,
|
1506
1554
|
:dynamic_name => true,
|
1507
1555
|
:allowed_from_server => false,
|
1508
|
-
:description => 'Controls auto-instrumentation of Redis at start up.
|
1556
|
+
:description => 'Controls auto-instrumentation of Redis at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1509
1557
|
},
|
1510
1558
|
:'instrumentation.resque' => {
|
1511
1559
|
:default => 'auto',
|
@@ -1514,7 +1562,7 @@ module NewRelic
|
|
1514
1562
|
:type => String,
|
1515
1563
|
:dynamic_name => true,
|
1516
1564
|
:allowed_from_server => false,
|
1517
|
-
:description => 'Controls auto-instrumentation of resque at start up.
|
1565
|
+
:description => 'Controls auto-instrumentation of resque at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1518
1566
|
},
|
1519
1567
|
:'instrumentation.sinatra' => {
|
1520
1568
|
:default => 'auto',
|
@@ -1522,7 +1570,7 @@ module NewRelic
|
|
1522
1570
|
:type => String,
|
1523
1571
|
:dynamic_name => true,
|
1524
1572
|
:allowed_from_server => false,
|
1525
|
-
:description => 'Controls auto-instrumentation of Sinatra at start up.
|
1573
|
+
:description => 'Controls auto-instrumentation of Sinatra at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1526
1574
|
},
|
1527
1575
|
:'instrumentation.thread' => {
|
1528
1576
|
:default => 'auto',
|
@@ -1561,7 +1609,7 @@ module NewRelic
|
|
1561
1609
|
:type => String,
|
1562
1610
|
:dynamic_name => true,
|
1563
1611
|
:allowed_from_server => false,
|
1564
|
-
:description => 'Controls auto-instrumentation of Typhoeus at start up.
|
1612
|
+
:description => 'Controls auto-instrumentation of Typhoeus at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1565
1613
|
},
|
1566
1614
|
# Message tracer
|
1567
1615
|
:'message_tracer.segment_parameters.enabled' => {
|
@@ -1620,7 +1668,7 @@ module NewRelic
|
|
1620
1668
|
'This configuration option converts the Array to a RegEx list. If you\'d like ' \
|
1621
1669
|
'to allow all tasks by default, use `rake.tasks: [.+]`. No rake tasks will be ' \
|
1622
1670
|
'instrumented unless they\'re added to this list. For more information, ' \
|
1623
|
-
'visit the
|
1671
|
+
'visit the [New Relic Rake Instrumentation docs](/docs/apm/agents/ruby-agent/background-jobs/rake-instrumentation).'
|
1624
1672
|
},
|
1625
1673
|
:'rake.connect_timeout' => {
|
1626
1674
|
:default => 10,
|
@@ -15,7 +15,7 @@ module NewRelic
|
|
15
15
|
module Agent
|
16
16
|
module Configuration
|
17
17
|
class Manager
|
18
|
-
DEPENDENCY_DETECTION_VALUES = %i[prepend chain].freeze
|
18
|
+
DEPENDENCY_DETECTION_VALUES = %i[prepend chain unsatisfied].freeze
|
19
19
|
|
20
20
|
# Defining these explicitly saves object allocations that we incur
|
21
21
|
# if we use Forwardable and def_delegators.
|
@@ -366,7 +366,8 @@ module NewRelic
|
|
366
366
|
|
367
367
|
preserved = @cache.select { |_k, v| DEPENDENCY_DETECTION_VALUES.include?(v) }
|
368
368
|
new_cache
|
369
|
-
preserved.each { |k, v| @cache[k] = v
|
369
|
+
preserved.each { |k, v| @cache[k] = v }
|
370
|
+
|
370
371
|
@cache
|
371
372
|
end
|
372
373
|
|
@@ -41,6 +41,7 @@ module NewRelic
|
|
41
41
|
|
42
42
|
substitute_transaction_threshold(config)
|
43
43
|
booleanify_values(config, 'agent_enabled', 'enabled')
|
44
|
+
apply_aliases(config)
|
44
45
|
|
45
46
|
super(config, true)
|
46
47
|
end
|
@@ -165,6 +166,18 @@ module NewRelic
|
|
165
166
|
end
|
166
167
|
result
|
167
168
|
end
|
169
|
+
|
170
|
+
def apply_aliases(config)
|
171
|
+
DEFAULTS.each do |config_setting, value|
|
172
|
+
next unless value[:aliases]
|
173
|
+
|
174
|
+
value[:aliases].each do |config_alias|
|
175
|
+
next unless config[config_setting].nil? && !config[config_alias.to_s].nil?
|
176
|
+
|
177
|
+
config[config_setting] = config[config_alias.to_s]
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
168
181
|
end
|
169
182
|
end
|
170
183
|
end
|
@@ -90,7 +90,8 @@ DependencyDetection.defer do
|
|
90
90
|
end
|
91
91
|
|
92
92
|
depends_on do
|
93
|
-
!NewRelic::Agent.config[:
|
93
|
+
!NewRelic::Agent.config[:disable_active_record_instrumentation] &&
|
94
|
+
!NewRelic::Agent.config[:disable_active_record_notifications] &&
|
94
95
|
!NewRelic::Agent::Instrumentation::ActiveRecordSubscriber.subscribed?
|
95
96
|
end
|
96
97
|
|
@@ -13,7 +13,7 @@ module NewRelic::Agent::Instrumentation
|
|
13
13
|
def post(*args, &task)
|
14
14
|
return post_without_new_relic(*args, &task) unless NewRelic::Agent::Tracer.tracing_enabled?
|
15
15
|
|
16
|
-
traced_task = add_task_tracing(
|
16
|
+
traced_task = add_task_tracing(&task)
|
17
17
|
post_without_new_relic(*args, &traced_task)
|
18
18
|
end
|
19
19
|
end
|
@@ -7,11 +7,10 @@ module NewRelic::Agent::Instrumentation
|
|
7
7
|
SEGMENT_NAME = 'Concurrent/Task'
|
8
8
|
SUPPORTABILITY_METRIC = 'Supportability/ConcurrentRuby/Invoked'
|
9
9
|
|
10
|
-
def add_task_tracing(
|
10
|
+
def add_task_tracing(&task)
|
11
11
|
NewRelic::Agent.record_metric_once(SUPPORTABILITY_METRIC)
|
12
12
|
|
13
13
|
NewRelic::Agent::Tracer.thread_block_with_current_transaction(
|
14
|
-
*args,
|
15
14
|
segment_name: SEGMENT_NAME,
|
16
15
|
parent: NewRelic::Agent::Tracer.current_segment,
|
17
16
|
&task
|
@@ -10,7 +10,7 @@ module NewRelic::Agent::Instrumentation
|
|
10
10
|
def post(*args, &task)
|
11
11
|
return super(*args, &task) unless NewRelic::Agent::Tracer.tracing_enabled?
|
12
12
|
|
13
|
-
traced_task = add_task_tracing(
|
13
|
+
traced_task = add_task_tracing(&task)
|
14
14
|
super(*args, &traced_task)
|
15
15
|
end
|
16
16
|
end
|
@@ -10,9 +10,16 @@ module NewRelic::Agent::Instrumentation
|
|
10
10
|
|
11
11
|
alias_method(:initialize_without_new_relic, :initialize)
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
if RUBY_VERSION < '2.7.0'
|
14
|
+
def initialize(*_args, &block)
|
15
|
+
traced_block = add_thread_tracing(&block)
|
16
|
+
initialize_with_newrelic_tracing { initialize_without_new_relic(&traced_block) }
|
17
|
+
end
|
18
|
+
else
|
19
|
+
def initialize(**kwargs, &block)
|
20
|
+
traced_block = add_thread_tracing(&block)
|
21
|
+
initialize_with_newrelic_tracing { initialize_without_new_relic(**kwargs, &traced_block) }
|
22
|
+
end
|
16
23
|
end
|
17
24
|
end
|
18
25
|
end
|
@@ -11,11 +11,10 @@ module NewRelic::Agent::Instrumentation
|
|
11
11
|
yield
|
12
12
|
end
|
13
13
|
|
14
|
-
def add_thread_tracing(
|
14
|
+
def add_thread_tracing(&block)
|
15
15
|
return block if !NewRelic::Agent::Tracer.thread_tracing_enabled?
|
16
16
|
|
17
17
|
NewRelic::Agent::Tracer.thread_block_with_current_transaction(
|
18
|
-
*args,
|
19
18
|
segment_name: 'Ruby/Fiber',
|
20
19
|
&block
|
21
20
|
)
|
@@ -9,9 +9,16 @@ module NewRelic::Agent::Instrumentation
|
|
9
9
|
module Prepend
|
10
10
|
include NewRelic::Agent::Instrumentation::MonitoredFiber
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
if RUBY_VERSION < '2.7.0'
|
13
|
+
def initialize(*_args, &block)
|
14
|
+
traced_block = add_thread_tracing(&block)
|
15
|
+
initialize_with_newrelic_tracing { super(&traced_block) }
|
16
|
+
end
|
17
|
+
else
|
18
|
+
def initialize(**kawrgs, &block)
|
19
|
+
traced_block = add_thread_tracing(&block)
|
20
|
+
initialize_with_newrelic_tracing { super(**kawrgs, &traced_block) }
|
21
|
+
end
|
15
22
|
end
|
16
23
|
end
|
17
24
|
end
|