Skip to content

Commit

Permalink
Change default Rake task namespace to rake (#1202)
Browse files Browse the repository at this point in the history
  • Loading branch information
tombruijn authored Jul 24, 2024
1 parent 1b1880a commit 7673b13
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changesets/rake-task-namespace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
bump: major
type: change
---

Change the default Rake task namespace to "rake". Previously, Rake tasks were reported in the "background" namespace.
3 changes: 2 additions & 1 deletion lib/appsignal/integrations/rake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def execute(*args)
params, _ = args
params = params.to_hash if params.respond_to?(:to_hash)
transaction.set_params_if_nil(params)
transaction.set_params_if_nil(params)
transaction.set_action(name)
transaction.complete
end
Expand All @@ -33,7 +34,7 @@ def execute(*args)
private

def _appsignal_create_transaction
Appsignal::Transaction.create(Appsignal::Transaction::BACKGROUND_JOB)
Appsignal::Transaction.create("rake")
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/lib/appsignal/hooks/rake_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def perform

transaction = last_transaction
expect(transaction).to have_id
expect(transaction).to have_namespace(Appsignal::Transaction::BACKGROUND_JOB)
expect(transaction).to have_namespace("rake")
expect(transaction).to have_action("task:name")
expect(transaction).to_not have_error
expect(transaction).to include_params("foo" => "bar")
Expand Down Expand Up @@ -88,7 +88,7 @@ def perform

transaction = last_transaction
expect(transaction).to have_id
expect(transaction).to have_namespace(Appsignal::Transaction::BACKGROUND_JOB)
expect(transaction).to have_namespace("rake")
expect(transaction).to have_action("task:name")
expect(transaction).to have_error("ExampleException", "error message")
expect(transaction).to include_params("foo" => "bar")
Expand Down

0 comments on commit 7673b13

Please sign in to comment.