feat: adds initial health check

This commit is contained in:
henrik
2024-11-13 19:32:57 +01:00
parent 492061e043
commit a806d51a8a
4 changed files with 46 additions and 0 deletions

27
.idea/.idea.Pushy/.idea/jsonSchemas.xml generated Normal file
View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JsonSchemaMappingsProjectConfiguration">
<state>
<map>
<entry key="No JSON schema">
<value>
<SchemaInfo>
<option name="ignoredFile" value="true" />
<option name="name" value="No JSON schema" />
<option name="relativePathToSchema" value="" />
<option name="applicationDefined" value="true" />
<option name="patterns">
<list>
<Item>
<option name="path" value="file://$PROJECT_DIR$/app.json" />
</Item>
</list>
</option>
<option name="isIgnoredFile" value="true" />
</SchemaInfo>
</value>
</entry>
</map>
</state>
</component>
</project>

View File

@@ -23,6 +23,8 @@ builder.UseOrleans(silo =>
builder.Services.AddScoped<LinkGenerator>();
builder.Services.AddHealthChecks();
// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents()
@@ -58,4 +60,6 @@ app.MapRazorComponents<App>()
.AddInteractiveWebAssemblyRenderMode()
.AddAdditionalAssemblies(typeof(Pushy.Client._Imports).Assembly);
app.MapHealthChecks("/healthz");
app.Run();

View File

@@ -10,10 +10,12 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="9.0.0" />
<PackageReference Include="Microsoft.Orleans.Persistence.Redis" Version="8.2.0" />
<PackageReference Include="Microsoft.Orleans.Reminders.Redis" Version="8.2.0" />
<PackageReference Include="Microsoft.Orleans.Sdk" Version="8.2.0" />
<PackageReference Include="Microsoft.Orleans.Server" Version="8.2.0" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />
<ProjectReference Include="..\Pushy.Client\Pushy.Client.csproj"/>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="9.0.0" />
</ItemGroup>

13
app.json Normal file
View File

@@ -0,0 +1,13 @@
{
"healthchecks": {
"web": [
{
"type": "startup",
"name": "web check",
"description": "Checking if the app responds to the /health endpoint",
"path": "/healthz",
"attempts": 5
}
]
}
}