Kck.Observability.Abstractions
4.8.0
See the version list below for details.
dotnet add package Kck.Observability.Abstractions --version 4.8.0
NuGet\Install-Package Kck.Observability.Abstractions -Version 4.8.0
<PackageReference Include="Kck.Observability.Abstractions" Version="4.8.0" />
<PackageVersion Include="Kck.Observability.Abstractions" Version="4.8.0" />
<PackageReference Include="Kck.Observability.Abstractions" />
paket add Kck.Observability.Abstractions --version 4.8.0
#r "nuget: Kck.Observability.Abstractions, 4.8.0"
#:package Kck.Observability.Abstractions@4.8.0
#addin nuget:?package=Kck.Observability.Abstractions&version=4.8.0
#tool nuget:?package=Kck.Observability.Abstractions&version=4.8.0
Kck.Observability.Abstractions
Observability abstractions — distributed tracing (ITracingService), structured metrics (IMetricsService), and health checks (IHealthCheck) backed by the OpenTelemetry provider.
Installation
dotnet add package Kck.Observability.Abstractions
Quick Start
using Kck.Observability.Abstractions;
// Program.cs — the provider (Kck.Observability.OpenTelemetry)
builder.Services.AddKckObservability(obs => obs.UseOpenTelemetry(otel =>
{
otel.ServiceName = "orders-api";
otel.EnableTracing().EnableMetrics();
}));
// Tracing and metrics in your code
public class OrderService(ITracingService tracer, IMetricsService metrics)
{
private readonly ICounter _ordersCreated = metrics.CreateCounter("orders.created", "Number of orders placed");
public async Task CreateOrderAsync(Guid customerId, CancellationToken ct)
{
using var span = tracer.StartSpan("order.create");
span.SetAttribute("customer.id", customerId.ToString());
try
{
await Task.Delay(10, ct); // save the order
_ordersCreated.Increment();
span.SetStatus(SpanStatus.Ok);
}
catch (Exception ex)
{
span.RecordException(ex);
span.SetStatus(SpanStatus.Error, ex.Message);
throw;
}
}
}
Configuration
| Property | Description | Default |
|---|---|---|
Observability:ServiceName |
Service name in traces/metrics | Assembly name |
Observability:Otlp:Endpoint |
OTLP exporter endpoint | "http://localhost:4317" |
Observability:Tracing:SamplingRatio |
Head sampling ratio (0.0–1.0) | 1.0 |
Resources
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- No dependencies.
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Kck.Observability.Abstractions:
| Package | Downloads |
|---|---|
|
Kck.Bundle.MinimalApi
Lightweight ASP.NET Core Minimal API starter pack. Slim variant of the WebAPI bundle — provides Serilog, in-memory caching, the JWT token service, exception handling, and health checks, without Argon2, the event bus or rate limiting. |
|
|
Kck.Bundle.WorkerService
Opinionated .NET Worker Service starter pack. Registers Serilog, health checks, InMemory event bus, and the Quartz background job scheduler in a single call. |
|
|
Kck.Bundle.WebApi
Opinionated ASP.NET Core WebAPI starter pack. Registers Serilog, in-memory caching, the JWT token service, Argon2 hashing, InMemory event bus, health checks, rate limiting, security headers, CORS, and global exception handling in a single AddKckWebApiDefaults() call. |
|
|
Kck.Observability.OpenTelemetry
OpenTelemetry-backed ITracingService and IMetricsService implementations. Exports traces and metrics via OTLP protocol, wires ASP.NET Core and EF Core auto-instrumentation, and registers Kck health checks at /health. Registered via AddKckObservability(). |
GitHub repositories
This package is not used by any popular GitHub repositories.