-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4974a8d
commit 687e717
Showing
11 changed files
with
88 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,43 @@ | ||
<Project> | ||
<ItemGroup> | ||
<PackageVersion Include="Aspirant.Hosting" Version="0.0.4" /> | ||
<PackageVersion Include="Aspire.Hosting.AppHost" Version="8.1.0" /> | ||
<PackageVersion Include="Aspire.Hosting.Seq" Version="8.1.0" /> | ||
<PackageVersion Include="Aspire.Seq" Version="8.1.0" /> | ||
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="8.7.0" /> | ||
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="8.1.0" /> | ||
<PackageVersion Include="MinVer" Version="5.0.0" /> | ||
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" /> | ||
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" /> | ||
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" /> | ||
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" /> | ||
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.9.0" /> | ||
<PackageVersion Include="Serilog" Version="4.0.1" /> | ||
<PackageVersion Include="Serilog.AspNetCore" Version="8.0.2" /> | ||
<PackageVersion Include="Serilog.Enrichers.Context" Version="4.6.5" /> | ||
<PackageVersion Include="Serilog.Enrichers.Thread" Version="4.0.0" /> | ||
<PackageVersion Include="Serilog.Enrichers.Process" Version="3.0.0" /> | ||
<PackageVersion Include="Serilog.Enrichers.Span" Version="3.1.0" /> | ||
<PackageVersion Include="Serilog.Exceptions" Version="8.4.0" /> | ||
<PackageVersion Include="Serilog.Exceptions.EntityFrameworkCore" Version="8.4.0" /> | ||
<PackageVersion Include="Serilog.Sinks.Console" Version="6.0.0" /> | ||
<PackageVersion Include="Serilog.Sinks.OpenTelemetry" Version="4.0.0" /> | ||
<PackageVersion Include="Serilog.Sinks.Seq" Version="8.0.0" /> | ||
<PackageVersion Include="Aspire.Hosting.PostgreSQL" Version="8.1.0" /> | ||
<PackageVersion Include="Aspire.Npgsql" Version="8.1.0" /> | ||
<PackageVersion Include="AspNetCore.HealthChecks.NpgSql" Version="8.0.1" /> | ||
<PackageVersion Include="AspNetCore.HealthChecks.Uris" Version="8.0.1" /> | ||
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" /> | ||
<PackageVersion Include="Serilog.Sinks.Spectre" Version="0.5.0" /> | ||
</ItemGroup> | ||
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' "> | ||
<PackageVersion Include="Aspire.Hosting.AppHost" Version="8.2.2" /> | ||
<PackageVersion Include="Aspire.Hosting.Seq" Version="8.2.2" /> | ||
<PackageVersion Include="Aspire.Seq" Version="8.2.2" /> | ||
<PackageVersion Include="Aspire.Hosting.PostgreSQL" Version="8.2.2" /> | ||
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="8.10.0" /> | ||
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="8.2.2" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' "> | ||
<PackageVersion Include="Aspire.Hosting.AppHost" Version="9.0.0" /> | ||
<PackageVersion Include="Aspire.Hosting.Seq" Version="9.0.0" /> | ||
<PackageVersion Include="Aspire.Seq" Version="9.0.0" /> | ||
<PackageVersion Include="Aspire.Hosting.PostgreSQL" Version="9.0.0" /> | ||
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="9.0.0" /> | ||
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="9.0.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageVersion Include="MinVer" Version="6.0.0" /> | ||
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.10.0" /> | ||
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.10.0" /> | ||
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" /> | ||
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" /> | ||
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.9.0" /> | ||
<PackageVersion Include="Serilog" Version="4.1.0" /> | ||
<PackageVersion Include="Serilog.AspNetCore" Version="8.0.3" /> | ||
<PackageVersion Include="Serilog.Enrichers.Context" Version="4.6.5" /> | ||
<PackageVersion Include="Serilog.Enrichers.Thread" Version="4.0.0" /> | ||
<PackageVersion Include="Serilog.Enrichers.Process" Version="3.0.0" /> | ||
<PackageVersion Include="Serilog.Enrichers.Span" Version="3.1.0" /> | ||
<PackageVersion Include="Serilog.Exceptions" Version="8.4.0" /> | ||
<PackageVersion Include="Serilog.Sinks.Console" Version="6.0.0" /> | ||
<PackageVersion Include="Serilog.Sinks.OpenTelemetry" Version="4.1.1" /> | ||
<PackageVersion Include="Serilog.Sinks.Seq" Version="8.0.0" /> | ||
<PackageVersion Include="Aspire.Npgsql" Version="8.1.0" /> | ||
<PackageVersion Include="AspNetCore.HealthChecks.NpgSql" Version="8.0.2" /> | ||
<PackageVersion Include="AspNetCore.HealthChecks.Uris" Version="8.0.1" /> | ||
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" /> | ||
<PackageVersion Include="Serilog.Sinks.Spectre" Version="0.5.0" /> | ||
</ItemGroup> | ||
</Project> |
25 changes: 25 additions & 0 deletions
25
src/SimCube.Aspire.Hosting/Features/HealthChecks/HealthCheckAnnotation.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
namespace SimCube.Aspire.Hosting.Features.HealthChecks; | ||
|
||
public class HealthCheckAnnotation(Func<IResource, CancellationToken, Task<IHealthCheck?>> healthCheckFactory) : IResourceAnnotation | ||
{ | ||
/// <summary> | ||
/// A factory that creates a health check from a resource | ||
/// </summary> | ||
public Func<IResource, CancellationToken, Task<IHealthCheck?>> HealthCheckFactory { get; } = healthCheckFactory; | ||
|
||
/// <summary> | ||
/// Create a <see cref="HealthCheckAnnotation"/> from | ||
/// </summary> | ||
/// <param name="connectionStringFactory"></param> | ||
/// <returns>A new <see cref="HealthCheckAnnotation"/>.</returns> | ||
public static HealthCheckAnnotation Create(Func<string, IHealthCheck> connectionStringFactory) => | ||
new(async (resource, token) => | ||
{ | ||
if (resource is not IResourceWithConnectionString c) | ||
{ | ||
return null; | ||
} | ||
|
||
return await c.GetConnectionStringAsync(token) is not { } cs ? null : connectionStringFactory(cs); | ||
}); | ||
} |
2 changes: 2 additions & 0 deletions
2
src/SimCube.Aspire.Hosting/Features/Postgres/HealthCheckExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,7 @@ | ||
global using System.Collections.Concurrent; | ||
global using System.Runtime.ExceptionServices; | ||
global using Aspirant.Hosting; | ||
global using Aspire.Hosting; | ||
global using Aspire.Hosting.ApplicationModel; | ||
global using Aspire.Hosting.Lifecycle; | ||
global using HealthChecks.NpgSql; | ||
global using HealthChecks.Uris; | ||
global using Microsoft.AspNetCore.Builder; | ||
global using Microsoft.AspNetCore.Diagnostics.HealthChecks; | ||
global using Microsoft.Extensions.DependencyInjection; | ||
global using Microsoft.Extensions.Diagnostics.HealthChecks; | ||
global using Microsoft.Extensions.Hosting; | ||
global using Microsoft.Extensions.Logging; | ||
global using OpenTelemetry; | ||
global using OpenTelemetry.Metrics; | ||
global using OpenTelemetry.Trace; | ||
global using Polly; | ||
global using Polly.Retry; | ||
global using Serilog; | ||
global using Serilog.Enrichers.Span; | ||
global using Serilog.Exceptions; | ||
global using Serilog.Exceptions.Core; | ||
global using Serilog.Exceptions.EntityFrameworkCore.Destructurers; | ||
global using Serilog.Sinks.OpenTelemetry; | ||
global using SimCube.Aspire.Features.Otlp; | ||
global using SimCube.Aspire.Features.Seq; | ||
global using SimCube.Aspire.Hosting.Features.HealthChecks; | ||
global using SimCube.Aspire.Features.Seq; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters