You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 26, 2019. It is now read-only.
{
healthy: {
CPU Health Check: "OK",
Drive Health Check: "OK"
},
unhealthy: {
DB Connection: "EXCEPTION: InvalidCastException - Unable to cast object of type 'System.Int32' to type 'System.Int64'. InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.Int64'. at App.Metrics.Health.Checks.Sql.SqlHealthCheckBuilderExtensions.<>c__DisplayClass0_0.<AddSqlCheck>b__0(CancellationToken cancellationToken) in C:\projects\health\src\App.Metrics.Health.Checks.Sql\SqlHealthCheckBuilderExtensions.cs:line 48 ",
Private Memory Size: "FAILED. 87666688 > 1000 bytes",
Virtual Memory Size: "FAILED. 2218767613952 > 1000 bytes",
Working Set: "FAILED. 81408000 > 1000"
},
status: "Unhealthy"
}
and the configure for health with deaults :
public static IWebHostBuilder CreateWebHostBuilder(string[] args)
{
return WebHost.CreateDefaultBuilder(args)
.ConfigureHealthWithDefaults(
builder =>
{
const int threshold = 1000;
// Check that the current amount of private memory in bytes is below a threshold
builder.HealthChecks.AddProcessPrivateMemorySizeCheck("Private Memory Size", threshold);
// Check that the current amount of virtual memory in bytes is below a threshold
builder.HealthChecks.AddProcessVirtualMemorySizeCheck("Virtual Memory Size", threshold);
// Check that the current amount of physical memory in bytes is below a threshold
builder.HealthChecks.AddProcessPhysicalMemoryCheck("Working Set", threshold);
// Check db status
builder.HealthChecks.AddSqlCheck("DB Connection", () => new SqlConnection("myconnectionstring"), TimeSpan.FromSeconds(10));
})
.UseHealth()
.UseHealthEndpoints()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseConfiguration(Configuration)
.UseSerilog()
.UseIISIntegration()
.UseKestrel()
.UseStartup<Startup>();
}
The text was updated successfully, but these errors were encountered:
@sorcer1 Thanks for taking a look, IDbConnection.ExecuteScalar() returns an object, the same app use using a SqliteConnection which returns a long, would have to add some type of safety around that.
This is the error in health endpoint
and the configure for health with deaults :
The text was updated successfully, but these errors were encountered: