NetEvolve.HealthPublishers.Slack
1.15.43
Prefix Reserved
dotnet add package NetEvolve.HealthPublishers.Slack --version 1.15.43
NuGet\Install-Package NetEvolve.HealthPublishers.Slack -Version 1.15.43
<PackageReference Include="NetEvolve.HealthPublishers.Slack" Version="1.15.43" />
<PackageVersion Include="NetEvolve.HealthPublishers.Slack" Version="1.15.43" />
<PackageReference Include="NetEvolve.HealthPublishers.Slack" />
paket add NetEvolve.HealthPublishers.Slack --version 1.15.43
#r "nuget: NetEvolve.HealthPublishers.Slack, 1.15.43"
#:package NetEvolve.HealthPublishers.Slack@1.15.43
#addin nuget:?package=NetEvolve.HealthPublishers.Slack&version=1.15.43
#tool nuget:?package=NetEvolve.HealthPublishers.Slack&version=1.15.43
NetEvolve.HealthPublishers.Slack
An IHealthCheckPublisher implementation that pushes HealthReport results to a Slack channel, using an incoming webhook directly over HTTP.
Features
- Posts a single Slack message per publish, summarizing the overall report status, elapsed time, and a per-check breakdown
- Maps
HealthStatusto a Slack attachment color (Healthy→good,Degraded→warning,Unhealthy→danger) - Tags every message with the machine name and a required, free-form
SystemIdentifierto tell instances apart - Configuration- or builder-based setup, consistent with the
NetEvolve.HealthChecks.*conventions - Named registrations to publish to multiple Slack channels (e.g. different webhooks) side by side
- No Slack SDK dependency - just
HttpClientviaIHttpClientFactory
Installation
NuGet Package Manager
Install-Package NetEvolve.HealthPublishers.Slack
.NET CLI
dotnet add package NetEvolve.HealthPublishers.Slack
PackageReference
<PackageReference Include="NetEvolve.HealthPublishers.Slack" Version="x.x.x" />
Quick Start
using NetEvolve.HealthPublishers.Slack;
var builder = services.AddHealthChecks();
builder.AddSlackPublisher(options =>
{
options.WebhookUrl = new Uri("https://hooks.slack.com/services/T000/B000/XXX");
options.SystemIdentifier = "checkout-service";
});
Usage
Basic Example
Register under the default name ("Default"), configured via code:
var builder = services.AddHealthChecks();
builder.AddSlackPublisher(options =>
{
options.WebhookUrl = new Uri("https://hooks.slack.com/services/T000/B000/XXX"); // Required
options.SystemIdentifier = "checkout-service"; // Required, tags messages alongside the machine name
});
Advanced Example
Register multiple named Slack targets, each pushing the same health reports to a different channel:
var builder = services.AddHealthChecks();
builder.AddSlackPublisher("Ops", options =>
{
options.WebhookUrl = new Uri("https://hooks.slack.com/services/T000/B000/OPS");
options.SystemIdentifier = "checkout-service";
});
builder.AddSlackPublisher("Engineering", options =>
{
options.WebhookUrl = new Uri("https://hooks.slack.com/services/T000/B000/ENG");
options.SystemIdentifier = "checkout-service";
});
Configuration
Code-based
builder.AddSlackPublisher(options =>
{
options.WebhookUrl = new Uri("https://hooks.slack.com/services/T000/B000/XXX"); // Required
options.SystemIdentifier = "checkout-service"; // Required
});
appsettings.json-based
builder.AddSlackPublisher(); // reads the "Default" section below
{
"HealthPublishers": {
"Slack": {
"Default": {
"WebhookUrl": "https://hooks.slack.com/services/T000/B000/XXX",
"SystemIdentifier": "checkout-service"
}
}
}
}
When using an explicit name, the section key must match: builder.AddSlackPublisher("Ops") reads HealthPublishers:Slack:Ops.
Requirements
- .NET 8.0 or higher
- A Slack workspace with an incoming webhook configured for the target channel
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.13)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.13)
- Microsoft.Extensions.DependencyInjection (>= 10.0.13)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.13)
- Microsoft.Extensions.Http (>= 10.0.13)
- Microsoft.Extensions.Options (>= 10.0.13)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.13)
-
net8.0
- Microsoft.Extensions.Configuration (>= 10.0.13)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.13)
- Microsoft.Extensions.DependencyInjection (>= 10.0.13)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.13)
- Microsoft.Extensions.Http (>= 10.0.13)
- Microsoft.Extensions.Options (>= 10.0.13)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.13)
-
net9.0
- Microsoft.Extensions.Configuration (>= 10.0.13)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.13)
- Microsoft.Extensions.DependencyInjection (>= 10.0.13)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.13)
- Microsoft.Extensions.Http (>= 10.0.13)
- Microsoft.Extensions.Options (>= 10.0.13)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.13)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.