NetEvolve.HealthPublishers.Elasticsearch
1.10.0
Prefix Reserved
dotnet add package NetEvolve.HealthPublishers.Elasticsearch --version 1.10.0
NuGet\Install-Package NetEvolve.HealthPublishers.Elasticsearch -Version 1.10.0
<PackageReference Include="NetEvolve.HealthPublishers.Elasticsearch" Version="1.10.0" />
<PackageVersion Include="NetEvolve.HealthPublishers.Elasticsearch" Version="1.10.0" />
<PackageReference Include="NetEvolve.HealthPublishers.Elasticsearch" />
paket add NetEvolve.HealthPublishers.Elasticsearch --version 1.10.0
#r "nuget: NetEvolve.HealthPublishers.Elasticsearch, 1.10.0"
#:package NetEvolve.HealthPublishers.Elasticsearch@1.10.0
#addin nuget:?package=NetEvolve.HealthPublishers.Elasticsearch&version=1.10.0
#tool nuget:?package=NetEvolve.HealthPublishers.Elasticsearch&version=1.10.0
NetEvolve.HealthPublishers.Elasticsearch
An IHealthCheckPublisher implementation that indexes HealthReport results as documents into an Elasticsearch cluster, using the official Elastic.Clients.Elasticsearch client.
Features
- Indexes a single document per publish, summarizing the overall report status, elapsed time, and a per-check breakdown
- Authenticates using an API key or basic authentication (username/password)
- Tags every document with the machine name and a required, free-form
SystemIdentifierto tell instances apart - Configuration- or builder-based setup, consistent with the
NetEvolve.HealthPublishers.*conventions - Named registrations to publish to multiple Elasticsearch targets side by side
- Uses the official
Elastic.Clients.Elasticsearchclient
Installation
NuGet Package Manager
Install-Package NetEvolve.HealthPublishers.Elasticsearch
.NET CLI
dotnet add package NetEvolve.HealthPublishers.Elasticsearch
PackageReference
<PackageReference Include="NetEvolve.HealthPublishers.Elasticsearch" Version="x.x.x" />
Quick Start
using NetEvolve.HealthPublishers.Elasticsearch;
var builder = services.AddHealthChecks();
builder.AddElasticsearchPublisher(options =>
{
options.ServerUri = new Uri("https://elasticsearch.example.com:9200");
options.IndexName = "health-checks";
options.ApiKey = "<api-key>";
options.SystemIdentifier = "checkout-service";
});
Usage
Basic Example
Register under the default name ("Default"), configured via code:
var builder = services.AddHealthChecks();
builder.AddElasticsearchPublisher(options =>
{
options.ServerUri = new Uri("https://elasticsearch.example.com:9200"); // Required, base address of the cluster
options.IndexName = "health-checks"; // Required, index the document is written to
options.ApiKey = "<api-key>"; // Optional, sent as an API key
options.SystemIdentifier = "checkout-service"; // Required, tags documents alongside the machine name
});
Advanced Example
Register multiple named Elasticsearch targets, each indexing the same health reports into a different cluster or index:
var builder = services.AddHealthChecks();
builder.AddElasticsearchPublisher("Production", options =>
{
options.ServerUri = new Uri("https://elasticsearch-prod.example.com:9200");
options.IndexName = "prod-health-checks";
options.ApiKey = "<prod-api-key>";
options.SystemIdentifier = "checkout-service";
});
builder.AddElasticsearchPublisher("Staging", options =>
{
options.ServerUri = new Uri("https://elasticsearch-staging.example.com:9200");
options.IndexName = "staging-health-checks";
options.Username = "elastic";
options.Password = "<password>";
options.SystemIdentifier = "checkout-service";
});
Configuration
Code-based
builder.AddElasticsearchPublisher(options =>
{
options.ServerUri = new Uri("https://elasticsearch.example.com:9200"); // Required
options.IndexName = "health-checks"; // Required
options.SystemIdentifier = "checkout-service"; // Required
options.ApiKey = "<api-key>"; // Optional, mutually exclusive with Username/Password
options.Username = "elastic"; // Optional, must be set together with Password
options.Password = "<password>"; // Optional, must be set together with Username
});
appsettings.json-based
builder.AddElasticsearchPublisher(); // reads the "Default" section below
{
"HealthPublishers": {
"Elasticsearch": {
"Default": {
"ServerUri": "https://elasticsearch.example.com:9200",
"IndexName": "health-checks",
"ApiKey": "<api-key>",
"SystemIdentifier": "checkout-service"
}
}
}
}
When using an explicit name, the section key must match: builder.AddElasticsearchPublisher("Production") reads HealthPublishers:Elasticsearch:Production.
Requirements
- .NET 8.0 or higher
- An Elasticsearch cluster reachable over HTTP or HTTPS
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
- Elastic.Clients.Elasticsearch (>= 8.18.3)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.10)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.10)
- Microsoft.Extensions.Options (>= 10.0.10)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.10)
-
net8.0
- Elastic.Clients.Elasticsearch (>= 8.18.3)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.10)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.10)
- Microsoft.Extensions.Options (>= 10.0.10)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.10)
-
net9.0
- Elastic.Clients.Elasticsearch (>= 8.18.3)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.10)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.10)
- Microsoft.Extensions.Options (>= 10.0.10)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.10)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.10.0 | 47 | 7/27/2026 |