w0051977
w0051977

Reputation: 15807

What are webhooks used for in the Health Checks UI?

I am trying to learn more about .Net Core Health Checks.

I understand the concept of a web hook i.e. it notifies you that an event has occurred in a third party application. However, I do not understand the concept of a web hook in the context of the Health Checks UI. If I setup the Health Checks UI, then there are two menu items in the sidebar i.e. Health Checks (as expected) and web hooks.

What are webhooks used for in the Health Checks UI? I have spent hours Googling this and all I have found is this: https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/blob/master/doc/webhooks.md, which has not helped.

Upvotes: 4

Views: 5083

Answers (1)

darrenji
darrenji

Reputation: 85

You can configure Webhooks in the Startup.cs.

services.AddHealthChecksUI(options => {
            options.AddWebhookNotification("email",
                uri: "http://localhost:5008/api/noti/email", 
                payload: "{ \"message\": \"Webhook report for [[LIVENESS]]: [[FAILURE]] - Description: [[DESCRIPTIONS]]\"}",
                restorePayload: "{ \"message\": \"[[LIVENESS]] is back to life\"}");
        }).AddInMemoryStorage();

Upvotes: 6

Related Questions