newrelic_rpm 9.5.0 → 9.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +112 -7
  3. data/CONTRIBUTING.md +0 -7
  4. data/Rakefile +1 -1
  5. data/bin/newrelic +2 -9
  6. data/bin/newrelic_rpm +15 -0
  7. data/init.rb +2 -2
  8. data/lib/new_relic/agent/agent.rb +1 -1
  9. data/lib/new_relic/agent/agent_helpers/shutdown.rb +1 -1
  10. data/lib/new_relic/agent/agent_helpers/special_startup.rb +1 -1
  11. data/lib/new_relic/agent/agent_helpers/start_worker_thread.rb +2 -2
  12. data/lib/new_relic/agent/agent_helpers/startup.rb +2 -2
  13. data/lib/new_relic/agent/attribute_filter.rb +3 -3
  14. data/lib/new_relic/agent/configuration/default_source.rb +94 -35
  15. data/lib/new_relic/agent/configuration/manager.rb +8 -7
  16. data/lib/new_relic/agent/datastores/mongo/metric_translator.rb +1 -1
  17. data/lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb +3 -3
  18. data/lib/new_relic/agent/event_loop.rb +1 -1
  19. data/lib/new_relic/agent/http_clients/abstract.rb +4 -0
  20. data/lib/new_relic/agent/http_clients/async_http_wrappers.rb +80 -0
  21. data/lib/new_relic/agent/http_clients/curb_wrappers.rb +1 -3
  22. data/lib/new_relic/agent/http_clients/ethon_wrappers.rb +109 -0
  23. data/lib/new_relic/agent/http_clients/excon_wrappers.rb +0 -3
  24. data/lib/new_relic/agent/http_clients/http_rb_wrappers.rb +1 -3
  25. data/lib/new_relic/agent/http_clients/httpclient_wrappers.rb +0 -3
  26. data/lib/new_relic/agent/http_clients/httpx_wrappers.rb +91 -0
  27. data/lib/new_relic/agent/http_clients/net_http_wrappers.rb +1 -4
  28. data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +0 -3
  29. data/lib/new_relic/agent/instrumentation/active_merchant.rb +1 -1
  30. data/lib/new_relic/agent/instrumentation/active_record_helper.rb +1 -2
  31. data/lib/new_relic/agent/instrumentation/active_support_broadcast_logger/chain.rb +69 -0
  32. data/lib/new_relic/agent/instrumentation/active_support_broadcast_logger/instrumentation.rb +13 -0
  33. data/lib/new_relic/agent/instrumentation/active_support_broadcast_logger/prepend.rb +37 -0
  34. data/lib/new_relic/agent/instrumentation/active_support_broadcast_logger.rb +23 -0
  35. data/lib/new_relic/agent/instrumentation/active_support_logger.rb +3 -1
  36. data/lib/new_relic/agent/instrumentation/async_http/chain.rb +23 -0
  37. data/lib/new_relic/agent/instrumentation/async_http/instrumentation.rb +37 -0
  38. data/lib/new_relic/agent/instrumentation/async_http/prepend.rb +15 -0
  39. data/lib/new_relic/agent/instrumentation/async_http.rb +26 -0
  40. data/lib/new_relic/agent/instrumentation/elasticsearch/instrumentation.rb +1 -1
  41. data/lib/new_relic/agent/instrumentation/ethon/chain.rb +39 -0
  42. data/lib/new_relic/agent/instrumentation/ethon/instrumentation.rb +105 -0
  43. data/lib/new_relic/agent/instrumentation/ethon/prepend.rb +35 -0
  44. data/lib/new_relic/agent/instrumentation/ethon.rb +39 -0
  45. data/lib/new_relic/agent/instrumentation/fiber/instrumentation.rb +1 -4
  46. data/lib/new_relic/agent/instrumentation/httpx/chain.rb +20 -0
  47. data/lib/new_relic/agent/instrumentation/httpx/instrumentation.rb +51 -0
  48. data/lib/new_relic/agent/instrumentation/httpx/prepend.rb +15 -0
  49. data/lib/new_relic/agent/instrumentation/httpx.rb +27 -0
  50. data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +1 -3
  51. data/lib/new_relic/agent/instrumentation/net_http/instrumentation.rb +1 -1
  52. data/lib/new_relic/agent/instrumentation/rails_notifications/action_controller.rb +1 -0
  53. data/lib/new_relic/agent/instrumentation/roda/ignorer.rb +45 -0
  54. data/lib/new_relic/agent/instrumentation/roda/instrumentation.rb +12 -0
  55. data/lib/new_relic/agent/instrumentation/roda/roda_transaction_namer.rb +1 -2
  56. data/lib/new_relic/agent/instrumentation/roda.rb +2 -0
  57. data/lib/new_relic/agent/instrumentation/sidekiq.rb +3 -1
  58. data/lib/new_relic/agent/instrumentation/sinatra/ignorer.rb +1 -1
  59. data/lib/new_relic/agent/instrumentation/sinatra/transaction_namer.rb +1 -3
  60. data/lib/new_relic/agent/instrumentation/sinatra.rb +1 -1
  61. data/lib/new_relic/agent/instrumentation/thread/instrumentation.rb +1 -4
  62. data/lib/new_relic/agent/instrumentation/view_component/chain.rb +21 -0
  63. data/lib/new_relic/agent/instrumentation/view_component/instrumentation.rb +38 -0
  64. data/lib/new_relic/agent/instrumentation/view_component/prepend.rb +13 -0
  65. data/lib/new_relic/agent/instrumentation/view_component.rb +26 -0
  66. data/lib/new_relic/agent/javascript_instrumentor.rb +0 -1
  67. data/lib/new_relic/agent/messaging.rb +2 -2
  68. data/lib/new_relic/agent/monitors/synthetics_monitor.rb +12 -1
  69. data/lib/new_relic/agent/new_relic_service/encoders.rb +2 -2
  70. data/lib/new_relic/agent/new_relic_service.rb +8 -6
  71. data/lib/new_relic/agent/obfuscator.rb +0 -2
  72. data/lib/new_relic/agent/pipe_channel_manager.rb +2 -2
  73. data/lib/new_relic/agent/rules_engine/segment_terms_rule.rb +1 -2
  74. data/lib/new_relic/agent/rules_engine.rb +1 -1
  75. data/lib/new_relic/agent/span_event_primitive.rb +16 -4
  76. data/lib/new_relic/agent/sql_sampler.rb +0 -1
  77. data/lib/new_relic/agent/system_info.rb +26 -0
  78. data/lib/new_relic/agent/tracer.rb +5 -6
  79. data/lib/new_relic/agent/transaction/abstract_segment.rb +3 -0
  80. data/lib/new_relic/agent/transaction/external_request_segment.rb +5 -2
  81. data/lib/new_relic/agent/transaction/message_broker_segment.rb +1 -2
  82. data/lib/new_relic/agent/transaction/request_attributes.rb +1 -3
  83. data/lib/new_relic/agent/transaction/tracing.rb +11 -1
  84. data/lib/new_relic/agent/transaction.rb +25 -2
  85. data/lib/new_relic/agent/transaction_error_primitive.rb +16 -0
  86. data/lib/new_relic/agent/transaction_event_primitive.rb +19 -0
  87. data/lib/new_relic/agent/utilization/gcp.rb +1 -3
  88. data/lib/new_relic/agent/vm/{mri_vm.rb → c_ruby_vm.rb} +7 -15
  89. data/lib/new_relic/agent/vm.rb +2 -2
  90. data/lib/new_relic/agent/worker_loop.rb +1 -1
  91. data/lib/new_relic/agent.rb +11 -7
  92. data/lib/new_relic/base64.rb +25 -0
  93. data/lib/new_relic/cli/command.rb +6 -4
  94. data/lib/new_relic/constants.rb +5 -0
  95. data/lib/new_relic/control/frameworks/rails.rb +17 -5
  96. data/lib/new_relic/control/instrumentation.rb +1 -1
  97. data/lib/new_relic/language_support.rb +4 -0
  98. data/lib/new_relic/local_environment.rb +22 -13
  99. data/lib/new_relic/supportability_helper.rb +1 -1
  100. data/lib/new_relic/version.rb +1 -1
  101. data/lib/tasks/config.rake +1 -1
  102. data/lib/tasks/helpers/config.html.erb +6 -6
  103. data/lib/tasks/helpers/newrelicyml.rb +1 -1
  104. data/lib/tasks/instrumentation_generator/instrumentation.thor +3 -3
  105. data/lib/tasks/tests.rake +71 -0
  106. data/newrelic.yml +55 -35
  107. data/newrelic_rpm.gemspec +5 -4
  108. data/test/agent_helper.rb +14 -2
  109. metadata +32 -7
  110. data/bin/newrelic_cmd +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5e1f4605a4afe166aa2035486a2433f91f4d0432666b787e6d9c5af9e5ee717
