Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions lib/appsignal/integrations/code_ownership.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ module Integrations
module CodeOwnershipIntegration
class << self
def before_complete(transaction, error)
return unless error

team = ::CodeOwnership.for_backtrace(error.backtrace)
transaction.add_tags(:owner => team.name) if team
rescue => ex
Expand Down
11 changes: 11 additions & 0 deletions spec/lib/appsignal/integrations/code_ownership_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,17 @@
expect(transaction).to_not include_tags("owner" => anything)
expect(logs).to be_empty
end

it "handles transactions without errors" do
transaction = create_transaction

logs = capture_logs do
transaction.complete
end

expect(transaction).to_not include_tags("owner" => anything)
expect(logs).to be_empty
end
end
end

Expand Down
Loading