Syntrony.Logging.OpenTelemetry
1.1.0
dotnet add package Syntrony.Logging.OpenTelemetry --version 1.1.0
NuGet\Install-Package Syntrony.Logging.OpenTelemetry -Version 1.1.0
<PackageReference Include="Syntrony.Logging.OpenTelemetry" Version="1.1.0" />
<PackageVersion Include="Syntrony.Logging.OpenTelemetry" Version="1.1.0" />
<PackageReference Include="Syntrony.Logging.OpenTelemetry" />
paket add Syntrony.Logging.OpenTelemetry --version 1.1.0
#r "nuget: Syntrony.Logging.OpenTelemetry, 1.1.0"
#:package Syntrony.Logging.OpenTelemetry@1.1.0
#addin nuget:?package=Syntrony.Logging.OpenTelemetry&version=1.1.0
#tool nuget:?package=Syntrony.Logging.OpenTelemetry&version=1.1.0
Syntrony.Logging.OpenTelemetry
Backend-agnostic telemetry (logs, traces, metrics) for Syntrony.Logging, via OpenTelemetry with OTLP export.
Not tied to any specific backend — Aspire Dashboard, Azure Application Insights (native OTLP endpoint), or any
other OTLP-compatible collector are equally valid; the consuming application decides where to export.
builder.Services.AddSyntrony(options =>
{
options.UseLogging(log => log
.UseLog4Net()
.UseOpenTelemetry(otel =>
{
otel.ServiceName = "my-service";
otel.ServiceVersion = typeof(Program).Assembly.GetName().Version?.ToString();
otel.Endpoint = builder.Configuration["Telemetry:OtlpEndpoint"];
}));
});
UseOpenTelemetry(this ISyntronyLoggingBuilder, Action<SyntronyTelemetryOptions> configure, double? traceSampleRatio = null)
Never claims the structured-sink slot (RegisterStructuredSink) — composes freely with UseLog4Net() or
whichever structured sink is active, since telemetry and structured logging aren't mutually exclusive.
SyntronyTelemetryOptions:
| Property | Notes |
|---|---|
ServiceName |
Required — throws ArgumentException if left empty. |
ServiceVersion |
Optional, reported to the collector alongside ServiceName. |
Endpoint |
OTLP endpoint. Falls back to the OTEL_EXPORTER_OTLP_ENDPOINT environment variable when null. If neither is set, no exporter is registered — a warning is written once, the application still starts normally. |
EnableTraces / EnableMetrics / EnableLogs |
All true by default; independently toggle each signal. |
ConfigureTracing / ConfigureMetrics |
Escape hatches onto the underlying TracerProviderBuilder / MeterProviderBuilder, for anything this package doesn't wrap. |
traceSampleRatio (default 1.0, i.e. 100%) sets the ParentBasedSampler(TraceIdRatioBasedSampler(...)) used
for traces — pass a lower value in production to control cost; the default does not vary by environment on its
own.
Default instrumentation, added automatically when traces or metrics are enabled: ASP.NET Core and HttpClient
(query strings stripped from span attributes). Entity Framework Core instrumentation isn't bundled — its NuGet
package (OpenTelemetry.Instrumentation.EntityFrameworkCore) has never shipped a stable release, which broke
dotnet pack (NU5104, a stable package can't depend on a prerelease one). Add it yourself via
ConfigureTracing if you need it:
otel.ConfigureTracing = tracing => tracing.AddEntityFrameworkCoreInstrumentation();
Dependency on ASP.NET Core's shared framework
OpenTelemetry.Instrumentation.AspNetCore declares a FrameworkReference to Microsoft.AspNetCore.App, and
that propagates transitively to this package and to whoever installs it — a worker or console app that only
wants OTLP export (traces/metrics/logs without the ASP.NET Core instrumentation) can't use this package as-is.
Accepted as a deliberate exception: the real consumer of Syntrony.Logging.OpenTelemetry today is a web
service. If a non-web consumer shows up, the escape hatch is to fork this package without
OpenTelemetry.Instrumentation.AspNetCore — everything else here has no FrameworkReference.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- OpenTelemetry (>= 1.19.1)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.19.1)
- OpenTelemetry.Extensions.Hosting (>= 1.19.1)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.19.0)
- OpenTelemetry.Instrumentation.Http (>= 1.19.0)
- Syntrony.Logging (>= 1.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.