Kck.Observability.Abstractions
3.4.0
dotnet add package Kck.Observability.Abstractions --version 3.4.0
NuGet\Install-Package Kck.Observability.Abstractions -Version 3.4.0
<PackageReference Include="Kck.Observability.Abstractions" Version="3.4.0" />
<PackageVersion Include="Kck.Observability.Abstractions" Version="3.4.0" />
<PackageReference Include="Kck.Observability.Abstractions" />
paket add Kck.Observability.Abstractions --version 3.4.0
#r "nuget: Kck.Observability.Abstractions, 3.4.0"
#:package Kck.Observability.Abstractions@3.4.0
#addin nuget:?package=Kck.Observability.Abstractions&version=3.4.0
#tool nuget:?package=Kck.Observability.Abstractions&version=3.4.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
// Program.cs — register a concrete provider (Kck.Observability.OpenTelemetry)
builder.Services.AddKckOpenTelemetry(builder.Configuration);
// Tracing — wrap operations in spans
public class OrderService(ITracingService tracer, IMetricsService metrics)
{
private readonly ICounter _ordersCreated =
metrics.CreateCounter("orders.created", "Number of orders placed");
public async Task<Order> CreateOrderAsync(CreateOrderCommand cmd, CancellationToken ct)
{
using var span = tracer.StartSpan("order.create");
span.SetTag("customer.id", cmd.CustomerId.ToString());
try
{
var order = await _repo.AddAsync(Order.Create(cmd), ct);
_ordersCreated.Increment();
span.SetStatus(SpanStatus.Ok);
return order;
}
catch (Exception ex)
{
span.RecordException(ex);
span.SetStatus(SpanStatus.Error);
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.WebApi
Opinionated ASP.NET Core WebAPI starter pack. Registers Serilog, in-memory caching, JWT auth, Argon2 hashing, InMemory event bus, OpenTelemetry, rate limiting, security headers, CORS, and global exception handling in a single AddKckWebApiDefaults() call. |
|
|
Kck.Bundle.WorkerService
Opinionated .NET Worker Service starter pack. Registers Serilog, OpenTelemetry, InMemory event bus, and a mutually-exclusive background job scheduler (Hangfire or Quartz) in a single call. |
|
|
Kck.Bundle.MinimalApi
Lightweight ASP.NET Core Minimal API starter pack. Slim variant of the WebAPI bundle — provides Serilog, in-memory caching, JWT, exception handling, and health checks without MediatR pipeline or Argon2 overhead. |
|
|
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.