From cc522144049871e6eb41e6045cb70f17d0672d99 Mon Sep 17 00:00:00 2001 From: Arnaud Dartois Date: Sat, 18 Jul 2026 19:41:57 +0000 Subject: [PATCH] feat: add Sentry (GlitchTip) client to Api, Agent, Web Add Sentry.AspNetCore v6.7.0 with hardcoded DSN constant (not overridable by env) pointing to GlitchTip instance at https://glitchtip.tordais.cc/6. Same DSN configured across all three entry-point projects: - Heimdall.Api - Heimdall.Agent - Heimdall.Web --- src/Heimdall.Agent/Heimdall.Agent.csproj | 1 + src/Heimdall.Agent/Program.cs | 12 ++++++++++++ src/Heimdall.Api/Heimdall.Api.csproj | 1 + src/Heimdall.Api/Program.cs | 12 ++++++++++++ src/Heimdall.Web/Heimdall.Web.csproj | 1 + src/Heimdall.Web/Program.cs | 12 ++++++++++++ 6 files changed, 39 insertions(+) diff --git a/src/Heimdall.Agent/Heimdall.Agent.csproj b/src/Heimdall.Agent/Heimdall.Agent.csproj index 41a7c46..d802ca6 100644 --- a/src/Heimdall.Agent/Heimdall.Agent.csproj +++ b/src/Heimdall.Agent/Heimdall.Agent.csproj @@ -15,5 +15,6 @@ + diff --git a/src/Heimdall.Agent/Program.cs b/src/Heimdall.Agent/Program.cs index 8c7510a..9a63ba3 100644 --- a/src/Heimdall.Agent/Program.cs +++ b/src/Heimdall.Agent/Program.cs @@ -4,8 +4,20 @@ using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Microsoft.Extensions.Diagnostics.HealthChecks; using Microsoft.Extensions.Options; +// ── Sentry (GlitchTip) — hardcoded DSN, not overridable by env ──── +const string SentryDsn = "https://db94b9fc2f36425f9eb4b9f6f347dc73@glitchtip.tordais.cc/6"; + var builder = WebApplication.CreateSlimBuilder(args); +// ── Sentry ──────────────────────────────────────────────────────── +builder.WebHost.UseSentry(options => +{ + options.Dsn = SentryDsn; + options.MinimumBreadcrumbLevel = LogLevel.Debug; + options.MinimumEventLevel = LogLevel.Error; + options.TracesSampleRate = 0.1; +}); + // Strongly-typed configuration with validation builder.Services.AddOptions() .BindConfiguration(AgentOptions.SectionName) diff --git a/src/Heimdall.Api/Heimdall.Api.csproj b/src/Heimdall.Api/Heimdall.Api.csproj index 1b38642..171c8d7 100644 --- a/src/Heimdall.Api/Heimdall.Api.csproj +++ b/src/Heimdall.Api/Heimdall.Api.csproj @@ -15,6 +15,7 @@ + diff --git a/src/Heimdall.Api/Program.cs b/src/Heimdall.Api/Program.cs index 014d8b6..63ff126 100644 --- a/src/Heimdall.Api/Program.cs +++ b/src/Heimdall.Api/Program.cs @@ -11,8 +11,20 @@ using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.EntityFrameworkCore; using Microsoft.IdentityModel.Tokens; +// ── Sentry (GlitchTip) — hardcoded DSN, not overridable by env ──── +const string SentryDsn = "https://db94b9fc2f36425f9eb4b9f6f347dc73@glitchtip.tordais.cc/6"; + var builder = WebApplication.CreateBuilder(args); +// ── Sentry ──────────────────────────────────────────────────────── +builder.WebHost.UseSentry(options => +{ + options.Dsn = SentryDsn; + options.MinimumBreadcrumbLevel = LogLevel.Debug; + options.MinimumEventLevel = LogLevel.Error; + options.TracesSampleRate = 0.1; +}); + // ── Rate Limiting (Polly/System.Threading.RateLimiting) ─────────── builder.Services.AddRateLimiter(options => { diff --git a/src/Heimdall.Web/Heimdall.Web.csproj b/src/Heimdall.Web/Heimdall.Web.csproj index 277f85f..6325414 100644 --- a/src/Heimdall.Web/Heimdall.Web.csproj +++ b/src/Heimdall.Web/Heimdall.Web.csproj @@ -7,6 +7,7 @@ + diff --git a/src/Heimdall.Web/Program.cs b/src/Heimdall.Web/Program.cs index a7b5c0c..7b93d1b 100644 --- a/src/Heimdall.Web/Program.cs +++ b/src/Heimdall.Web/Program.cs @@ -4,8 +4,20 @@ 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"; + var builder = WebApplication.CreateBuilder(args); +// ── Sentry ──────────────────────────────────────────────────────── +builder.WebHost.UseSentry(options => +{ + options.Dsn = SentryDsn; + options.MinimumBreadcrumbLevel = LogLevel.Debug; + options.MinimumEventLevel = LogLevel.Error; + options.TracesSampleRate = 0.1; +}); + builder.Services.AddRazorComponents() .AddInteractiveServerComponents();