Skip to content

Commit d2c6b10

Browse files
authored
health probe (#715)
Added a simple health probe to the webservice, responding 200 to indicate that the service is running.
1 parent 9d9750a commit d2c6b10

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

service/Service/Program.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,12 @@ public static void Main(string[] args)
166166
Console.WriteLine("* Log level : " + app.Logger.GetLogLevelName());
167167
Console.WriteLine("***************************************************************************************************************************");
168168

169+
// health probe
170+
app.MapGet("/health", () => Results.Ok("Service is running."))
171+
.Produces<string>(StatusCodes.Status200OK)
172+
.Produces<ProblemDetails>(StatusCodes.Status401Unauthorized)
173+
.Produces<ProblemDetails>(StatusCodes.Status403Forbidden);
174+
169175
app.Logger.LogInformation(
170176
"Starting Kernel Memory service, .NET Env: {0}, Log Level: {1}, Web service: {2}, Auth: {3}, Pipeline handlers: {4}",
171177
env,

0 commit comments

Comments
 (0)