Raycynix.Extensions.Observability.AspNetCore
3.0.0
dotnet add package Raycynix.Extensions.Observability.AspNetCore --version 3.0.0
NuGet\Install-Package Raycynix.Extensions.Observability.AspNetCore -Version 3.0.0
<PackageReference Include="Raycynix.Extensions.Observability.AspNetCore" Version="3.0.0" />
<PackageVersion Include="Raycynix.Extensions.Observability.AspNetCore" Version="3.0.0" />
<PackageReference Include="Raycynix.Extensions.Observability.AspNetCore" />
paket add Raycynix.Extensions.Observability.AspNetCore --version 3.0.0
#r "nuget: Raycynix.Extensions.Observability.AspNetCore, 3.0.0"
#:package Raycynix.Extensions.Observability.AspNetCore@3.0.0
#addin nuget:?package=Raycynix.Extensions.Observability.AspNetCore&version=3.0.0
#tool nuget:?package=Raycynix.Extensions.Observability.AspNetCore&version=3.0.0
Raycynix.Extensions.Observability.AspNetCore
Raycynix.Extensions.Observability.AspNetCore adds ASP.NET Core integration for Raycynix observability and includes the core observability registration.
What it contains
AddRaycynixAspNetCoreObservability(...)UseRaycynixObservability(this IApplicationBuilder app)MapRaycynixObservabilityEndpoints(this IEndpointRouteBuilder endpoints)- OpenTelemetry ASP.NET Core request metrics registration
- OpenTelemetry ASP.NET Core request tracing registration
- correlation middleware and
HttpClientcorrelation propagation
Usage
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRaycynixAspNetCoreObservability();
var app = builder.Build();
app.UseRaycynixObservability();
app.MapRaycynixObservabilityEndpoints();
app.Run();
AddRaycynixAspNetCoreObservability(...) already calls AddRaycynixObservability(), so no extra core registration is required in ASP.NET Core applications.
The endpoint helper maps health checks only. You can select a custom health path:
app.MapRaycynixObservabilityEndpoints("/internal/health");
Metrics export is explicit. For a Prometheus scraping endpoint:
builder.Services.AddOpenTelemetry()
.WithMetrics(metrics => metrics.AddPrometheusExporter());
// after builder.Build()
app.UseOpenTelemetryPrometheusScrapingEndpoint(
context => context.Request.Path == "/internal/metrics");
For Aspire and production OpenTelemetry pipelines, prefer OTLP export for both metrics and traces instead of adding a scraping endpoint to every resource.
ASP.NET Core tracing uses standard OpenTelemetry instrumentation and requires no custom tracing middleware. UseRaycynixObservability() only adds the Raycynix correlation context middleware. It does not require Raycynix.Extensions.Serilog.
By default, the request logging scope includes CorrelationId, TraceId, UserId, SubjectId, and SubjectType to preserve the previous enrichment behavior. Applications that do not want user or subject identifiers in log scopes can disable that part:
builder.Services.AddRaycynixAspNetCoreObservability(options =>
{
options.IncludeIdentityInLoggingScope = false;
});
| 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
- Raycynix.Extensions.Metrics.AspNetCore (>= 3.0.0)
- Raycynix.Extensions.Observability (>= 3.0.0)
- Raycynix.Extensions.Security.Abstractions (>= 3.0.0)
- Raycynix.Extensions.Tracing.AspNetCore (>= 3.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v3.0.0 registers OpenTelemetry ASP.NET Core metrics and tracing instrumentation, validates correlation identifiers before logging and propagation, removes obsolete tracing middleware and implicit metrics endpoint mapping, and keeps health and exporter endpoints explicit.