ObservaKit 1.0.1
dotnet add package ObservaKit --version 1.0.1
NuGet\Install-Package ObservaKit -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ObservaKit" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ObservaKit" Version="1.0.1" />
<PackageReference Include="ObservaKit" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ObservaKit --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ObservaKit, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ObservaKit@1.0.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ObservaKit&version=1.0.1
#tool nuget:?package=ObservaKit&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ObservaKit
Full-stack observability for .NET services in 2 lines of code.
What's included
- OpenTelemetry tracing + metrics with OTLP export
- Prometheus metrics endpoint at
/metrics - Serilog structured logging (Console, File, Grafana Loki)
- Circuit-breaker health monitor for external service health tracking
Quick start
var builder = WebApplication.CreateBuilder(args);
builder.AddObservability(); // <-- registers everything
var app = builder.Build();
app.UseObservability(); // <-- maps /metrics endpoint
app.Run();
Configuration
Add to appsettings.json:
{
"Observability": {
"ServiceName": "my-api",
"InstrumentationName": "MyApi",
"OtlpEndpoint": "http://localhost:4317",
"EnableSerilog": true,
"EnableAspNetCoreInstrumentation": true,
"AdditionalSources": [],
"AdditionalMeters": []
},
"CircuitBreakerHealthMonitor": {
"WindowSizeSeconds": 60,
"FailureThreshold": 0.5,
"MinimumRequests": 5
}
}
All settings are optional. Sensible defaults are applied.
Health monitor
Track external service health with a sliding-window circuit breaker:
public class MyProcessor(IExternalServiceHealthMonitor health)
{
public async Task ProcessAsync()
{
if (!health.IsHealthy("payment-gateway"))
{
// fallback or queue for retry
}
var sw = Stopwatch.StartNew();
try
{
await CallExternalService();
health.RecordSuccess("payment-gateway", sw.ElapsedMilliseconds);
}
catch
{
health.RecordFailure("payment-gateway", sw.ElapsedMilliseconds);
throw;
}
}
}
Frameworks
- .NET 8.0
- .NET 9.0
License
MIT
| 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 was computed. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.11.2)
- OpenTelemetry.Exporter.Prometheus.AspNetCore (>= 1.11.0-beta.1)
- OpenTelemetry.Extensions.Hosting (>= 1.11.2)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.11.1)
- OpenTelemetry.Instrumentation.Http (>= 1.11.1)
- Serilog.AspNetCore (>= 9.0.0)
- Serilog.Sinks.Console (>= 6.1.1)
- Serilog.Sinks.File (>= 7.0.0)
- Serilog.Sinks.Grafana.Loki (>= 8.3.0)
-
net9.0
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.11.2)
- OpenTelemetry.Exporter.Prometheus.AspNetCore (>= 1.11.0-beta.1)
- OpenTelemetry.Extensions.Hosting (>= 1.11.2)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.11.1)
- OpenTelemetry.Instrumentation.Http (>= 1.11.1)
- Serilog.AspNetCore (>= 9.0.0)
- Serilog.Sinks.Console (>= 6.1.1)
- Serilog.Sinks.File (>= 7.0.0)
- Serilog.Sinks.Grafana.Loki (>= 8.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.