Skip to content

Commit

Permalink
standardizing exception tags (dependabot#8836)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakecoffman authored Jan 18, 2024
1 parent 715b254 commit 8b2918a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion updater/bin/fetch_files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class UpdaterKilledError < StandardError; end
trap("TERM") do
puts "Received SIGTERM"
error = UpdaterKilledError.new("Updater process killed with SIGTERM")
tags = { update_job_id: ENV.fetch("DEPENDABOT_JOB_ID", nil) }
tags = { "gh.dependabot_api.update_job.id": ENV.fetch("DEPENDABOT_JOB_ID", nil) }
Raven.capture_exception(error, tags: tags)
exit
end
Expand Down
2 changes: 1 addition & 1 deletion updater/bin/update_files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class UpdaterKilledError < StandardError; end
trap("TERM") do
puts "Received SIGTERM"
error = UpdaterKilledError.new("Updater process killed with SIGTERM")
tags = { update_job_id: ENV.fetch("DEPENDABOT_JOB_ID", nil) }
tags = { "gh.dependabot_api.update_job.id": ENV.fetch("DEPENDABOT_JOB_ID", nil) }
Raven.capture_exception(error, tags: tags)
exit
end
Expand Down
6 changes: 3 additions & 3 deletions updater/lib/dependabot/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ def capture_exception(error:, job: nil, dependency: nil, dependency_group: nil,
error,
{
tags: tags.merge({
update_job_id: job&.id,
package_manager: job&.package_manager,
repo_private: job&.repo_private?
"gh.dependabot_api.update_job.id": job&.id,
"gh.dependabot_api.update_config.package_manager": job&.package_manager,
"gh.repo.is_private": job&.repo_private?
}.compact),
extra: extra.merge({
dependency_name: dependency&.name,
Expand Down
6 changes: 3 additions & 3 deletions updater/spec/dependabot/service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@
expect(Raven).to have_received(:capture_exception)
.with(error,
tags: {
update_job_id: 1234,
package_manager: "bundler",
repo_private: false
"gh.dependabot_api.update_job.id": 1234,
"gh.dependabot_api.update_config.package_manager": "bundler",
"gh.repo.is_private": false
},
extra: {},
user: {
Expand Down

0 comments on commit 8b2918a

Please sign in to comment.