Nedo.AspNet.Logging.OpenTelemetry 1.1.0

dotnet add package Nedo.AspNet.Logging.OpenTelemetry --version 1.1.0
                    
NuGet\Install-Package Nedo.AspNet.Logging.OpenTelemetry -Version 1.1.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="Nedo.AspNet.Logging.OpenTelemetry" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nedo.AspNet.Logging.OpenTelemetry" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Nedo.AspNet.Logging.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 Nedo.AspNet.Logging.OpenTelemetry --version 1.1.0
                    
#r "nuget: Nedo.AspNet.Logging.OpenTelemetry, 1.1.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 Nedo.AspNet.Logging.OpenTelemetry@1.1.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=Nedo.AspNet.Logging.OpenTelemetry&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Nedo.AspNet.Logging.OpenTelemetry&version=1.1.0
                    
Install as a Cake Tool

Nedo.AspNet.Logging.OpenTelemetry

Platform-standard OpenTelemetry wiring for ASP.NET Core. One extension method replaces the boilerplate that every service on the platform would otherwise paste into Program.cs to register traces and metrics with the standard instrumentations and an OTLP exporter.

dotnet add package Nedo.AspNet.Logging.OpenTelemetry

Quickstart

using Nedo.AspNet.Logging.OpenTelemetry;
using Nedo.AspNet.Logging.Serilog;

var builder = WebApplication.CreateBuilder(args);

builder.UseNedoLogging();                   // ← Serilog console + JSON file
builder.AddNedoOpenTelemetry();             // ← OTel traces + metrics, OTLP exporter

var app = builder.Build();
app.UseNedoLogContext();
app.Run();

The OTLP endpoint defaults to whatever the standard OTEL_EXPORTER_OTLP_ENDPOINT env var resolves to (the OTel SDK's default fallback). Pin it from code only if you need to.

What the standard config does

AddNedoOpenTelemetry():

  • Resource: service.name, service.version (from the entry assembly's informational version), optional service.namespace.
  • Tracing: ASP.NET Core + HttpClient instrumentation, OTLP exporter.
  • Metrics: ASP.NET Core + HttpClient + runtime instrumentation, OTLP exporter.

Log/trace correlation works automatically: Serilog's built-in Activity enrichment writes TraceId / SpanId onto every log event, which lines up with the spans this package emits.

Customizing

builder.AddNedoOpenTelemetry(opts =>
{
    opts.ServiceNamespace = "checkout";
    opts.ConfigureResource = r => r.AddAttributes(new[]
    {
        new KeyValuePair<string, object>("deployment.environment", builder.Environment.EnvironmentName),
    });
    opts.ConfigureTracing = t => t.AddSource("MyApp.*");
    opts.ConfigureMetrics = m => m.AddMeter("MyApp.*");
});

What it doesn't do

  • Not a logs exporter — keep using Nedo.AspNet.Logging.Serilog. (To also forward Serilog events via OTLP, plug Serilog.Sinks.OpenTelemetry into UseNedoLogging's AdditionalConfiguration.)
  • Not a sampler config — the SDK default (parent-based, always-on) is the platform default. Override via ConfigureTracing.

License

MIT.

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.1.0 147 5/3/2026
1.0.0 118 5/2/2026