BuildingBlocks.Telemetry 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package BuildingBlocks.Telemetry --version 1.0.1
                    
NuGet\Install-Package BuildingBlocks.Telemetry -Version 1.0.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="BuildingBlocks.Telemetry" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BuildingBlocks.Telemetry" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="BuildingBlocks.Telemetry" />
                    
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 BuildingBlocks.Telemetry --version 1.0.1
                    
#r "nuget: BuildingBlocks.Telemetry, 1.0.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 BuildingBlocks.Telemetry@1.0.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=BuildingBlocks.Telemetry&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=BuildingBlocks.Telemetry&version=1.0.1
                    
Install as a Cake Tool

BuildingBlocks.Telemetry

Config-driven OpenTelemetry metrics, logging, and tracing for .NET.

NuGet License: MIT

What's new in 1.0.1

  • IntegrateMediator also AddMeter("BuildingBlocks.Mediator") so Send metrics export with traces
  • TelemetryDefaults.MediatorMeter (same name as the mediator ActivitySource)

Requirements

  • .NET 8, .NET 9, or .NET 10 (net8.0 / net9.0 / net10.0)
  • IHostApplicationBuilder (Microsoft.AspNetCore.App)

Install

dotnet add package BuildingBlocks.Telemetry

Quick start

builder.AddTelemetry(o =>
{
    o.IntegrateMediator = true;
    o.Instrumentation.Npgsql = true;
    o.Instrumentation.EventBus = true;
});

builder.AddTelemetry(
    configureOptions: o => o.EnableMetrics = true,
    configureBuilder: t => t.AddSource("DbMigrations"));

OTLP turns on when OTEL_EXPORTER_OTLP_ENDPOINT is set. Prefer env over hard-coded endpoints. On that fast-path, Exporters.Otlp.Protocol is ignored; use OTEL_EXPORTER_OTLP_PROTOCOL.

Features

  • Tracing, metrics, and logs from one AddTelemetry call
  • Stable instrumentations: ASP.NET Core, HttpClient, Runtime, Npgsql (on by default); SqlClient opt-in
  • Framework meters: Hosting, Kestrel, Routing, Diagnostics, Auth, MemoryPool, Http, DNS
  • Health/metrics path filter (/health, /alive, /ready, /metrics)
  • RecordException and SetErrorStatusOnException
  • telemetry.component span tag for filtering
  • Startup summary log: service name, environment, signals, exporter modes, instrumentation — plus a warning when no exporter is configured
  • Source-only: Mediator (IntegrateMediator), EventBus, MassTransit
  • Exporters: OTLP, Console, optional Azure Monitor
  • ParentBased sampling; AlwaysOn in Development unless TracesSamplerRatio is set
  • Trace-based exemplars; deployment.environment / service.environment resource attributes
  • TelemetryActivity for manual spans
  • TelemetryBuilder hooks: ConfigureTracing / ConfigureMetrics / ConfigureLogging / AddSource / AddMeter

ConfigureAspNetCore / ConfigureHttpClient / ConfigureSqlClient order: Filter / RecordException → user callback → telemetry.component.

Extra instrumentations (not shipped here) go through TelemetryBuilder.ConfigureTracing.

Startup summary

One Information log after host start, e.g.:

BuildingBlocks.Telemetry ready for catalog-api in Development. Signals: traces, metrics, logs.
Exporters: OTLP (environment). Instrumentation: aspnetcore, httpclient, runtime, npgsql, framework-meters, mediator.

Endpoints, OTLP headers, and connection strings are never logged. Silence it with a log filter on BuildingBlocks.Telemetry.Internal.Pipeline.TelemetryStartupSummaryReporter.

Docs

License

MIT — Copyright (c) 2026 Mohammad Hasan Hosseini

Product 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 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 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
1.0.2 44 8/29/2026
1.0.1 40 8/27/2026
1.0.0 42 8/27/2026

1.0.1: IntegrateMediator also AddMeter(BuildingBlocks.Mediator) so Send metrics export with traces; TelemetryDefaults.MediatorMeter. https://github.com/Maxofpower/FeatureFusion/blob/main/CHANGELOG.md