fix: resolve GlitchTip anomalies — DB retry, query filters, Sentry DSN, Workers tracking

- 🔴 Fix startup crash when DB is temporarily unavailable: add 5x retry
  with exponential backoff to Database.MigrateAsync() in API and Workers
- 🔴 Fix EF Core 'required navigation with query filter' warnings:
  add matching soft-delete query filters to AgentSetting, CameraCredentials,
  CameraDetectionProfile, UserSite
- 🔴 Add Sentry error tracking to Workers (Hangfire background jobs)
- 🟡 Make Sentry/GlitchTip DSN configurable via SENTRY_DSN env var
  (applies to API, Web, Agent, Workers)
- 🟡 Suppress EF Core RedundantIndexRemoved informational messages

Closes GlitchTip #538
This commit is contained in:
Arnaud Dartois committed 2026-07-18 20:31:37 +00:00
1 parent ee66cf5971
commit fdfd506977
7 files changed
+108 -34

No files matched your search

+4 -3
View File
@@ -4,15 +4,16 @@ using Heimdall.Web.Services;
using Microsoft.AspNetCore.Components.Authorization;
using MudBlazor.Services;
// ── Sentry (GlitchTip) — hardcoded DSN, not overridable by env ────
const string SentryDsn = "https://db94b9fc2f36425f9eb4b9f6f347dc73@glitchtip.tordais.cc/6";
// ── Sentry (GlitchTip) — DSN from env var, with hardcoded fallback ─
var sentryDsn = Environment.GetEnvironmentVariable("SENTRY_DSN")
?? "https://db94b9fc2f36425f9eb4b9f6f347dc73@glitchtip.tordais.cc/6";
var builder = WebApplication.CreateBuilder(args);
// ── Sentry ────────────────────────────────────────────────────────
builder.WebHost.UseSentry(options =>
{
options.Dsn = SentryDsn;
options.Dsn = sentryDsn;
options.MinimumBreadcrumbLevel = LogLevel.Debug;
options.MinimumEventLevel = LogLevel.Error;
options.TracesSampleRate = 0.1;