BlogDoFT.Libs.Api.OpenTelemetry 10.1.1

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

BlogDoFT.Libs.Api.OpenTelemetry

Helpers to integrate OpenTelemetry tracing, metrics and logs into ASP.NET Core APIs.

This library provides opinionated wiring and small helpers to capture common HTTP server telemetry, plus configuration mapping from IConfiguration so you can control exporters and instrumentations from appsettings.json.

Features

  • Easy registration of OpenTelemetry tracing, metrics and logs via a single AddOtel extension method
  • Configuration object model that maps to IConfiguration (see sample appsettings.json below)
  • Automatic registration of exporters (Console / Zipkin / OTLP / Prometheus) based on configuration

Quick start

  1. Reference the package in your Web API project.
  2. In Program.cs or Startup.cs, call the extension methods:
var builder = WebApplication.CreateBuilder(args);

builder.Services.AddOtel(builder.Configuration);

var app = builder.Build();
app.UseOpenTelemetry();

app.Run();

Configuration (appsettings.json)

The library reads an Observability section from IConfiguration. Minimal example enabling console tracing and metrics:

{
	"ApplicationName": "MyWebApi",
	"Observability": {
		"OpenTelemetry": {
			"IncludeFormattedMessage": true,
			"IncludeScopes": true,
			"ParseStateValues": true,
			"UseTracingExporter": "Console",
			"UseMetricsExporter": "Console",
			"UseLogExporter": "Console",
			"HistogramAggregation": "ExplicitBounds"
		}
	}
}

Enabling Zipkin exporter:

{
	"Observability": {
		"OpenTelemetry": {
			"UseTracingExporter": "Zipkin"
		},
		"ZipkinExporterOptions": {
			"Endpoint": "http://localhost:9411/api/v2/spans"
		}
	}
}

Enabling OTLP exporter (gRPC):

{
	"Observability": {
		"OpenTelemetry": {
			"UseTracingExporter": "Otlp",
			"UseMetricsExporter": "Otlp"
		},
		"OtlpExporterOptions": {
			"Endpoint": "http://otel-collector:4317",
			"Protocol": "Grpc"
		}
	}
}

Prometheus metrics

To enable Prometheus scraping endpoint set the metrics exporter to Prometheus and (optionally) configure PrometheusAspNetCoreOptions.

Notes

  • The library maps configuration into the Observability object model. See the Observability and nested classes for all available fields and defaults.
  • When using OTLP, the default endpoint is http://localhost:4317 and default protocol is gRPC.

Versioning

Starting with v10.0.0, this library's version numbering follows the major version of the .NET runtime it targets. For example, this version is compatible with .NET 10, so the major version is 10 — this explains the jump from the previous 1.x version series.

Product 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. 
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
10.1.1 226 9/24/2026
10.1.0 73 9/14/2026
10.0.1 70 9/14/2026
10.0.0 79 9/13/2026
1.14.0 87 9/13/2026
1.13.0 68 9/13/2026
1.12.0 154 8/27/2026
1.11.0 77 8/27/2026
1.10.0 309 11/16/2025