NetEvolve.HealthPublishers.OpenTelemetry
1.10.0
Prefix Reserved
dotnet add package NetEvolve.HealthPublishers.OpenTelemetry --version 1.10.0
NuGet\Install-Package NetEvolve.HealthPublishers.OpenTelemetry -Version 1.10.0
<PackageReference Include="NetEvolve.HealthPublishers.OpenTelemetry" Version="1.10.0" />
<PackageVersion Include="NetEvolve.HealthPublishers.OpenTelemetry" Version="1.10.0" />
<PackageReference Include="NetEvolve.HealthPublishers.OpenTelemetry" />
paket add NetEvolve.HealthPublishers.OpenTelemetry --version 1.10.0
#r "nuget: NetEvolve.HealthPublishers.OpenTelemetry, 1.10.0"
#:package NetEvolve.HealthPublishers.OpenTelemetry@1.10.0
#addin nuget:?package=NetEvolve.HealthPublishers.OpenTelemetry&version=1.10.0
#tool nuget:?package=NetEvolve.HealthPublishers.OpenTelemetry&version=1.10.0
NetEvolve.HealthPublishers.OpenTelemetry
An IHealthCheckPublisher implementation that records HealthReport results as .NET metrics, using System.Diagnostics.Metrics directly. No OpenTelemetry/OpenTelemetry.Api package dependency required — any OpenTelemetry-compatible MeterListener or exporter (e.g. OpenTelemetry.Extensions.Hosting's AddMeter("NetEvolve.HealthPublishers.OpenTelemetry")) can consume the emitted metrics.
Features
- Records a
healthchecks.report.durationhistogram (milliseconds) per publish, tagged with the overall report status - Records a
healthchecks.entry.durationhistogram (milliseconds) per health check entry, tagged with its name and status - Every tag key is namespaced with a
healthchecks.prefix for consistency:healthchecks.status,healthchecks.publisher.name,healthchecks.system.identifier,healthchecks.machine.name,healthchecks.timestamp,healthchecks.entry.name - Tags every metric with the machine name, a
TimeProvider-sourced timestamp, and a required, free-formSystemIdentifierto tell instances apart - Configuration- or builder-based setup, consistent with the
NetEvolve.HealthChecks.*conventions - Named registrations to differentiate multiple publisher setups via the
healthchecks.publisher.nametag - No external dependencies — built entirely on the in-box
System.Diagnostics.DiagnosticSourcemetrics API
Installation
NuGet Package Manager
Install-Package NetEvolve.HealthPublishers.OpenTelemetry
.NET CLI
dotnet add package NetEvolve.HealthPublishers.OpenTelemetry
PackageReference
<PackageReference Include="NetEvolve.HealthPublishers.OpenTelemetry" Version="x.x.x" />
Quick Start
using NetEvolve.HealthPublishers.OpenTelemetry;
var builder = services.AddHealthChecks();
builder.AddOpenTelemetryPublisher(options =>
{
options.SystemIdentifier = "checkout-service";
});
Usage
Basic Example
Register under the default name ("Default"), configured via code:
var builder = services.AddHealthChecks();
builder.AddOpenTelemetryPublisher(options =>
{
options.SystemIdentifier = "checkout-service"; // Required, tags metrics alongside the machine name
});
Advanced Example
Register multiple named publishers; every recorded metric carries a healthchecks.publisher.name tag matching the name used to register it:
var builder = services.AddHealthChecks();
builder.AddOpenTelemetryPublisher("Internal", options => options.SystemIdentifier = "checkout-service");
builder.AddOpenTelemetryPublisher("External", options => options.SystemIdentifier = "checkout-service");
Consuming the metrics
Since metrics are emitted via a plain Meter named NetEvolve.HealthPublishers.OpenTelemetry, any listener can subscribe, e.g. with the OpenTelemetry SDK:
services.AddOpenTelemetry().WithMetrics(metrics => metrics.AddMeter("NetEvolve.HealthPublishers.OpenTelemetry"));
Configuration
Code-based
builder.AddOpenTelemetryPublisher(options =>
{
options.SystemIdentifier = "checkout-service"; // Required
});
appsettings.json-based
builder.AddOpenTelemetryPublisher(); // reads the "Default" section below
{
"HealthPublishers": {
"OpenTelemetry": {
"Default": {
"SystemIdentifier": "checkout-service"
}
}
}
}
When using an explicit name, the section key must match: builder.AddOpenTelemetryPublisher("Internal") reads HealthPublishers:OpenTelemetry:Internal.
Requirements
- .NET 8.0 or higher
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.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
- 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
- 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 |