4
- data.tar.gz: 16e7707b8c81774ea0c2bea54825d023c2849d0a03ab553e25800c131d9c2972
3
+ metadata.gz: 0ece3a3703c9847f5ddf5ddd8776a58ff03c6400e3d61053bfe227ea7ddc3d83
4
+ data.tar.gz: 14aa9f742b5a9e73d510ff88cfe5292007fb97a002a23d15bc835be72b3ae483
5
5
  SHA512:
6
- metadata.gz: 8180f7caa158ce2ea794914376f441f5f912f46fbce8caca074b8c2c9a06fb84ca5e290eab2aa63dfa68f5385e6f7f9f3ede8ee00ee97fbc30d692b93721ec8e
7
- data.tar.gz: 21062253bf9236563dcd226ccc4e5e2f8d1fceaed24f6047fb6ed23f485f8b0e4607bbe9b7985c4a63809767c2f4b5785e4ec52c25ff6d2ac186ff7fb8a149f7
6
+ metadata.gz: 670682da76dcf65d64bd634579e63bf82ab33dafbfd72b5e66605b136d10dcdcc655e8a1d5ecac2db58e948ec57775ef74c337a43428b8458a5436458c1d1522
7
+ data.tar.gz: 9f5e190e03218aa49d57dba5299770a93f0e835436f21144f65c9e149427a496468644950ccfd6274cdda0ed735002a46a20703afc79483767439266043c5f8e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,110 @@
1
1
  # New Relic Ruby Agent Release Notes
