SinkSharp.Sinks.OpenTelemetry 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package SinkSharp.Sinks.OpenTelemetry --version 1.0.0
                    
NuGet\Install-Package SinkSharp.Sinks.OpenTelemetry -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SinkSharp.Sinks.OpenTelemetry" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SinkSharp.Sinks.OpenTelemetry" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="SinkSharp.Sinks.OpenTelemetry" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SinkSharp.Sinks.OpenTelemetry --version 1.0.0
                    
#r "nuget: SinkSharp.Sinks.OpenTelemetry, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SinkSharp.Sinks.OpenTelemetry@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SinkSharp.Sinks.OpenTelemetry&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=SinkSharp.Sinks.OpenTelemetry&version=1.0.0
                    
Install as a Cake Tool

OpenTelemetry OTLP log export and distributed tracing for SinkSharp. Send fully-enriched, PII-masked log records via binary Protobuf over gRPC (port 4317) or HTTP (port 4318) to Jaeger, Grafana Loki, Datadog, New Relic, Honeycomb, Azure Monitor, or any OTel Collector. PII masking and enrichment run in-process — your data arrives at the backend clean, structured, and ready to query.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 86 11/13/2026
1.0.0 92 11/10/2026

v1.0.0 — Initial release

OtlpLogSink (ISink):
• True binary Protobuf export — gRPC (port 4317) and HTTP/Protobuf (port 4318)
• Wire format implemented from scratch using Google.Protobuf primitives
 — same approach as Serilog.Sinks.OpenTelemetry, no third-party proto package
• gRPC path: binary Protobuf framed per the gRPC spec (1-byte flag + 4-byte length)
 with Content-Type application/grpc+proto over HTTP/2
• HTTP path: binary Protobuf with Content-Type application/x-protobuf to /v1/logs
• PII masking runs in-process on the SinkSharp drainer thread before any OTLP write
 — CorrelationId, UserId, RequestPath, ElapsedMs, Environment on every log record
• LogEvent → OTel LogRecord mapping per OTel Log Data Model spec:
 SeverityNumber, SeverityText, Body, log.record.original, code.namespace,
 correlation.id, trace.id, span.id, exception.type/message/stacktrace
• Batching with configurable BatchSize (default 512) and FlushInterval (default 5s)
• Error and Critical events flush immediately — never held in the batch
• Background timer flush — events reach backends within seconds of being emitted
• Retry with exponential back-off (1s → 2s → 4s) on transient failures
• Graceful drain on shutdown — DisposeAsync flushes remaining buffer before exit
• OtlpSuppressingHandler — prevents AddHttpClientInstrumentation from creating
 child spans for the sink's own OTLP export calls

AddSinkSharpTracing():
• Registers OpenTelemetry distributed tracing via configureTracing callback
• Resource attributes (service.name, service.version, deployment.environment)
 set from OtlpLogSinkOptions — one config object for both logs and traces
• Caller adds instrumentation (AspNetCore, HttpClient, SqlClient) and OTLP exporter
 in the callback — package stays independent of specific instrumentation libraries

Supported backends (same OtlpLogSink, zero per-backend code changes):
 Jaeger              http://jaeger:4318             HTTP/Protobuf
 Grafana/Loki        via OTel Collector 4318        HTTP/Protobuf
 Datadog Agent       http://datadog-agent:4317      gRPC
 Datadog OTLP        https://http-intake.logs/...    HTTP + DD-API-KEY header
 New Relic           https://otlp.nr-data.net:4317/  gRPC + api-key header
 Honeycomb           https://api.honeycomb.io/       HTTP + x-honeycomb-team header
 Azure Monitor       via OTel Collector             gRPC or HTTP
 Any OTel Collector  http://otelcol:4317/4318       gRPC or HTTP

Dependencies:
 Google.Protobuf                  3.30.1  — binary Protobuf serialisation
 OpenTelemetry.Extensions.Hosting 1.9.0   — AddSinkSharpTracing() registration