Skip to content

Commit

Permalink
Merge pull request #1811 from newrelic/activejob_metric_rename
Browse files Browse the repository at this point in the history
Remove MessageBroker metric for ActiveJob
  • Loading branch information
hannahramadan authored Feb 9, 2023
2 parents a6f3b77 + 2864447 commit 70fed2a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@

The previously deprecated `NewRelic::Agent.disable_transaction_tracing` method has been removed. Users are encouraged to use `NewRelic::Agent.disable_all_tracing` or `NewRelic::Agent.ignore_transaction`.

- **Renamed ActiveJob metrics**

Previously, ActiveJob was categorized as a message broker, which is inaccurate. We've updated the naming of ActiveJob traces from leading with `MessageBroker/ActiveJob` to simply leading with `ActiveJob`.

- **Code cleanup**

Thank you to community member [@esquith](https://github.com/esquith) for contributing some cleanup of orphaned constants in our code base. [PR#1793](https://github.com/newrelic/newrelic-ruby-agent/pull/1793) [PR#1794](https://github.com/newrelic/newrelic-ruby-agent/pull/1794)
Expand Down
2 changes: 1 addition & 1 deletion lib/new_relic/agent/instrumentation/active_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def self.perform(job, block)
end

def self.run_in_trace(job, block, event)
trace_execution_scoped("MessageBroker/#{adapter}/Queue/#{event}/Named/#{job.queue_name}",
trace_execution_scoped("ActiveJob/#{adapter.sub(/^ActiveJob::/, '')}/Queue/#{event}/Named/#{job.queue_name}",
code_information: code_information_for_job(job)) do
block.call
end
Expand Down
4 changes: 2 additions & 2 deletions test/multiverse/suites/rails/activejob_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def after_teardown
end
end

ENQUEUE_PREFIX = "MessageBroker/ActiveJob::Inline/Queue/Produce/Named"
PERFORM_PREFIX = "MessageBroker/ActiveJob::Inline/Queue/Consume/Named"
ENQUEUE_PREFIX = "ActiveJob/Inline/Queue/Produce/Named"
PERFORM_PREFIX = "ActiveJob/Inline/Queue/Consume/Named"

PERFORM_TRANSACTION_NAME = 'OtherTransaction/ActiveJob::Inline/MyJob/execute'
PERFORM_TRANSACTION_ROLLUP = 'OtherTransaction/ActiveJob::Inline/all'
Expand Down

0 comments on commit 70fed2a

Please sign in to comment.