SyntaxCircus.Observability
0.1.4
dotnet add package SyntaxCircus.Observability --version 0.1.4
NuGet\Install-Package SyntaxCircus.Observability -Version 0.1.4
<PackageReference Include="SyntaxCircus.Observability" Version="0.1.4" />
<PackageVersion Include="SyntaxCircus.Observability" Version="0.1.4" />
<PackageReference Include="SyntaxCircus.Observability" />
paket add SyntaxCircus.Observability --version 0.1.4
#r "nuget: SyntaxCircus.Observability, 0.1.4"
#:package SyntaxCircus.Observability@0.1.4
#addin nuget:?package=SyntaxCircus.Observability&version=0.1.4
#tool nuget:?package=SyntaxCircus.Observability&version=0.1.4
SyntaxCircus.Observability
Opt-in OpenTelemetry/OTLP, Serilog OTLP, and Sentry-compatible error-reporting support for .NET 10 server hosts.
No support guaranteed. Published as-is and maintained on a best-effort basis.
Install
dotnet add package SyntaxCircus.Observability
Quick start
using SyntaxCircus.Observability;
using SyntaxCircus.AspNetCore.Serilog;
var builder = WebApplication.CreateBuilder(args);
var telemetry = builder.AddSyntaxCircusObservability("my-service", ["MyCompany.MyMeter"]);
builder.AddStandardSerilog(configureEnrichment: telemetry.ConfigureSerilog);
if (telemetry.Options.Sentry.IsEnabled)
{
builder.WebHost.UseSentry(sentry => telemetry.ConfigureSentry(
sentry,
context => context.TransactionContext.Name.Contains("/_blazor", StringComparison.OrdinalIgnoreCase) ? 0d : null));
}
var app = builder.Build();
telemetry.LogStartupWarning(app.Logger);
The registration also works with HostApplicationBuilder for OTLP traces, metrics, and Serilog logs. Sentry web capture is configured through WebApplicationBuilder.WebHost and is intentionally web-only in v1.
Blazor Server circuit-disposal noise (opt-in)
Components that dispose JS modules in an async void Dispose() (for example Blazor-ApexCharts) leave an unobserved JSDisconnectedException when a circuit drops. It is harmless but is reported as an error. Opt in to ignore it:
DisconnectedCircuitNoiseFilter.AddTo(sentry); // inside UseSentry(...); drops matching Sentry events
DisconnectedCircuitNoiseFilter.Register(app.Logger); // after Build(); observes the task, logs at Debug
Only exceptions made up entirely of JSDisconnectedException are affected.
Broker-unreachable noise (opt-in)
While a message broker is down, its client (for example RabbitMQ.Client's dual-stack connect) can leave faulted tasks nobody observes. The bus keeps retrying, but Sentry reports each stray task as a fatal AggregateException. Opt in to ignore them:
BrokerUnreachableNoiseFilter.AddTo(sentry); // inside UseSentry(...); drops matching Sentry events
BrokerUnreachableNoiseFilter.Register(app.Logger); // after Build(); observes the task, logs at Warning
Only an AggregateException made up entirely of broker connection failures (SocketException, RabbitMQ BrokerUnreachableException/ConnectFailureException, MassTransit RabbitMqConnectionException) is affected; the package takes no broker dependency. Keep a readiness check on the broker to catch a real outage.
Configuration
The package reads standard OpenTelemetry and Sentry sections. Telemetry is disabled by default and an enabled but invalid OTLP endpoint produces a safe warning without exporting data. Sentry remains disabled until a DSN is supplied; it sends error-level events only, disables default PII collection, and has a trace sample rate of 0.0 by default.
Keep OTLP headers and Sentry DSNs in deployment secrets. Use the Sentry sampling callback for application-specific noisy routes.
License
Deferred architecture proposal: web-neutral observability. No package split is implemented yet.
MIT. See LICENSE.txt.
| 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
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.17.0)
- OpenTelemetry.Extensions.Hosting (>= 1.17.0)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.17.0)
- OpenTelemetry.Instrumentation.Http (>= 1.17.0)
- OpenTelemetry.Instrumentation.Runtime (>= 1.17.0)
- Sentry.AspNetCore (>= 6.7.0)
- Serilog.Sinks.OpenTelemetry (>= 4.2.0)
- SyntaxCircus.AspNetCore.Common (>= 0.1.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.