Skip to content

Commit

Permalink
health probe (#715)
Browse files Browse the repository at this point in the history
Added a simple health probe to the webservice, responding 200 to indicate that the service is running.
  • Loading branch information
cherchyk authored Jul 23, 2024
1 parent 9d9750a commit d2c6b10
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions service/Service/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ public static void Main(string[] args)
Console.WriteLine("* Log level : " + app.Logger.GetLogLevelName());
Console.WriteLine("***************************************************************************************************************************");

// health probe
app.MapGet("/health", () => Results.Ok("Service is running."))
.Produces<string>(StatusCodes.Status200OK)
.Produces<ProblemDetails>(StatusCodes.Status401Unauthorized)
.Produces<ProblemDetails>(StatusCodes.Status403Forbidden);

app.Logger.LogInformation(
"Starting Kernel Memory service, .NET Env: {0}, Log Level: {1}, Web service: {2}, Auth: {3}, Pipeline handlers: {4}",
env,
Expand Down

0 comments on commit d2c6b10

Please sign in to comment.