SyntaxCircus.Observability
0.1.3
See the version list below for details.
dotnet add package SyntaxCircus.Observability --version 0.1.3
NuGet\Install-Package SyntaxCircus.Observability -Version 0.1.3
<PackageReference Include="SyntaxCircus.Observability" Version="0.1.3" />
<PackageVersion Include="SyntaxCircus.Observability" Version="0.1.3" />
<PackageReference Include="SyntaxCircus.Observability" />
paket add SyntaxCircus.Observability --version 0.1.3
#r "nuget: SyntaxCircus.Observability, 0.1.3"
#:package SyntaxCircus.Observability@0.1.3
#addin nuget:?package=SyntaxCircus.Observability&version=0.1.3
#tool nuget:?package=SyntaxCircus.Observability&version=0.1.3
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.
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.