From 13805b913887724b0bbb9d22ee21229534ddb68d Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Mon, 27 Oct 2025 11:54:56 -0500 Subject: [PATCH 1/2] Adding Akka.Persistence.Sql connectivity health check support --- Directory.Packages.props | 8 ++++---- src/DrawTogether/Config/AkkaConfiguration.cs | 10 ++++++---- .../Config/HealthCheckEndpointsExtensions.cs | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 1c33298..548cef6 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,9 +1,9 @@ true - 1.5.53 - 1.5.53 - 1.5.52 + 1.5.55 + 1.5.55 + 1.5.55 1.4.5 9.5.1 1.52.0 @@ -17,7 +17,7 @@ - + diff --git a/src/DrawTogether/Config/AkkaConfiguration.cs b/src/DrawTogether/Config/AkkaConfiguration.cs index 593e3dc..efebf1c 100644 --- a/src/DrawTogether/Config/AkkaConfiguration.cs +++ b/src/DrawTogether/Config/AkkaConfiguration.cs @@ -33,8 +33,8 @@ public static IServiceCollection ConfigureAkka(this IServiceCollection services, { builder.ConfigureNetwork(provider) .AddDrawingProtocolSerializer() - .WithAkkaClusterReadinessCheck() - .WithActorSystemLivenessCheck() + .WithAkkaClusterReadinessCheck(tags:["Akka", "ready", "Akka.Cluster"]) + .WithActorSystemLivenessCheck(tags:["Akka", "liveness"]) .WithSqlPersistence( connectionString: connectionString, providerName: ProviderName.SqlServer2022, @@ -44,10 +44,12 @@ public static IServiceCollection ConfigureAkka(this IServiceCollection services, useWriterUuidColumn: true, autoInitialize: true, journalBuilder: journalBuilder => { - journalBuilder.WithHealthCheck(name:"Akka.Persistence.Sql.Journal[default]"); + journalBuilder.WithHealthCheck(name:"Akka.Persistence.Sql.Journal[default]", tags:["Akka.Persistence", "Akka.Persistence.Sql.Journal", "ready"]); + journalBuilder.WithConnectivityCheck(new SqlJournalOptions() + { ConnectionString = connectionString }); }, snapshotBuilder: snapshotBuilder => { - snapshotBuilder.WithHealthCheck(name:"Akka.Persistence.Sql.SnapshotStore[default]"); + snapshotBuilder.WithHealthCheck(name:"Akka.Persistence.Sql.SnapshotStore[default]", tags:["Akka.Persistence", "Akka.Persistence.Sql.SnapshotStore", "ready"]); }) .AddAllDrawingsIndexActor(roleName) .AddDrawingSessionActor(roleName) diff --git a/src/DrawTogether/Config/HealthCheckEndpointsExtensions.cs b/src/DrawTogether/Config/HealthCheckEndpointsExtensions.cs index 2258c9d..ab486bf 100644 --- a/src/DrawTogether/Config/HealthCheckEndpointsExtensions.cs +++ b/src/DrawTogether/Config/HealthCheckEndpointsExtensions.cs @@ -34,7 +34,7 @@ public static IEndpointRouteBuilder MapHealthCheckEndpoints(this IEndpointRouteB // /healthz/ready - only readiness checks (Akka.Persistence checks by name pattern) endpoints.MapHealthChecks("/healthz/ready", new HealthCheckOptions { - Predicate = check => check.Name.Contains("Akka.Persistence"), + Predicate = check => check.Name.Contains("ready"), ResponseWriter = WriteHealthCheckResponse }); From 08a8572761496e595fde1f3c8609c7b9bf7f08e4 Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Wed, 29 Oct 2025 14:40:53 -0500 Subject: [PATCH 2/2] upgraded to Akka.Persistence.Sql v1.5.55.1 --- Directory.Packages.props | 2 +- src/DrawTogether/Config/AkkaConfiguration.cs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 548cef6..6d8f9f2 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -17,7 +17,7 @@ - + diff --git a/src/DrawTogether/Config/AkkaConfiguration.cs b/src/DrawTogether/Config/AkkaConfiguration.cs index efebf1c..3ce2b7e 100644 --- a/src/DrawTogether/Config/AkkaConfiguration.cs +++ b/src/DrawTogether/Config/AkkaConfiguration.cs @@ -45,8 +45,7 @@ public static IServiceCollection ConfigureAkka(this IServiceCollection services, autoInitialize: true, journalBuilder: journalBuilder => { journalBuilder.WithHealthCheck(name:"Akka.Persistence.Sql.Journal[default]", tags:["Akka.Persistence", "Akka.Persistence.Sql.Journal", "ready"]); - journalBuilder.WithConnectivityCheck(new SqlJournalOptions() - { ConnectionString = connectionString }); + journalBuilder.WithConnectivityCheck(); }, snapshotBuilder: snapshotBuilder => { snapshotBuilder.WithHealthCheck(name:"Akka.Persistence.Sql.SnapshotStore[default]", tags:["Akka.Persistence", "Akka.Persistence.Sql.SnapshotStore", "ready"]);