Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
- **Breaking Change: Removed support for Ruby 2.4 and 2.5**
Support for Ruby versions 2.4 and 2.5 has been removed. The new minimum required Ruby version is now 2.6. [PR#3314](https://github.com/newrelic/newrelic-ruby-agent/pull/3314)

- **Breaking Change: Renamed ActiveJob metrics**
ActiveJob metrics have been updated to include the job's class name for more specific reporting. This is a breaking change and may require updating custom dashboards or alerts. [PR#3320](https://github.com/newrelic/newrelic-ruby-agent/pull/3320)
- Old format: `Ruby/ActiveJob/<QueueName>/<Method>`
- New format: `Ruby/ActiveJob/<ClassName>/<QueueName>/<Method>`

## v9.23.0

- **Feature: Deprecation notice for recording deployments using Capistrano**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ def metric_name(name, payload)
job = payload[:job] || payload[:jobs].first

queue = job.queue_name
job_class = job.class.name.split('::').last
method = method_from_name(name)
"Ruby/ActiveJob/#{queue}/#{method}"
"Ruby/ActiveJob/#{job_class}/#{queue}/#{method}"
end

PATTERN = /\A([^\.]+)\.active_job\z/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ class ActiveJobSubscriberTest < Minitest::Test
SUBSCRIBER = NewRelic::Agent::Instrumentation::ActiveJobSubscriber.new

def test_segment_naming_with_unknown_method
assert_equal 'Ruby/ActiveJob/default/Unknown',
assert_equal 'Ruby/ActiveJob/TestJob/default/Unknown',
SUBSCRIBER.send(:metric_name, 'indecipherable', {job: TestJob.new})
end

def test_segment_naming_multiple_jobs
assert_equal 'Ruby/ActiveJob/default/Unknown',
assert_equal 'Ruby/ActiveJob/TestJob/default/Unknown',
SUBSCRIBER.send(:metric_name, 'indecipherable', {jobs: [TestJob.new, TestJob.new]})
end

Expand Down Expand Up @@ -109,7 +109,7 @@ def validate_transaction(txn, methods = [])
refute_empty segments

methods.each do |method|
segment = segments.detect { |s| s.name == "Ruby/ActiveJob/default/#{method}" }
segment = segments.detect { |s| s.name == "Ruby/ActiveJob/TestJob/default/#{method}" }

assert segment

Expand Down
Loading