✅ Supporting multiple routes for health checks in asp.net core

I have a couple monitoring systems that need are calling some api's and I need to support different response types for each monitoring system. Is there a way in asp.net core? Assume I have a number of health probes, for example... .AddHealthCheck<Db2HealthCheck>() .AddHealthCheck<SqlHealthCheck>() .AddHealthCheck<DynamoHealthCheck>() .AddHealthCheck<CognitoHealthCheck>() .AddHealthCheck<YadaYadaYada>() The yadayadayada monitor should only check the YadaYadaYada health check, for example The Aws monitor should only check the CognitoHealthCheck The database monitor should oinly check Db2, Dynamo, and SqlHealthCheck
12 Replies
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
Mayor McCheese
Mayor McCheeseOP10mo ago
now what can be done is adding multiple time the MapHealthCheck with various URI and in each have some logic to get the results each healthcheck can have Tags for example so you could use LINQ on name / type / tags etc ....
This is the part I wasn't certain of
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
Mayor McCheese
Mayor McCheeseOP10mo ago
I've done the one health check endpoint before
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
Mayor McCheese
Mayor McCheeseOP10mo ago
Thanks @TeBeCo this is exactly what I need
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
Mayor McCheese
Mayor McCheeseOP10mo ago
I follow a similar pattern for adding some other depdendencies, I like adding the health check there.
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
Mayor McCheese
Mayor McCheeseOP10mo ago
it's buttoned up nicely that way without a giant wall of DI text
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
Mayor McCheese
Mayor McCheeseOP10mo ago
Thanks again
Want results from more Discord servers?
Add your server