fix: adicionando logs
All checks were successful
BCards Deployment Pipeline / Run Tests (push) Successful in 3s
BCards Deployment Pipeline / PR Validation (push) Has been skipped
BCards Deployment Pipeline / Build and Push Image (push) Successful in 15m50s
BCards Deployment Pipeline / Deploy to Production (ARM - OCI) (push) Successful in 2m26s
BCards Deployment Pipeline / Deploy to Staging (x86 - Local) (push) Has been skipped
BCards Deployment Pipeline / Cleanup Old Resources (push) Has been skipped
BCards Deployment Pipeline / Deployment Summary (push) Successful in 0s
All checks were successful
BCards Deployment Pipeline / Run Tests (push) Successful in 3s
BCards Deployment Pipeline / PR Validation (push) Has been skipped
BCards Deployment Pipeline / Build and Push Image (push) Successful in 15m50s
BCards Deployment Pipeline / Deploy to Production (ARM - OCI) (push) Successful in 2m26s
BCards Deployment Pipeline / Deploy to Staging (x86 - Local) (push) Has been skipped
BCards Deployment Pipeline / Cleanup Old Resources (push) Has been skipped
BCards Deployment Pipeline / Deployment Summary (push) Successful in 0s
This commit is contained in:
parent
77a20d3f37
commit
0387df1994
@ -164,6 +164,18 @@ public class HealthController : ControllerBase
|
|||||||
_logger.LogInformation("Uptime Kuma health check: {Status} in {Duration}ms",
|
_logger.LogInformation("Uptime Kuma health check: {Status} in {Duration}ms",
|
||||||
response.status, stopwatch.ElapsedMilliseconds);
|
response.status, stopwatch.ElapsedMilliseconds);
|
||||||
|
|
||||||
|
|
||||||
|
var memoryMB = Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0, 2);
|
||||||
|
var uptimeMinutes = (DateTime.UtcNow - Process.GetCurrentProcess().StartTime).TotalMinutes;
|
||||||
|
|
||||||
|
_logger.LogInformation("[HEALTH] Memory: {memoryBytes} MemoryMB: {memoryMB} ThreadPool: {threadPool} ProcessId: {processId} ActiveConnections: {activeConnections} UptimeMinutes: {uptimeMinutes}",
|
||||||
|
GC.GetTotalMemory(false),
|
||||||
|
memoryMB,
|
||||||
|
ThreadPool.ThreadCount,
|
||||||
|
Process.GetCurrentProcess().Id,
|
||||||
|
HttpContext.Connection?.Id ?? "null",
|
||||||
|
Math.Round(uptimeMinutes, 1));
|
||||||
|
|
||||||
return Ok(response);
|
return Ok(response);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -230,6 +242,21 @@ public class HealthController : ControllerBase
|
|||||||
|
|
||||||
var entry = healthReport.Entries.First().Value;
|
var entry = healthReport.Entries.First().Value;
|
||||||
|
|
||||||
|
_logger.LogInformation("[HEALTH_CHECK] Service: {serviceName} Status: {status} Duration: {duration} ResponseTime: {responseTime} Timestamp: {timestamp} Data: {data}",
|
||||||
|
serviceName,
|
||||||
|
entry.Status.ToString().ToLower(),
|
||||||
|
entry.Duration.TotalMilliseconds,
|
||||||
|
stopwatch.ElapsedMilliseconds,
|
||||||
|
DateTime.UtcNow,
|
||||||
|
entry.Data != null ? string.Join(", ", entry.Data.Select(d => $"{d.Key}:{d.Value}")) : "none");
|
||||||
|
|
||||||
|
if (entry.Exception != null)
|
||||||
|
{
|
||||||
|
_logger.LogError("[HEALTH_CHECK] Service: {serviceName} Status: {status} Duration: {duration} Error: {error} Exception: {exception}",
|
||||||
|
serviceName, entry.Status.ToString().ToLower(), stopwatch.ElapsedMilliseconds,
|
||||||
|
entry.Exception.Message, entry.Exception.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
var response = new
|
var response = new
|
||||||
{
|
{
|
||||||
service = serviceName,
|
service = serviceName,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user