Skip to content

Commit

Permalink
Add packageid to sentry context when using update-all
Browse files Browse the repository at this point in the history
  • Loading branch information
kayone committed May 17, 2019
1 parent 229fcbc commit 3cf2d7d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/AppGet/Update/UpdateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;
using System.Threading.Tasks;
using AppGet.HostSystem;
using AppGet.Infrastructure.Logging;
using AppGet.Installers;
using AppGet.Manifest;
using AppGet.PackageRepository;
Expand Down Expand Up @@ -70,6 +71,8 @@ public async Task UpdateAllPackages(InstallInteractivityLevel interactivityLevel
{
var update = toInstall[index];

SentryTarget.AddTag("packageid", update.PackageId);

try
{
_logger.Info("Installing update {0} of {1}", index + 1, toInstall.Count);
Expand All @@ -86,6 +89,10 @@ public async Task UpdateAllPackages(InstallInteractivityLevel interactivityLevel
_logger.Fatal(e, "An error occurred while updating {0}", update.PackageId);
failed++;
}
finally
{
SentryTarget.AddTag("packageid", null);
}
}

Console.WriteLine();
Expand Down

0 comments on commit 3cf2d7d

Please sign in to comment.