Browse Source

add bugsnag error reporting (#665)

pull/666/head
Jason Dove 4 years ago committed by GitHub
parent
commit
9e2f445785
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      CHANGELOG.md
  2. 7
      ErsatzTV.Core/Errors/BugsnagConfiguration.cs
  3. 1
      ErsatzTV/ErsatzTV.csproj
  4. 19
      ErsatzTV/Startup.cs
  5. 4
      ErsatzTV/appsettings.json

4
CHANGELOG.md

@ -10,6 +10,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -10,6 +10,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix playback of interlaced mpeg2video content with NVIDIA acceleration
- Fix playback of all interlaced content with QSV acceleration
### Added
- Add automated error reporting via Bugsnag
- This can be disabled by editing the `appsettings.json` file or by setting the `Bugsnag:Enable` environment variable to `false`
### Changed
- Framerate normalization will never normalize framerate below 24fps
- Instead, content with a lower framerate will be normalized up to 24fps

7
ErsatzTV.Core/Errors/BugsnagConfiguration.cs

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
namespace ErsatzTV.Core.Errors;
public class BugsnagConfiguration
{
public string ApiKey { get; set; }
public bool Enable { get; set; }
}

1
ErsatzTV/ErsatzTV.csproj

@ -12,6 +12,7 @@ @@ -12,6 +12,7 @@
<ItemGroup>
<PackageReference Include="Blazored.LocalStorage" Version="4.2.0" />
<PackageReference Include="Bugsnag.AspNet.Core" Version="3.0.0" />
<PackageReference Include="FluentValidation" Version="10.3.6" />
<PackageReference Include="FluentValidation.AspNetCore" Version="10.3.6" />
<PackageReference Include="HtmlSanitizer" Version="7.1.475" />

19
ErsatzTV/Startup.cs

@ -5,6 +5,7 @@ using System.Reflection; @@ -5,6 +5,7 @@ using System.Reflection;
using System.Text;
using System.Threading.Channels;
using Blazored.LocalStorage;
using Bugsnag.AspNet.Core;
using Dapper;
using ErsatzTV.Application;
using ErsatzTV.Application.Channels.Queries;
@ -12,6 +13,7 @@ using ErsatzTV.Application.Streaming; @@ -12,6 +13,7 @@ using ErsatzTV.Application.Streaming;
using ErsatzTV.Application.Streaming.Commands;
using ErsatzTV.Core;
using ErsatzTV.Core.Emby;
using ErsatzTV.Core.Errors;
using ErsatzTV.Core.FFmpeg;
using ErsatzTV.Core.Health;
using ErsatzTV.Core.Health.Checks;
@ -80,6 +82,23 @@ namespace ErsatzTV @@ -80,6 +82,23 @@ namespace ErsatzTV
public void ConfigureServices(IServiceCollection services)
{
BugsnagConfiguration bugsnagConfig = Configuration.GetSection("Bugsnag").Get<BugsnagConfiguration>();
services.AddBugsnag(
configuration =>
{
configuration.ApiKey = bugsnagConfig.ApiKey;
configuration.ProjectNamespaces = new[] { "ErsatzTV" };
configuration.AppVersion = Assembly.GetEntryAssembly()
?.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
?.InformationalVersion ?? "unknown";
configuration.NotifyReleaseStages = new[] { "public" };
// effectively "disable" by tweaking app config
configuration.ReleaseStage = bugsnagConfig.Enable ? "public" : "private";
});
services.AddCors(
o => o.AddPolicy(
"AllowAll",

4
ErsatzTV/appsettings.json

@ -34,5 +34,9 @@ @@ -34,5 +34,9 @@
},
"Trakt": {
"ClientId": "5a4e78338b7f177cf980d6a8881dd5a52dee680746864e9e442b42d5f4d4ac82"
},
"Bugsnag": {
"ApiKey": "f59f3cc93cce91210a5c0f047eb2047c",
"Enable": true
}
}
Loading…
Cancel
Save