2
2
 
3
+ ## v9.7.0
4
+
5
+
6
+ Version 9.7.0 introduces ViewComponent instrumentation, changes the endpoint used to access the cluster name for Elasticsearch instrumentation, removes the creation of the Ruby/Thread and Ruby/Fiber spans, and adds support for Falcon.
7
+
8
+ - **Feature: ViewComponent instrumentation**
9
+
10
+ [ViewComponent](https://viewcomponent.org/) is a now an instrumented framework. The agent currently supports Roda versions 2.0.0+. [PR#2367](https://github.com/newrelic/newrelic-ruby-agent/pull/2367)
11
+
12
+ - **Feature: Use root path to access Elasticsearch cluster name**
13
+
14
+ Previously, the agent used the cluster health endpoint (`/_cluster/health`) to access the cluster name. However, this has been found to make startup unstable for large clusters. Now, the agent uses the more performant root endpoint (`/`).
15
+
16
+ Our thanks go to [@erikkessler1](https://github.com/erikkessler1), [@gremerritt](https://github.com/gremerritt), and [@joshbranham](https://github.com/joshbranham) for reporting the issue, suggesting solutions, and testing them. [Issue#2360](https://github.com/newrelic/newrelic-ruby-agent/issues/2360) [PR#2377](https://github.com/newrelic/newrelic-ruby-agent/pull/2377)
17
+
18
+ - **Feature: Remove base64 dependency, use direct calls to String methods**
19
+
20
+ In version 9.6.0, the agent required the Ruby `base64` gem as a depdendency to prepare for deprecation warnings in Ruby 3.3 and the gem's removal from the Ruby standard libraries in 3.4. Including `base64` as a dependency has caused problems with version resolution in some environments.
21
+
22
+ To resolve this, the agent now directly calls the `String` methods used in the `base64` library in the new `NewRelic::Base64` module.
23
+
24
+ Thank you, [@Earlopain](https://github.com/Earlopain), for submitting this change. [PR#2378](https://github.com/newrelic/newrelic-ruby-agent/pull/2378)
25
+
26
+ - **Feature: Add Falcon support**
27
+
28
+ The agent now supports the web server [Falcon](https://socketry.github.io/falcon/). [PR#2383](https://github.com/newrelic/newrelic-ruby-agent/pull/2383)
29
+
30
+ - **Feature: Remove spans with name Ruby/Thread and Ruby/Fiber**
31
+
32
+ Due to the lack of helpful information and the confusion commonly caused by the spans named Ruby/Thread and Ruby/Fiber, these spans have been removed. However, the agents ability to monitor instrumented code running in a thread or fiber will remain unchanged. [PR#2389](https://github.com/newrelic/newrelic-ruby-agent/pull/2389)
33
+
34
+ ## v9.6.0
35
+
36
+ Version 9.6.0 adds instrumentation for Async::HTTP, Ethon, and HTTPX, adds the ability to ignore specific routes with Roda, gleans Docker container IDs from cgroups v2-based containers, records additional synthetics attributes, fixes an issue with Rails 7.1 that could cause duplicate log records to be sent to New Relic, fixes a deprecation warning for the Sidekiq error handler, adds additional attributes for OpenTelemetry compatibility, and resolves some technical debt, thanks to the community.
37
+
38
+ - **Feature: Add instrumentation for Async::HTTP**
39
+
40
+ The agent will now record spans for Async::HTTP requests. Versions 0.59.0 and above of the async-http gem are supported. [PR#2272](https://github.com/newrelic/newrelic-ruby-agent/pull/2272)
41
+
42
+ - **Feature: Add instrumentation for Ethon**
43
+
44
+ Instrumentation has been added for the [Ethon](https://github.com/typhoeus/ethon) HTTP client gem. Versions 0.12.0 and above are supported. The agent will now record external request segments for invocations of `Ethon::Easy#perform` and `Ethon::Multi#perform`. NOTE: The [Typhoeus](https://github.com/typhoeus/typhoeus) gem is maintained by the same team that maintains Ethon and depends on Ethon for its functionality. To prevent duplicate reporting for each HTTP request, the Ethon instrumentation will be disabled when Typhoeus is detected. [PR#2260](https://github.com/newrelic/newrelic-ruby-agent/pull/2260)
45
+
46
+ - **Feature: Add instrumentation for HTTPX**
47
+
48
+ The agent now offers instrumentation for the HTTP client [HTTPX](https://honeyryderchuck.gitlab.io/httpx/), provided the gem is at version 1.0.0 or above. [PR#2278](https://github.com/newrelic/newrelic-ruby-agent/pull/2278)
49
+
50
+ - **Feature: Prevent the agent from starting in "rails" commands in Rails 7**
51
+
52
+ Previously, the agent ignored many Rails commands by default, such as `rails routes`, using Rake-specific logic. This was accomplished by setting these commands as default values for the config option `autostart.denylisted_rake_tasks`. However, Rails 7 no longer uses Rake for these commands, causing the agent to start running and attempting to record data when running these commands. The commands have now been added to the default value for the config option `autostart.denylisted_constants`, which will allow the agent to recognize these commands correctly in Rails 7 and prevent the agent from starting during ignored tasks. Note that the agent will continue to start-up when the `rails server` and `rails runner` commands are invoked. [PR#2239](https://github.com/newrelic/newrelic-ruby-agent/pull/2239)
53
+
54
+ - **Feature: Glean Docker container ID for cgroups v2-based containers**
55
+
56
+ Previously, the agent was only capable of determining a host Docker container's ID if the container was based on cgroups v1. Now, containers based on cgroups v2 will also have their container IDs reported to New Relic. [PR#2229](https://github.com/newrelic/newrelic-ruby-agent/issues/2229).
57
+
58
+ - **Feature: Update events with additional synthetics attributes when available**
59
+
60
+ The agent will now record additional synthetics attributes on synthetics events if these attributes are available. [PR#2203](https://github.com/newrelic/newrelic-ruby-agent/pull/2203)
61
+
62
+ - **Feature: Declare a gem dependency on the Ruby Base 64 gem 'base64'**
63
+
64
+ For compatibility with Ruby 3.4 and to silence compatibility warnings present in Ruby 3.3, declare a dependency on the `base64` gem. The New Relic Ruby agent uses the native Ruby `base64` gem for Base 64 encoding/decoding. The agent is joined by Ruby on Rails ([rails/rails@3e52adf](https://github.com/rails/rails/commit/3e52adf28e90af490f7e3bdc4bcc85618a4e0867)) and others in making this change in preparation for Ruby 3.3/3.4. [PR#2238](https://github.com/newrelic/newrelic-ruby-agent/pull/2238)
65
+
66
+ - **Feature: Add Roda support for the newrelic_ignore\* family of methods**
67
+
68
+ The agent can now selectively disable instrumentation for particular requests within Roda applications. Supported methods include:
69
+ - `newrelic_ignore`: ignore a given route.
70
+ - `newrelic_ignore_apdex`: exclude a given route from consideration in overall Apdex calculations.
71
+ - `newrelic_ignore_enduser`: prevent automatic injection of the page load timing JavaScript when a route is rendered.
72
+
73
+ For more information, see [Roda Instrumentation](https://docs.newrelic.com/docs/apm/agents/ruby-agent/instrumented-gems/roda-instrumentation/). [PR#2267](https://github.com/newrelic/newrelic-ruby-agent/pull/2267)
74
+
75
+ - **Feature: Add additional span attributes for OpenTelemetry compatibility**
76
+
77
+ For improved compatibility with OpenTelemetry's semantic conventions, the agent's datastore (for databases) and external request (for HTTP clients) segments have been updated with additional attributes.
78
+
79
+ Datastore segments now offer 3 additional attributes:
80
+ - `db.system`: The database system. For Ruby we use the database adapter name here.
81
+ - `server.address`: The database host.
82
+ - `server.port`: The database port.
83
+
84
+ External request segments now offer 3 additional attributes:
85
+ - `http.request.method`: The HTTP method (ex: 'GET')
86
+ - `server.address`: The target host.
87
+ - `server.port`: The target port.
88
+
89
+ For maximum backwards compatibility, no existing attributes have been renamed or removed. [PR#2283](https://github.com/newrelic/newrelic-ruby-agent/pull/2283)
90
+
91
+ - **Bugfix: Stop sending duplicate log events for Rails 7.1 users**
92
+
93
+ Rails 7.1 introduced the public API [`ActiveSupport::BroadcastLogger`](https://api.rubyonrails.org/classes/ActiveSupport/BroadcastLogger.html). This logger replaces a private API, `ActiveSupport::Logger.broadcast`. In Rails versions below 7.1, the agent uses the `broadcast` method to stop duplicate logs from being recoded by broadcasted loggers. Now, we've updated the code to provide a similar duplication fix for the `ActiveSupport::BroadcastLogger` class. [PR#2252](https://github.com/newrelic/newrelic-ruby-agent/pull/2252)
94
+
95
+ - **Bugfix: Resolve Sidekiq 8.0 error handler deprecation warning**
96
+
97
+ Sidekiq 8.0 will require procs passed to the error handler to include three arguments: error, context, and config. Users running sidekiq/main would receive a deprecation warning with this change any time an error was raised within a job. Thank you, [@fukayatsu](https://github.com/fukayatsu) for your proactive fix! [PR#2261](https://github.com/newrelic/newrelic-ruby-agent/pull/2261)
98
+
99
+ - **Community: Resolve technical debt**
100
+
101
+ We also received some great contributions from community members to resolve some outstanding technical debt issues. Thank you for your contributions!
102
+ * Add and Replace SLASH and ROOT constants: [PR#2256](https://github.com/newrelic/newrelic-ruby-agent/pull/2256) [chahmedejaz](https://github.com/chahmedejaz)
103
+ * Remove pry as a dev dependency: PR#2665, PR#2273, AlajeBash (profile no longer active)
104
+ * Replace "start up" with "start-up": [PR#2249](https://github.com/newrelic/newrelic-ruby-agent/pull/2249) [chahmedejaz](https://github.com/chahmedejaz)
105
+ * Remove unused variables in test suites: [PR#2250](https://github.com/newrelic/newrelic-ruby-agent/pull/2250)
106
+
107
+
3
108
  ## v9.5.0
4
109
 
5
110
  Version 9.5.0 introduces Stripe instrumentation, allows the agent to record additional response information on a transaction when middleware instrumentation is disabled, introduces new `:'sidekiq.args.include'` and `:'sidekiq.args.exclude:` configuration options to permit capturing only certain Sidekiq job arguments, updates Elasticsearch datastore instance metrics, and fixes a bug in `NewRelic::Rack::AgentHooks.needed?`.
@@ -435,7 +540,7 @@ Version 8.15.0 of the agent confirms compatibility with Ruby 3.2.0, adds instrum
435
540
 
436
541
  | Configuration name | Default | Behavior |
437
542
  | --------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------- |
438
- | `instrumentation.concurrent_ruby` | auto | Controls auto-instrumentation of the concurrent-ruby library at start up. May be one of `auto`, `prepend`, `chain`, `disabled`. |
543
+ | `instrumentation.concurrent_ruby` | auto | Controls auto-instrumentation of the concurrent-ruby library at start-up. May be one of `auto`, `prepend`, `chain`, `disabled`. |
439
544
 
440
545
  - **Infinite Tracing: Use batching and compression**
441
546
 
@@ -534,7 +639,7 @@ Version 8.12.0 of the agent delivers new Elasticsearch instrumentation, increase
534
639
 
535
640
  | Configuration name | Default | Behavior |
536
641
  | --------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------- |
537
- | `instrumentation.elasticsearch` | auto | Controls auto-instrumentation of the elasticsearch library at start up. May be one of `auto`, `prepend`, `chain`, `disabled`. |
642
+ | `instrumentation.elasticsearch` | auto | Controls auto-instrumentation of the elasticsearch library at start-up. May be one of `auto`, `prepend`, `chain`, `disabled`. |
538
643
  | `elasticsearch.capture_queries` | true | If `true`, the agent captures Elasticsearch queries in transaction traces. |
539
644
  | `elasticsearch.obfuscate_queries` | true | If `true`, the agent obfuscates Elasticsearch queries in transaction traces. |
540
645
 
@@ -1149,7 +1254,7 @@ The multiverse collection of test suites requires a variety of data handling sof
1149
1254
  - **Bugfix: Prevent browser monitoring middleware from installing to middleware multiple times**
1150
1255
 
1151
1256
  In rare cases on jRuby, the BrowserMonitoring middleware could attempt to install itself
1152
- multiple times at start up. This bug fix addresses that by using a mutex to introduce
1257
+ multiple times at start-up. This bug fix addresses that by using a mutex to introduce
1153
1258
  thread safety to the operation. Sintra in particular can have this race condition because
1154
1259
  its middleware stack is not installed until the first request is received.
1155
1260
 
@@ -1160,7 +1265,7 @@ The multiverse collection of test suites requires a variety of data handling sof
1160
1265
  - **Bugfix: nil Middlewares injection now prevented and gracefully handled in Sinatra**
1161
1266
 
1162
1267
  Previously, the agent could potentially inject multiples of an instrumented middleware if Sinatra received many
1163
- requests at once during start up and initialization due to Sinatra's ability to delay full start up as long as possible.
1268
+ requests at once during start-up and initialization due to Sinatra's ability to delay full start-up as long as possible.
1164
1269
  This has now been fixed and the Ruby agent correctly instruments only once as well as gracefully handles nil middleware
1165
1270
  classes in general.
1166
1271
 
@@ -1391,7 +1496,7 @@ The multiverse collection of test suites requires a variety of data handling sof
1391
1496
 
1392
1497
  - **Additional Transaction Information applied to Span Events**
1393
1498
 
1394
- When Distributed Tracing and/or Infinite Tracing are enabled, the Agent will now incorporate additional information from the Transaction Event on to the root Span Event of the transaction.
1499
+ When Distributed Tracing and/or Infinite Tracing are enabled, the agent will now incorporate additional information from the Transaction Event on to the root Span Event of the transaction.
1395
1500
 
1396
1501
  The following items are affected:
1397
1502
 
@@ -3377,7 +3482,7 @@ For more details on our Resque support, see https://docs.newrelic.com/docs/agent
3377
3482
  - Support agent when starting Resque Pool from Rake task
3378
3483
 
3379
3484
  When running resque-pool with its provided rake tasks, the agent would not
3380
- start up properly. Thanks Tiago Sousa for the fix!
3485
+ start-up properly. Thanks Tiago Sousa for the fix!
3381
3486
 
3382
3487
  - Fix for DelayedJob + Rails 4.x queue depth metrics
3383
3488
 
@@ -5321,7 +5426,7 @@ Agent improvements to support future RPM enhancements
5321
5426
  - fix incompatibility in the developer mode with the safe_erb plugin
5322
5427
  - fix module namespace issue causing an error accessing
5323
5428
  NewRelic::Instrumentation modules
5324
- - fix issue where the agent sometimes failed to start up if there was a
5429
+ - fix issue where the agent sometimes failed to start-up if there was a
5325
5430
  transient network problem
5326
5431
  - fix IgnoreSilentlyException message
5327
5432
 
data/CONTRIBUTING.md CHANGED
@@ -178,13 +178,6 @@ opensource@newrelic.com.
178
178
  For more information about CLAs, please check out Alex Russell’s excellent post,
179
179
  [“Why Do I Need to Sign This?”](https://infrequently.org/2008/06/why-do-i-need-to-sign-this/).
180
180
 
181
- ## Slack
182
-
183
- We host a public Slack with a dedicated channel for contributors and maintainers
184
- of open source projects hosted by New Relic. If you are contributing to this
185
- project, you're welcome to request access to the #oss-contributors channel in
186
- the newrelicusers.slack.com workspace. To request access, please use this [link](https://join.slack.com/t/newrelicusers/shared_invite/zt-1ayj69rzm-~go~Eo1whIQGYnu3qi15ng).
187
-
188
181
  ## Explorer's Hub
189
182
 
190
183
  New Relic hosts and moderates an online forum where customers can interact with
data/Rakefile CHANGED
@@ -131,7 +131,7 @@ end
131
131
 
132
132
  desc 'Start an interactive console session'
133
133
  task :console do
134
- require 'pry'
134
+ require 'pry' if ENV['ENABLE_PRY']
135
135
  require 'newrelic_rpm'
136
136
  ARGV.clear
137
137
  Pry.start
data/bin/newrelic CHANGED
@@ -1,15 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
+ # This command has been renamed "newrelic_rpm"
4
5
  # executes one of the commands in the new_relic/commands directory
5
6
  # pass the name of the command as an argument
6
7
 
7
- $LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
8
- require 'new_relic/cli/command'
9
- begin
10
- NewRelic::Cli::Command.run
11
- rescue NewRelic::Cli::Command::CommandFailure => failure
12
- STDERR.puts failure.message
13
- STDERR.puts failure.options if failure.options
14
- exit(1)
15
- end
8
+ load File.dirname(__FILE__) + '/newrelic_rpm'
data/bin/newrelic_rpm ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ # executes one of the commands in the new_relic/commands directory
5
+ # pass the name of the command as an argument
6
+
7
+ $LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
8
+ require 'new_relic/cli/command'
9
+ begin
10
+ NewRelic::Cli::Command.run
11
+ rescue NewRelic::Cli::Command::CommandFailure => failure
12
+ STDERR.puts failure.message
13
+ STDERR.puts failure.options if failure.options
14
+ exit(1)
15
+ end
data/init.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
3
  # frozen_string_literal: true
4
4
 
5
- # This is the initialization for the New Relic Ruby Agent when used as
5
+ # This is the initialization for the New Relic Ruby agent when used as
6
6
  # a plugin
7
7
  require 'new_relic/control'
8
8
 
@@ -12,7 +12,7 @@ require 'new_relic/control'
12
12
  # If you can't find any log files and you don't see anything in your
13
13
  # application log files please visit support.newrelic.com.
14
14
 
15
- # Initializer for the NewRelic Ruby Agent
15
+ # Initializer for the New Relic Ruby agent
16
16
 
17
17
  # After version 2.0 of Rails we can access the configuration directly.
18
18
  # We need it to add dev mode routes after initialization finished.
@@ -47,7 +47,7 @@ require 'new_relic/agent/agent_helpers/transmit'
47
47
 
48
48
  module NewRelic
49
49
  module Agent
50
- # The Agent is a singleton that is instantiated when the plugin is
50
+ # The agent is a singleton that is instantiated when the plugin is
51
51
  # activated. It collects performance data from ruby applications
52
52
  # in realtime as the application runs, and periodically sends that
53
53
  # data to the NewRelic server.
@@ -11,7 +11,7 @@ module NewRelic
11
11
  def shutdown
12
12
  return unless started?
13
13
 
14
- ::NewRelic::Agent.logger.info('Starting Agent shutdown')
14
+ ::NewRelic::Agent.logger.info('Starting agent shutdown')
15
15
 
16
16
  stop_event_loop
17
17
  trap_signals_for_litespeed
@@ -10,7 +10,7 @@ module NewRelic
10
10
  # requests, we need to wait until the children are forked
11
11
  # before connecting, otherwise the parent process sends useless data
12
12
  def using_forking_dispatcher?
13
- if [:puma, :passenger, :unicorn].include?(Agent.config[:dispatcher])
13
+ if [:puma, :passenger, :unicorn, :falcon].include?(Agent.config[:dispatcher])
14
14
  ::NewRelic::Agent.logger.info('Deferring startup of agent reporting thread because ' \
15
15
  "#{Agent.config[:dispatcher]} may fork.")
16
16
  true
@@ -19,12 +19,12 @@ module NewRelic
19
19
  # See #connect for a description of connection_options.
20
20
  def start_worker_thread(connection_options = {})
21
21
  if disable = NewRelic::Agent.config[:disable_harvest_thread]
22
- NewRelic::Agent.logger.info('Not starting Ruby Agent worker thread because :disable_harvest_thread is ' \
22
+ NewRelic::Agent.logger.info('Not starting Ruby agent worker thread because :disable_harvest_thread is ' \
23
23
  "#{disable}")
24
24
  return
25
25
  end
26
26
 
27
- ::NewRelic::Agent.logger.debug('Creating Ruby Agent worker thread.')
27
+ ::NewRelic::Agent.logger.debug('Creating Ruby agent worker thread.')
28
28
  @worker_thread = Threading::AgentThread.create('Worker Loop') do
29
29
  deferred_work!(connection_options)
30
30
  end
@@ -103,7 +103,7 @@ module NewRelic
103
103
  # so we can disambiguate processes in the log file and make
104
104
  # sure they're running a reasonable version
105
105
  def log_version_and_pid
106
- ::NewRelic::Agent.logger.debug("New Relic Ruby Agent #{NewRelic::VERSION::STRING} Initialized: pid = #{$$}")
106
+ ::NewRelic::Agent.logger.debug("New Relic Ruby agent #{NewRelic::VERSION::STRING} initialized: pid = #{$$}")
107
107
  end
108
108
 
109
109
  # Logs the configured application names
@@ -180,7 +180,7 @@ module NewRelic
180
180
 
181
181
  unless app_name_configured?
182
182
  NewRelic::Agent.logger.error('No application name configured.',
183
- 'The Agent cannot start without at least one. Please check your ',
183
+ 'The agent cannot start without at least one. Please check your ',
184
184
  'newrelic.yml and ensure that it is valid and has at least one ',
185
185
  "value set for app_name in the #{NewRelic::Control.instance.env} ",
186
186
  'environment.')
@@ -2,7 +2,7 @@
2
2
  # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
3
  # frozen_string_literal: true
4
4
 
5
- # This class applies filtering rules as specified in the Agent Attributes
5
+ # This class applies filtering rules as specified in the agent attributes
6
6
  # cross-agent spec.
7
7
  #
8
8
  # Instances of it are constructed by deriving a set of rules from the agent
@@ -44,7 +44,7 @@
44
44
  # 1. First, the names are compared lexicographically. This has the impact of
45
45
  # forcing shorter (more general) rules towards the top of the list and longer
46
46
  # (more specific) rules towards the bottom. This is important, because the
47
- # Agent Attributes spec stipulates that the most specific rule for a given
47
+ # agent Attributes spec stipulates that the most specific rule for a given
48
48
  # destination should take precedence. Since rules are applied top-to-bottom,
49
49
  # this sorting guarantees that the most specific rule will be applied last.
50
50
  # 2. If the names are identical, we next examine the wildcard flag. Rules ending
@@ -274,7 +274,7 @@ module NewRelic
274
274
 
275
275
  def initialize(attribute_name, destinations, is_include)
276
276
  @attribute_name = attribute_name.sub(/\*$/, '')
277
- @wildcard = attribute_name.end_with?('*')
277
+ @wildcard = attribute_name.end_with?(ASTERISK)
278
278
  @is_include = is_include
279
279
  @destinations = is_include ? destinations : ~destinations
280
280
  end