newrelic_rpm 9.5.0 → 9.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +154 -7
- data/CONTRIBUTING.md +0 -7
- data/README.md +1 -1
- data/Rakefile +1 -1
- data/bin/newrelic +2 -9
- data/bin/newrelic_rpm +15 -0
- data/init.rb +2 -2
- data/lib/new_relic/agent/agent.rb +1 -1
- data/lib/new_relic/agent/agent_helpers/shutdown.rb +1 -1
- data/lib/new_relic/agent/agent_helpers/special_startup.rb +1 -1
- data/lib/new_relic/agent/agent_helpers/start_worker_thread.rb +2 -2
- data/lib/new_relic/agent/agent_helpers/startup.rb +2 -2
- data/lib/new_relic/agent/attribute_filter.rb +3 -3
- data/lib/new_relic/agent/configuration/default_source.rb +131 -36
- data/lib/new_relic/agent/configuration/high_security_source.rb +1 -0
- data/lib/new_relic/agent/configuration/manager.rb +13 -9
- data/lib/new_relic/agent/configuration/security_policy_source.rb +11 -0
- data/lib/new_relic/agent/custom_event_aggregator.rb +27 -1
- data/lib/new_relic/agent/datastores/mongo/metric_translator.rb +1 -1
- data/lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb +3 -3
- data/lib/new_relic/agent/error_collector.rb +2 -0
- data/lib/new_relic/agent/event_loop.rb +1 -1
- data/lib/new_relic/agent/http_clients/abstract.rb +4 -0
- data/lib/new_relic/agent/http_clients/async_http_wrappers.rb +80 -0
- data/lib/new_relic/agent/http_clients/curb_wrappers.rb +1 -3
- data/lib/new_relic/agent/http_clients/ethon_wrappers.rb +109 -0
- data/lib/new_relic/agent/http_clients/excon_wrappers.rb +0 -3
- data/lib/new_relic/agent/http_clients/http_rb_wrappers.rb +1 -3
- data/lib/new_relic/agent/http_clients/httpclient_wrappers.rb +0 -3
- data/lib/new_relic/agent/http_clients/httpx_wrappers.rb +91 -0
- data/lib/new_relic/agent/http_clients/net_http_wrappers.rb +1 -4
- data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +0 -3
- data/lib/new_relic/agent/instrumentation/active_merchant.rb +1 -1
- data/lib/new_relic/agent/instrumentation/active_record_helper.rb +1 -2
- data/lib/new_relic/agent/instrumentation/active_support_broadcast_logger/chain.rb +69 -0
- data/lib/new_relic/agent/instrumentation/active_support_broadcast_logger/instrumentation.rb +17 -0
- data/lib/new_relic/agent/instrumentation/active_support_broadcast_logger/prepend.rb +37 -0
- data/lib/new_relic/agent/instrumentation/active_support_broadcast_logger.rb +23 -0
- data/lib/new_relic/agent/instrumentation/active_support_logger.rb +3 -1
- data/lib/new_relic/agent/instrumentation/async_http/chain.rb +23 -0
- data/lib/new_relic/agent/instrumentation/async_http/instrumentation.rb +37 -0
- data/lib/new_relic/agent/instrumentation/async_http/prepend.rb +15 -0
- data/lib/new_relic/agent/instrumentation/async_http.rb +28 -0
- data/lib/new_relic/agent/instrumentation/concurrent_ruby.rb +1 -0
- data/lib/new_relic/agent/instrumentation/elasticsearch/instrumentation.rb +1 -1
- data/lib/new_relic/agent/instrumentation/ethon/chain.rb +39 -0
- data/lib/new_relic/agent/instrumentation/ethon/instrumentation.rb +105 -0
- data/lib/new_relic/agent/instrumentation/ethon/prepend.rb +35 -0
- data/lib/new_relic/agent/instrumentation/ethon.rb +39 -0
- data/lib/new_relic/agent/instrumentation/fiber/instrumentation.rb +1 -4
- data/lib/new_relic/agent/instrumentation/grpc_server.rb +1 -1
- data/lib/new_relic/agent/instrumentation/httpx/chain.rb +20 -0
- data/lib/new_relic/agent/instrumentation/httpx/instrumentation.rb +51 -0
- data/lib/new_relic/agent/instrumentation/httpx/prepend.rb +15 -0
- data/lib/new_relic/agent/instrumentation/httpx.rb +27 -0
- data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +1 -3
- data/lib/new_relic/agent/instrumentation/net_http/instrumentation.rb +7 -1
- data/lib/new_relic/agent/instrumentation/rails_notifications/action_controller.rb +1 -0
- data/lib/new_relic/agent/instrumentation/roda/ignorer.rb +45 -0
- data/lib/new_relic/agent/instrumentation/roda/instrumentation.rb +12 -0
- data/lib/new_relic/agent/instrumentation/roda/roda_transaction_namer.rb +1 -2
- data/lib/new_relic/agent/instrumentation/roda.rb +2 -0
- data/lib/new_relic/agent/instrumentation/ruby_openai/chain.rb +36 -0
- data/lib/new_relic/agent/instrumentation/ruby_openai/instrumentation.rb +197 -0
- data/lib/new_relic/agent/instrumentation/ruby_openai/prepend.rb +20 -0
- data/lib/new_relic/agent/instrumentation/ruby_openai.rb +35 -0
- data/lib/new_relic/agent/instrumentation/sidekiq.rb +3 -1
- data/lib/new_relic/agent/instrumentation/sinatra/ignorer.rb +1 -1
- data/lib/new_relic/agent/instrumentation/sinatra/transaction_namer.rb +1 -3
- data/lib/new_relic/agent/instrumentation/sinatra.rb +1 -1
- data/lib/new_relic/agent/instrumentation/thread/instrumentation.rb +1 -4
- data/lib/new_relic/agent/instrumentation/view_component/chain.rb +21 -0
- data/lib/new_relic/agent/instrumentation/view_component/instrumentation.rb +39 -0
- data/lib/new_relic/agent/instrumentation/view_component/prepend.rb +13 -0
- data/lib/new_relic/agent/instrumentation/view_component.rb +26 -0
- data/lib/new_relic/agent/javascript_instrumentor.rb +0 -1
- data/lib/new_relic/agent/llm/chat_completion_message.rb +25 -0
- data/lib/new_relic/agent/llm/chat_completion_summary.rb +66 -0
- data/lib/new_relic/agent/llm/embedding.rb +60 -0
- data/lib/new_relic/agent/llm/llm_event.rb +95 -0
- data/lib/new_relic/agent/llm/response_headers.rb +80 -0
- data/lib/new_relic/agent/llm.rb +49 -0
- data/lib/new_relic/agent/messaging.rb +2 -2
- data/lib/new_relic/agent/monitors/synthetics_monitor.rb +12 -1
- data/lib/new_relic/agent/new_relic_service/encoders.rb +2 -2
- data/lib/new_relic/agent/new_relic_service.rb +8 -6
- data/lib/new_relic/agent/obfuscator.rb +0 -2
- data/lib/new_relic/agent/pipe_channel_manager.rb +2 -2
- data/lib/new_relic/agent/rules_engine/segment_terms_rule.rb +1 -2
- data/lib/new_relic/agent/rules_engine.rb +1 -1
- data/lib/new_relic/agent/span_event_primitive.rb +16 -4
- data/lib/new_relic/agent/sql_sampler.rb +0 -1
- data/lib/new_relic/agent/system_info.rb +26 -0
- data/lib/new_relic/agent/threading/agent_thread.rb +1 -2
- data/lib/new_relic/agent/tracer.rb +9 -10
- data/lib/new_relic/agent/transaction/abstract_segment.rb +4 -1
- data/lib/new_relic/agent/transaction/external_request_segment.rb +5 -2
- data/lib/new_relic/agent/transaction/message_broker_segment.rb +1 -2
- data/lib/new_relic/agent/transaction/request_attributes.rb +1 -3
- data/lib/new_relic/agent/transaction/tracing.rb +11 -1
- data/lib/new_relic/agent/transaction.rb +25 -2
- data/lib/new_relic/agent/transaction_error_primitive.rb +16 -0
- data/lib/new_relic/agent/transaction_event_primitive.rb +19 -0
- data/lib/new_relic/agent/utilization/gcp.rb +1 -3
- data/lib/new_relic/agent/vm/{mri_vm.rb → c_ruby_vm.rb} +7 -15
- data/lib/new_relic/agent/vm.rb +2 -2
- data/lib/new_relic/agent/worker_loop.rb +1 -1
- data/lib/new_relic/agent.rb +102 -7
- data/lib/new_relic/base64.rb +25 -0
- data/lib/new_relic/cli/command.rb +6 -4
- data/lib/new_relic/constants.rb +5 -0
- data/lib/new_relic/control/frameworks/rails.rb +17 -5
- data/lib/new_relic/control/instrumentation.rb +1 -1
- data/lib/new_relic/language_support.rb +4 -0
- data/lib/new_relic/local_environment.rb +22 -13
- data/lib/new_relic/rack/browser_monitoring.rb +8 -4
- data/lib/new_relic/supportability_helper.rb +3 -1
- data/lib/new_relic/thread_local_storage.rb +31 -0
- data/lib/new_relic/version.rb +1 -1
- data/lib/tasks/config.rake +1 -1
- data/lib/tasks/helpers/config.html.erb +6 -6
- data/lib/tasks/helpers/newrelicyml.rb +1 -1
- data/lib/tasks/instrumentation_generator/instrumentation.thor +3 -3
- data/lib/tasks/instrumentation_generator/templates/chain.tt +0 -1
- data/lib/tasks/instrumentation_generator/templates/chain_method.tt +0 -1
- data/lib/tasks/tests.rake +71 -0
- data/newrelic.yml +76 -36
- data/newrelic_rpm.gemspec +5 -4
- data/test/agent_helper.rb +14 -2
- metadata +43 -7
- data/bin/newrelic_cmd +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fac159d955f3aaf1b926d68335c05f8bbea9fa3089bed68bee11f9bb50243361
|
4
|
+
data.tar.gz: 783c82413e45080741cbc9fd9fe0488b59cede5b64d359af46cf524d871b7763
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae3deb3425be91f81d30fd76f6af95ec2ff573f2941e17474cbc96cadd70baa7eda534fcb8886ed039b71eba202d81ef9098600e307dcdf27919f84612eea15d
|
7
|
+
data.tar.gz: 4000a2bd73ea4eee6853878630d777226c39af0b46aafa8946bc167495728dc754136731162e660e6fbc895d2df1ca12709e3d2e60be4df8ae5f09035e072cfe
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,152 @@
|
|
1
1
|
# New Relic Ruby Agent Release Notes
|
2
2
|
|
3
|
+
## v9.8.0
|
4
|
+
|
5
|
+
Version 9.8.0 introduces instrumentation for ruby-openai, adds the option to store tracer state on the thread-level, hardens the browser agent insertion logic to better proactively anticipate errors, and prevents excpetions from being raised in the Active Support Broadcast logger instrumentation.
|
6
|
+
|
7
|
+
- **Feature: Add instrumentation for ruby-openai**
|
8
|
+
|
9
|
+
Instrumentation has been added for the [ruby-openai](https://github.com/alexrudall/ruby-openai) gem, supporting versions 3.4.0 and higher [(PR#2442)](https://github.com/newrelic/newrelic-ruby-agent/pull/2442). While ruby-openai instrumentation is enabled by default, the configuration option `ai_monitoring.enabled` is disabled by default and controls all AI monitoring. `ai_monitoring.enabled` must be set to `true` in order to receive ruby-openai instrumentation. High-Security Mode must be disabled in order to receive AI monitoring.
|
10
|
+
|
11
|
+
Calls to embedding and chat completion endpoints are automatically traced. These events can be enhanced with the introduction of two new APIs. Custom attributes can also be added to LLM events using the API `NewRelic::Agent.add_custom_attributes`, but they must be prefixed with `llm.`. For example, `NewRelic::Agent.add_custom_attributes({'llm.user_id': user_id})`.
|
12
|
+
|
13
|
+
- **Feature: Add AI monitoring APIs**
|
14
|
+
|
15
|
+
This version introduces two new APIs that allow users to record additional information on LLM events:
|
16
|
+
* `NewRelic::Agent.record_llm_feedback_event` - Records user feedback events.
|
17
|
+
* `NewRelic::Agent.set_llm_token_count_callback` - Sets a callback proc for calculating `token_count` attributes for embedding and chat completion message events.
|
18
|
+
|
19
|
+
Visit [RubyDoc](https://rubydoc.info/github/newrelic/newrelic-ruby-agent/) for more information on each of these APIs.
|
20
|
+
|
21
|
+
- **Feature: Store tracer state on thread-level**
|
22
|
+
|
23
|
+
A new configuration option, `thread_local_tracer_state`, stores New Relic's tracer state on the thread-level, as opposed to the default fiber-level storage. This configuration is turned off by default. Our thanks go to community member [@markiz](https://github.com/markiz) who contributed the idea, code, configuration option, and tests for this new feature! [PR#2475](https://github.com/newrelic/newrelic-ruby-agent/pull/2475).
|
24
|
+
|
25
|
+
- **Bugfix: Harden the browser agent insertion logic**
|
26
|
+
|
27
|
+
With [Issue#2462](https://github.com/newrelic/newrelic-ruby-agent/issues/2462), community member [@miry](https://github.com/miry) explained that it was possible for an HTTP response headers hash to have symbols for values. Not only would these symbols prevent the inclusion of the New Relic browser agent tag in the response body, but more importantly they would cause an exception that would bubble up to the monitored web application itself. With [PR#2465](https://github.com/newrelic/newrelic-ruby-agent/pull/2465) symbol based values are now supported and all other potential future exceptions are now handled. Additionally, the refactor to support symbols has been shown through benchmarking to give the processing of string and mixed type hashes a slight speed boost too.
|
28
|
+
|
29
|
+
- **Bugfix: Prevent Exception in Active Support Broadcast logger instrumentation**
|
30
|
+
|
31
|
+
Previously, in certain situations the agent could cause an exception to be raised when attempting to interact with a broadcast log event. This has been fixed. Thanks to [@nathan-appere](https://github.com/nathan-appere) for reporting this issue and providing a fix! [PR#2510](https://github.com/newrelic/newrelic-ruby-agent/pull/2510)
|
32
|
+
|
33
|
+
|
34
|
+
## v9.7.1
|
35
|
+
|
36
|
+
Version 9.7.1 fixes a ViewComponent instrumentation bug and enforces maximum size limits for custom event attributes.
|
37
|
+
|
38
|
+
- **Bugfix: Stop suppressing ViewComponent errors**
|
39
|
+
|
40
|
+
Previously, the agent suppressed ViewComponent render errors. The agent now reports these errors and allows them to raise. Thank you [@mjacobus](https://github.com/mjacobus) for reporting this bug and providing a fix! [PR#2410](https://github.com/newrelic/newrelic-ruby-agent/pull/2410)
|
41
|
+
|
42
|
+
- **Bugfix: Enforce maximum size limits for custom event attributes**
|
43
|
+
|
44
|
+
Previously, the agent would allow custom event attributes to be any size. This would lead to the New Relic backend dropping attributes larger than the maximum size. Now, the agent will truncate custom event attribute values to 4095 characters, attribute names to 255 characters, and the total count of attributes to 64. [PR#2401](https://github.com/newrelic/newrelic-ruby-agent/pull/2401)
|
45
|
+
|
46
|
+
## v9.7.0
|
47
|
+
|
48
|
+
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.
|
49
|
+
|
50
|
+
- **Feature: ViewComponent instrumentation**
|
51
|
+
|
52
|
+
[ViewComponent](https://viewcomponent.org/) is a now an instrumented library. [PR#2367](https://github.com/newrelic/newrelic-ruby-agent/pull/2367)
|
53
|
+
|
54
|
+
- **Feature: Use root path to access Elasticsearch cluster name**
|
55
|
+
|
56
|
+
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 (`/`).
|
57
|
+
|
58
|
+
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)
|
59
|
+
|
60
|
+
- **Feature: Remove base64 dependency, use direct calls to String methods**
|
61
|
+
|
62
|
+
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.
|
63
|
+
|
64
|
+
To resolve this, the agent now directly calls the `String` methods used in the `base64` library in the new `NewRelic::Base64` module.
|
65
|
+
|
66
|
+
Thank you, [@Earlopain](https://github.com/Earlopain), for submitting this change. [PR#2378](https://github.com/newrelic/newrelic-ruby-agent/pull/2378)
|
67
|
+
|
68
|
+
- **Feature: Add Falcon support**
|
69
|
+
|
70
|
+
The agent now supports the web server [Falcon](https://socketry.github.io/falcon/). [PR#2383](https://github.com/newrelic/newrelic-ruby-agent/pull/2383)
|
71
|
+
|
72
|
+
- **Feature: Remove spans with name Ruby/Thread and Ruby/Fiber**
|
73
|
+
|
74
|
+
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)
|
75
|
+
|
76
|
+
## v9.6.0
|
77
|
+
|
78
|
+
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.
|
79
|
+
|
80
|
+
- **Feature: Add instrumentation for Async::HTTP**
|
81
|
+
|
82
|
+
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)
|
83
|
+
|
84
|
+
- **Feature: Add instrumentation for Ethon**
|
85
|
+
|
86
|
+
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)
|
87
|
+
|
88
|
+
- **Feature: Add instrumentation for HTTPX**
|
89
|
+
|
90
|
+
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)
|
91
|
+
|
92
|
+
- **Feature: Prevent the agent from starting in "rails" commands in Rails 7**
|
93
|
+
|
94
|
+
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)
|
95
|
+
|
96
|
+
- **Feature: Glean Docker container ID for cgroups v2-based containers**
|
97
|
+
|
98
|
+
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).
|
99
|
+
|
100
|
+
- **Feature: Update events with additional synthetics attributes when available**
|
101
|
+
|
102
|
+
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)
|
103
|
+
|
104
|
+
- **Feature: Declare a gem dependency on the Ruby Base 64 gem 'base64'**
|
105
|
+
|
106
|
+
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)
|
107
|
+
|
108
|
+
- **Feature: Add Roda support for the newrelic_ignore\* family of methods**
|
109
|
+
|
110
|
+
The agent can now selectively disable instrumentation for particular requests within Roda applications. Supported methods include:
|
111
|
+
- `newrelic_ignore`: ignore a given route.
|
112
|
+
- `newrelic_ignore_apdex`: exclude a given route from consideration in overall Apdex calculations.
|
113
|
+
- `newrelic_ignore_enduser`: prevent automatic injection of the page load timing JavaScript when a route is rendered.
|
114
|
+
|
115
|
+
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)
|
116
|
+
|
117
|
+
- **Feature: Add additional span attributes for OpenTelemetry compatibility**
|
118
|
+
|
119
|
+
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.
|
120
|
+
|
121
|
+
Datastore segments now offer 3 additional attributes:
|
122
|
+
- `db.system`: The database system. For Ruby we use the database adapter name here.
|
123
|
+
- `server.address`: The database host.
|
124
|
+
- `server.port`: The database port.
|
125
|
+
|
126
|
+
External request segments now offer 3 additional attributes:
|
127
|
+
- `http.request.method`: The HTTP method (ex: 'GET')
|
128
|
+
- `server.address`: The target host.
|
129
|
+
- `server.port`: The target port.
|
130
|
+
|
131
|
+
For maximum backwards compatibility, no existing attributes have been renamed or removed. [PR#2283](https://github.com/newrelic/newrelic-ruby-agent/pull/2283)
|
132
|
+
|
133
|
+
- **Bugfix: Stop sending duplicate log events for Rails 7.1 users**
|
134
|
+
|
135
|
+
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)
|
136
|
+
|
137
|
+
- **Bugfix: Resolve Sidekiq 8.0 error handler deprecation warning**
|
138
|
+
|
139
|
+
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)
|
140
|
+
|
141
|
+
- **Community: Resolve technical debt**
|
142
|
+
|
143
|
+
We also received some great contributions from community members to resolve some outstanding technical debt issues. Thank you for your contributions!
|
144
|
+
* Add and Replace SLASH and ROOT constants: [PR#2256](https://github.com/newrelic/newrelic-ruby-agent/pull/2256) [chahmedejaz](https://github.com/chahmedejaz)
|
145
|
+
* Remove pry as a dev dependency: PR#2665, PR#2273, AlajeBash (profile no longer active)
|
146
|
+
* Replace "start up" with "start-up": [PR#2249](https://github.com/newrelic/newrelic-ruby-agent/pull/2249) [chahmedejaz](https://github.com/chahmedejaz)
|
147
|
+
* Remove unused variables in test suites: [PR#2250](https://github.com/newrelic/newrelic-ruby-agent/pull/2250)
|
148
|
+
|
149
|
+
|
3
150
|
## v9.5.0
|
4
151
|
|
5
152
|
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 +582,7 @@ Version 8.15.0 of the agent confirms compatibility with Ruby 3.2.0, adds instrum
|
|
435
582
|
|
436
583
|
| Configuration name | Default | Behavior |
|
437
584
|
| --------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
438
|
-
| `instrumentation.concurrent_ruby` | auto | Controls auto-instrumentation of the concurrent-ruby library at start
|
585
|
+
| `instrumentation.concurrent_ruby` | auto | Controls auto-instrumentation of the concurrent-ruby library at start-up. May be one of `auto`, `prepend`, `chain`, `disabled`. |
|
439
586
|
|
440
587
|
- **Infinite Tracing: Use batching and compression**
|
441
588
|
|
@@ -534,7 +681,7 @@ Version 8.12.0 of the agent delivers new Elasticsearch instrumentation, increase
|
|
534
681
|
|
535
682
|
| Configuration name | Default | Behavior |
|
536
683
|
| --------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
537
|
-
| `instrumentation.elasticsearch` | auto | Controls auto-instrumentation of the elasticsearch library at start
|
684
|
+
| `instrumentation.elasticsearch` | auto | Controls auto-instrumentation of the elasticsearch library at start-up. May be one of `auto`, `prepend`, `chain`, `disabled`. |
|
538
685
|
| `elasticsearch.capture_queries` | true | If `true`, the agent captures Elasticsearch queries in transaction traces. |
|
539
686
|
| `elasticsearch.obfuscate_queries` | true | If `true`, the agent obfuscates Elasticsearch queries in transaction traces. |
|
540
687
|
|
@@ -1149,7 +1296,7 @@ The multiverse collection of test suites requires a variety of data handling sof
|
|
1149
1296
|
- **Bugfix: Prevent browser monitoring middleware from installing to middleware multiple times**
|
1150
1297
|
|
1151
1298
|
In rare cases on jRuby, the BrowserMonitoring middleware could attempt to install itself
|
1152
|
-
multiple times at start
|
1299
|
+
multiple times at start-up. This bug fix addresses that by using a mutex to introduce
|
1153
1300
|
thread safety to the operation. Sintra in particular can have this race condition because
|
1154
1301
|
its middleware stack is not installed until the first request is received.
|
1155
1302
|
|
@@ -1160,7 +1307,7 @@ The multiverse collection of test suites requires a variety of data handling sof
|
|
1160
1307
|
- **Bugfix: nil Middlewares injection now prevented and gracefully handled in Sinatra**
|
1161
1308
|
|
1162
1309
|
Previously, the agent could potentially inject multiples of an instrumented middleware if Sinatra received many
|
1163
|
-
requests at once during start
|
1310
|
+
requests at once during start-up and initialization due to Sinatra's ability to delay full start-up as long as possible.
|
1164
1311
|
This has now been fixed and the Ruby agent correctly instruments only once as well as gracefully handles nil middleware
|
1165
1312
|
classes in general.
|
1166
1313
|
|
@@ -1391,7 +1538,7 @@ The multiverse collection of test suites requires a variety of data handling sof
|
|
1391
1538
|
|
1392
1539
|
- **Additional Transaction Information applied to Span Events**
|
1393
1540
|
|
1394
|
-
When Distributed Tracing and/or Infinite Tracing are enabled, the
|
1541
|
+
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
1542
|
|
1396
1543
|
The following items are affected:
|
1397
1544
|
|
@@ -3377,7 +3524,7 @@ For more details on our Resque support, see https://docs.newrelic.com/docs/agent
|
|
3377
3524
|
- Support agent when starting Resque Pool from Rake task
|
3378
3525
|
|
3379
3526
|
When running resque-pool with its provided rake tasks, the agent would not
|
3380
|
-
start
|
3527
|
+
start-up properly. Thanks Tiago Sousa for the fix!
|
3381
3528
|
|
3382
3529
|
- Fix for DelayedJob + Rails 4.x queue depth metrics
|
3383
3530
|
|
@@ -5321,7 +5468,7 @@ Agent improvements to support future RPM enhancements
|
|
5321
5468
|
- fix incompatibility in the developer mode with the safe_erb plugin
|
5322
5469
|
- fix module namespace issue causing an error accessing
|
5323
5470
|
NewRelic::Instrumentation modules
|
5324
|
-
- fix issue where the agent sometimes failed to start
|
5471
|
+
- fix issue where the agent sometimes failed to start-up if there was a
|
5325
5472
|
transient network problem
|
5326
5473
|
- fix IgnoreSilentlyException message
|
5327
5474
|
|
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/README.md
CHANGED
@@ -119,7 +119,7 @@ If you have any questions, or to execute our corporate CLA (required if your con
|
|
119
119
|
|
120
120
|
As noted in our [security policy](https://github.com/newrelic/newrelic-ruby-agent/security/policy), New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals.
|
121
121
|
|
122
|
-
If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through [
|
122
|
+
If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through [our bug bounty program](https://docs.newrelic.com/docs/security/security-privacy/information-security/report-security-vulnerabilities/).
|
123
123
|
|
124
124
|
If you would like to contribute to this project, please review [these guidelines](https://github.com/newrelic/newrelic-ruby-agent/blob/main/CONTRIBUTING.md).
|
125
125
|
|
data/Rakefile
CHANGED
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
|
-
|
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
|
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
|
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
|
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.
|
@@ -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
|
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
|
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
|
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
|
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
|
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
|
-
#
|
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
|