From f07c248777eaf3fb59d89ae60d694e2d3ed693b1 Mon Sep 17 00:00:00 2001 From: Doug Waldron Date: Fri, 12 Jun 2026 07:41:34 -0400 Subject: [PATCH] Remove Raygun --- .github/workflows/release-tracking.yml | 35 ++------------------- src/EmailQueue.API/EmailQueue.API.csproj | 2 -- src/EmailQueue.API/Platform/AppSettings.cs | 8 ----- src/EmailQueue.API/Platform/ErrorLogging.cs | 23 -------------- src/EmailQueue.API/Program.cs | 11 +------ src/EmailQueue.API/appsettings.json | 3 -- 6 files changed, 4 insertions(+), 78 deletions(-) delete mode 100644 src/EmailQueue.API/Platform/ErrorLogging.cs diff --git a/.github/workflows/release-tracking.yml b/.github/workflows/release-tracking.yml index ae5086c..5d03a95 100644 --- a/.github/workflows/release-tracking.yml +++ b/.github/workflows/release-tracking.yml @@ -1,10 +1,7 @@ -# Workflow to register a new application version with both GitHub Releases and Raygun deployment tracking. +# Workflow to register a new application version as a GitHub Release. # The workflow is triggered when a tag in the format "v1.0.0" is pushed to GitHub. # -# Learn more about Raygun Deployment Tracking at: -# https://raygun.com/documentation/product-guides/deployment-tracking/overview/ -# # Learn more about the GitHub release action at: # https://github.com/marketplace/actions/git-release @@ -24,36 +21,10 @@ jobs: runs-on: ubuntu-latest permissions: contents: write - + steps: - - name: Get the version number - id: get_version - run: | - VERSION=${GITHUB_REF_NAME#v} - echo Version: $VERSION - echo "VERSION=$VERSION" >> $GITHUB_OUTPUT - - - name: Send to the Raygun Deployments API - id: raygun_deployment - uses: fjogeleit/http-request-action@551353b829c3646756b2ec2b3694f819d7957495 - with: - url: https://api.raygun.com/v3/applications/api-key/${{ secrets.RAYGUN_APIKEY }}/deployments - method: POST - bearerToken: ${{ secrets.RAYGUN_AUTHTOKEN }} - data: >- - { - "version": "${{ steps.get_version.outputs.VERSION }}", - "ownerName": "${{ github.event.pusher.name }}", - "emailAddress": "${{ github.event.pusher.email }}", - "scmIdentifier": "${{ github.sha }}", - "scmType": "GitHub" - } - - - name: Show Raygun response - run: echo ${{ steps.raygun_deployment.outputs.response }} - - name: Check out repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 - name: Create GitHub Release id: github_release diff --git a/src/EmailQueue.API/EmailQueue.API.csproj b/src/EmailQueue.API/EmailQueue.API.csproj index ff1646d..d1cc9e6 100644 --- a/src/EmailQueue.API/EmailQueue.API.csproj +++ b/src/EmailQueue.API/EmailQueue.API.csproj @@ -15,8 +15,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - diff --git a/src/EmailQueue.API/Platform/AppSettings.cs b/src/EmailQueue.API/Platform/AppSettings.cs index af0a786..84c4a92 100644 --- a/src/EmailQueue.API/Platform/AppSettings.cs +++ b/src/EmailQueue.API/Platform/AppSettings.cs @@ -8,18 +8,12 @@ public static class AppSettings public static string? Version { get; internal set; } public static Queue QueueSettings { get; } = new(); public static EmailServiceSettings EmailServiceSettings { get; } = new(); - public static Raygun RaygunSettings { get; } = new(); public record Queue { public int ProcessingDelaySeconds { get; [UsedImplicitly] init; } = 5; // Default value of 5 seconds if not specified in config } - - public record Raygun - { - public string? ApiKey { get; [UsedImplicitly] init; } - } } public static class AppSettingsExtensions @@ -32,8 +26,6 @@ public static void BindAppSettings(this WebApplicationBuilder builder) .Bind(AppSettings.QueueSettings); builder.Configuration.GetSection(nameof(AppSettings.EmailServiceSettings)) .Bind(AppSettings.EmailServiceSettings); - builder.Configuration.GetSection(nameof(AppSettings.RaygunSettings)) - .Bind(AppSettings.RaygunSettings); } private static string GetVersion() diff --git a/src/EmailQueue.API/Platform/ErrorLogging.cs b/src/EmailQueue.API/Platform/ErrorLogging.cs deleted file mode 100644 index 1b96534..0000000 --- a/src/EmailQueue.API/Platform/ErrorLogging.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Mindscape.Raygun4Net.AspNetCore; -using Mindscape.Raygun4Net.Extensions.Logging; - -namespace EmailQueue.API.Platform; - -internal static class ErrorLogging -{ - public static void ConfigureRaygunLogging(this WebApplicationBuilder builder) - { - if (string.IsNullOrEmpty(AppSettings.RaygunSettings.ApiKey)) return; - - builder.Services.AddRaygun(options => - { - options.ApiKey = AppSettings.RaygunSettings.ApiKey; - options.ApplicationVersion = AppSettings.Version; - }); - builder.Logging.AddRaygunLogger(options => - { - options.MinimumLogLevel = LogLevel.Warning; - options.OnlyLogExceptions = false; - }); - } -} diff --git a/src/EmailQueue.API/Program.cs b/src/EmailQueue.API/Program.cs index 90c34a7..f735c4e 100644 --- a/src/EmailQueue.API/Program.cs +++ b/src/EmailQueue.API/Program.cs @@ -1,19 +1,11 @@ using EmailQueue.API.Database; using EmailQueue.API.Platform; using EmailQueue.API.Services; -using Mindscape.Raygun4Net.AspNetCore; var builder = WebApplication.CreateBuilder(args); -builder.Logging.ClearProviders().AddZLoggerConsole(options => -{ - if (builder.Environment.IsDevelopment()) - options.UsePlainTextFormatter(); - else - options.UseJsonFormatter(); -}); +builder.Logging.ClearProviders().AddZLoggerConsole(options => options.UseJsonFormatter()); builder.BindAppSettings(); -builder.ConfigureRaygunLogging(); builder.Services.AddControllers(); builder.Services.AddApiKeyAuthentication(); builder.ConfigureDatabase(); @@ -21,7 +13,6 @@ var app = builder.Build(); -if (!string.IsNullOrEmpty(AppSettings.RaygunSettings.ApiKey)) app.UseRaygun(); app.UseAuthentication(); app.UseAuthorization(); app.MapControllers(); diff --git a/src/EmailQueue.API/appsettings.json b/src/EmailQueue.API/appsettings.json index f3cc4f2..1a03b45 100644 --- a/src/EmailQueue.API/appsettings.json +++ b/src/EmailQueue.API/appsettings.json @@ -24,9 +24,6 @@ "Audit.Recipient@email.invalid" ] }, - "RaygunSettings": { - "ApiKey": "" - }, "ApiClients": [ { "ClientName": "Sample Client Application",