NetEvolve.HealthPublishers.Webhook
1.15.98
Prefix Reserved
dotnet add package NetEvolve.HealthPublishers.Webhook --version 1.15.98
NuGet\Install-Package NetEvolve.HealthPublishers.Webhook -Version 1.15.98
<PackageReference Include="NetEvolve.HealthPublishers.Webhook" Version="1.15.98" />
<PackageVersion Include="NetEvolve.HealthPublishers.Webhook" Version="1.15.98" />
<PackageReference Include="NetEvolve.HealthPublishers.Webhook" />
paket add NetEvolve.HealthPublishers.Webhook --version 1.15.98
#r "nuget: NetEvolve.HealthPublishers.Webhook, 1.15.98"
#:package NetEvolve.HealthPublishers.Webhook@1.15.98
#addin nuget:?package=NetEvolve.HealthPublishers.Webhook&version=1.15.98
#tool nuget:?package=NetEvolve.HealthPublishers.Webhook&version=1.15.98
NetEvolve.HealthPublishers.Webhook
An IHealthCheckPublisher implementation that posts HealthReport results as JSON to an arbitrary, user-configured HTTP endpoint - no third-party SaaS format, just a generic payload delivered over HttpClient.
Features
- Posts a single JSON document per publish, summarizing the overall report status, elapsed time, and a per-check breakdown
- Tags the payload with the machine name and a required, free-form
SystemIdentifierto tell instances apart - Supports arbitrary custom HTTP headers (e.g. for authentication against the receiving endpoint)
- Configuration- or builder-based setup, consistent with the
NetEvolve.HealthChecks.*conventions - Named registrations to publish to multiple webhook targets side by side
- No third-party dependency - just
HttpClientviaIHttpClientFactory
Installation
NuGet Package Manager
Install-Package NetEvolve.HealthPublishers.Webhook
.NET CLI
dotnet add package NetEvolve.HealthPublishers.Webhook
PackageReference
<PackageReference Include="NetEvolve.HealthPublishers.Webhook" Version="x.x.x" />
Quick Start
using NetEvolve.HealthPublishers.Webhook;
var builder = services.AddHealthChecks();
builder.AddWebhookPublisher(options =>
{
options.Uri = new Uri("https://example.com/webhooks/health");
options.SystemIdentifier = "checkout-service";
});
Usage
Basic Example
Register under the default name ("Default"), configured via code:
var builder = services.AddHealthChecks();
builder.AddWebhookPublisher(options =>
{
options.Uri = new Uri("https://example.com/webhooks/health"); // Required, the target endpoint
options.SystemIdentifier = "checkout-service"; // Required, tags the payload alongside the machine name
options.Headers["Authorization"] = "Bearer <token>"; // Optional, sent as-is with every request
});
Advanced Example
Register multiple named webhook targets, each pushing the same health reports to a different endpoint:
var builder = services.AddHealthChecks();
builder.AddWebhookPublisher("Internal", options =>
{
options.Uri = new Uri("https://internal.example.com/webhooks/health");
options.SystemIdentifier = "checkout-service";
});
builder.AddWebhookPublisher("External", options =>
{
options.Uri = new Uri("https://external.example.com/webhooks/health");
options.SystemIdentifier = "checkout-service";
options.Headers["X-Api-Key"] = "<api-key>";
});
Configuration
Code-based
builder.AddWebhookPublisher(options =>
{
options.Uri = new Uri("https://example.com/webhooks/health"); // Required
options.SystemIdentifier = "checkout-service"; // Required
options.Headers["Authorization"] = "Bearer <token>"; // Optional
});
appsettings.json-based
builder.AddWebhookPublisher(); // reads the "Default" section below
{
"HealthPublishers": {
"Webhook": {
"Default": {
"Uri": "https://example.com/webhooks/health",
"SystemIdentifier": "checkout-service",
"Headers": {
"Authorization": "Bearer <token>"
}
}
}
}
}
When using an explicit name, the section key must match: builder.AddWebhookPublisher("EU") reads HealthPublishers:Webhook:EU.
Payload
Every publish sends a single JSON document via POST:
{
"systemIdentifier": "checkout-service",
"machineName": "web-01",
"status": "Healthy",
"totalDurationMs": 12.5,
"timestamp": "2026-01-02T03:04:05.0000000Z",
"entries": [
{
"name": "database",
"status": "Healthy",
"durationMs": 3.1,
"description": null,
"tags": []
}
]
}
A non-2xx response causes PublishAsync to throw, consistent with the other NetEvolve.HealthPublishers.* packages.
Requirements
- .NET 8.0 or higher
- An HTTP endpoint capable of receiving a
POSTrequest with a JSON body
Related Packages
- NetEvolve.HealthPublishers.Abstractions - Shared abstractions used by all
NetEvolve.HealthPublishers.*packages
Documentation
For complete documentation, please visit the official documentation.
Contributing
Contributions are welcome! Please read the Contributing Guidelines before submitting a pull request.
Support
- Issues: Report bugs or request features on GitHub Issues
- Documentation: Read the full documentation at https://github.com/dailydevops/healthpublishers
License
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by the NetEvolve Team Visit us at https://www.daily-devops.net for more information about our services and solutions.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Extensions.Configuration (>= 10.0.14)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.14)
- Microsoft.Extensions.DependencyInjection (>= 10.0.14)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.14)
- Microsoft.Extensions.Http (>= 10.0.14)
- Microsoft.Extensions.Options (>= 10.0.14)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.14)
-
net8.0
- Microsoft.Extensions.Configuration (>= 10.0.14)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.14)
- Microsoft.Extensions.DependencyInjection (>= 10.0.14)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.14)
- Microsoft.Extensions.Http (>= 10.0.14)
- Microsoft.Extensions.Options (>= 10.0.14)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.14)
-
net9.0
- Microsoft.Extensions.Configuration (>= 10.0.14)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.14)
- Microsoft.Extensions.DependencyInjection (>= 10.0.14)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.14)
- Microsoft.Extensions.Http (>= 10.0.14)
- Microsoft.Extensions.Options (>= 10.0.14)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.14)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.