OpenTelemetryExtension.Instrumentation.Monitor 1.1.6

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

OpenTelemetryExtension.Instrumentation.Monitor

A helper library to quickly configure OpenTelemetry for .NET with three extension methods:

  • AddOpentelemetryTraces(...): configures tracing (AspNetCore + HttpClient + OTLP exporter).
  • AddOpentelemetryLogs(...): configures Serilog OpenTelemetry sink to send logs to your OpenTelemetry Collector.
  • AddOpentelemetryMetrics(...): configures metrics (AspNetCore + HttpClient + OTLP exporter).

Installation

dotnet add package OpenTelemetryExtension.Instrumentation.Monitor

Quick Start

In Program.cs:

using OpenTelemetryExtension.Instrumentation.Monitor;
using Serilog;

var builder = WebApplication.CreateBuilder(args);

var serviceName = "my-service";
var environment = builder.Environment.EnvironmentName;

// Traces endpoint (custom URL is supported)
builder.Services.AddOpentelemetryTraces(
    serviceName: serviceName,
    endpoint: "endpoint Traces for You",
    enviroment: environment);

// Logs endpoint (custom URL is supported)
builder.Services.AddOpentelemetryLogs(
    serviceName: serviceName,
    endpoint: "endpoint Logs for You",
    enviroment: environment);

// Metrics endpoint (custom URL is supported)
builder.Services.AddOpentelemetryMetrics(
    serviceName: serviceName,
    endpoint: "endpoint Metrics for You",
    enviroment: environment);

// If your app uses Serilog as the main logger:
builder.Host.UseSerilog();

var app = builder.Build();
app.MapGet("/", () => "OK");
app.Run();

If enviroment is null, the library auto-resolves environment from DOTNET_ENVIRONMENT or ASPNETCORE_ENVIRONMENT.

Parameters

  • serviceName: service name shown in your observability backend.
  • endpoint: OTLP collector endpoint.
  • enviroment: deployment environment (Development/Staging/Production).

Note: the current API parameter name is enviroment (kept as-is to match the package methods).

Default Instrumentation

AddOpentelemetryTraces(...) enables:

  • AddAspNetCoreInstrumentation()
  • AddHttpClientInstrumentation()
  • AddOtlpExporter(...)

AddOpentelemetryLogs(...) configures:

  • Serilog.Sinks.OpenTelemetry
  • protocol: HttpProtobuf
  • resource attributes: service.name, deployment.environment

AddOpentelemetryMetrics(...) enables:

  • AddAspNetCoreInstrumentation()
  • AddHttpClientInstrumentation()
  • AddOtlpExporter(...)
  • resource attributes: host.name, deployment.environment

Infrastructure Requirement

You need an OpenTelemetry Collector (or any OTLP-compatible backend) to receive traces/logs/metrics.

Default local collector ports are commonly:

  • OTLP gRPC: 4317
  • OTLP HTTP/protobuf: 4318

Your deployment can use custom URLs/ports, including endpoints without an explicit port (for example: http://domain/v1/traces).

Example endpoints:

  • Traces endpoint: endpoint Traces for You
  • Logs endpoint: endpoint Logs for You
  • Metrics endpoint: endpoint Metrics for You
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 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. 
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.6 60 3/27/2026
1.1.5 37 3/27/2026