public IActionResult Get() { var healthViloationMessage = _healthService.GetHealthViolationMessage(); if (healthViloationMessage != null) { return(StatusCode( (int)HttpStatusCode.InternalServerError, new Models.ErrorResponse { ErrorMessage = $"Service is unhealthy: {healthViloationMessage}" })); } return(Ok(new Models.IsAliveResponse { Name = Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application.ApplicationName, Version = Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application.ApplicationVersion, Env = Program.EnvInfo, #if DEBUG IsDebug = true, #else IsDebug = false, #endif IssueIndicators = _healthService.GetHealthIssues() .Select(i => new Models.IsAliveResponse.IssueIndicator { Type = i.Type, Value = i.Value }) })); }
public IActionResult Get() { var healthViloationMessage = _healthService.GetHealthViolationMessage(); if (healthViloationMessage != null) { return(StatusCode( (int)HttpStatusCode.InternalServerError, ErrorResponse.Create($"Service is unhealthy: {healthViloationMessage}"))); } // NOTE: Feel free to extend IsAliveResponse, to display job-specific indicators return(Ok(new IsAliveResponse { Name = Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application.ApplicationName, Version = Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application.ApplicationVersion, Env = Environment.GetEnvironmentVariable("ENV_INFO"), #if DEBUG IsDebug = true, #else IsDebug = false, #endif IssueIndicators = _healthService.GetHealthIssues() .Select(i => new IsAliveResponse.IssueIndicator { Type = i.Type, Value = i.Value }) })); }
public IActionResult Get() { var healthViloationMessage = _healthService.GetHealthViolationMessage(); if (healthViloationMessage != null) { return(StatusCode((int)HttpStatusCode.InternalServerError, new ErrorResponse { ErrorMessage = $"Job is unhealthy: {healthViloationMessage}" })); } // NOTE: Feel free to extend IsAliveResponse, to display job-specific indicators return(Ok(new IsAliveResponse { Name = AppEnvironment.Name, Version = AppEnvironment.Version, Env = Program.EnvInfo, #if DEBUG IsDebug = true, #else IsDebug = false, #endif IssueIndicators = _healthService.GetHealthIssues() .Select(i => new IsAliveResponse.IssueIndicator { Type = i.Type, Value = i.Value }) })); }
public IActionResult Get() { var healthViloationMessage = _healthService.GetHealthViolationMessage(); if (healthViloationMessage != null) { return(StatusCode((int)HttpStatusCode.InternalServerError, new ErrorResponse { ErrorMessage = $"Job is unhealthy: {healthViloationMessage}" })); } // NOTE: Feel free to extend IsAliveResponse, to display job-specific indicators return(Ok(new IsAliveResponse { Name = Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application.ApplicationName, Version = Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application .ApplicationVersion, Env = Program.EnvInfo, //#$if DEBUG IsDebug = true, //#$else //$#$//IsDebug = false, //#$endif IssueIndicators = _healthService.GetHealthIssues() .Select(i => new IsAliveResponse.IssueIndicator { Type = i.Type, Value = i.Value }) })); }
public IActionResult Get() { var healthViloationMessage = _healthService.GetHealthViolationMessage(); if (healthViloationMessage != null) { return(StatusCode( (int)HttpStatusCode.InternalServerError, BlockchainWalletsErrorResponse.Create($"Service is unhealthy: {healthViloationMessage}"))); } // NOTE: Feel free to extend IsAliveResponse, to display job-specific indicators return(Ok(new IsAliveResponse { Name = PlatformServices.Default.Application.ApplicationName, Version = PlatformServices.Default.Application.ApplicationVersion, Env = Program.EnvInfo, #if DEBUG IsDebug = true, #else IsDebug = false, #endif IssueIndicators = _healthService.GetHealthIssues() .Select(i => new IsAliveResponse.IssueIndicator { Type = i.Type, Value = i.Value }) })); }
public IActionResult Get() { return(Ok( new IsAliveResponse { Name = AppEnvironment.Name, Version = AppEnvironment.Version, Env = AppEnvironment.EnvInfo, IsDebug = _isDebug, IssueIndicators = _healthService.GetHealthIssues() .Select(i => new IsAliveResponse.IssueIndicator { Type = i.Type, Value = i.Value }), })); }