OpenTelemetry 1.13.1
Prefix ReservedSee the version list below for details.
dotnet add package OpenTelemetry --version 1.13.1
NuGet\Install-Package OpenTelemetry -Version 1.13.1
<PackageReference Include="OpenTelemetry" Version="1.13.1" />
<PackageVersion Include="OpenTelemetry" Version="1.13.1" />
<PackageReference Include="OpenTelemetry" />
paket add OpenTelemetry --version 1.13.1
#r "nuget: OpenTelemetry, 1.13.1"
#:package OpenTelemetry@1.13.1
#addin nuget:?package=OpenTelemetry&version=1.13.1
#tool nuget:?package=OpenTelemetry&version=1.13.1
OpenTelemetry .NET SDK
<details> <summary>Table of Contents</summary>
</details>
Installation
dotnet add package OpenTelemetry
Introduction
OpenTelemetry SDK is a reference implementation of the OpenTelemetry API. It
implements the Logging API, Metrics API, Tracing API, Resource API, and the
Context API. Once a valid SDK is installed and configured all the OpenTelemetry
API methods, which were no-ops without an SDK, will start emitting telemetry.
This SDK also ships with
ILogger
integration to automatically capture and enrich logs emitted using
Microsoft.Extensions.Logging.
The SDK deals with concerns such as sampling, processing pipelines (exporting telemetry to a particular backend, etc.), metrics aggregation, and other concerns outlined in the OpenTelemetry Specification. In most cases, users indirectly install and enable the SDK when they install an exporter.
To learn how to set up and configure the OpenTelemetry SDK see: Getting started. For additional details about initialization patterns see: Initialize the SDK.
Troubleshooting
All the components shipped from this repo uses
EventSource
for its internal logging. The name of the EventSource used by OpenTelemetry
SDK is "OpenTelemetry-Sdk". To know the EventSource names used by other
components, refer to the individual readme files.
While it is possible to view these logs using tools such as PerfView, dotnet-trace etc., this SDK also ships a self-diagnostics feature, which helps with troubleshooting.
Self-diagnostics
OpenTelemetry SDK ships with built-in self-diagnostics feature. This feature, when enabled, will listen to internal logs generated by all OpenTelemetry components (i.e EventSources whose name starts with "OpenTelemetry-") and writes them to a log file.
The self-diagnostics feature can be enabled/changed/disabled while the process
is running (without restarting the process). The SDK will attempt to read the
configuration file every 10 seconds in non-exclusive read-only mode. The SDK
will create or overwrite a file with new logs according to the configuration.
This file will not exceed the configured max size and will be overwritten in a
circular way.
To enable self-diagnostics, go to the
current working directory of
your process and create a configuration file named OTEL_DIAGNOSTICS.json with
the following content:
{
    "LogDirectory": ".",
    "FileSize": 32768,
    "LogLevel": "Warning",
    "FormatMessage": "true"
}
To disable self-diagnostics, delete the above file.
Tip: In most cases, you could just drop the file along your application. On Windows, you can use Process Explorer, double click on the process to pop up Properties dialog and find "Current directory" in "Image" tab. Internally, it looks for the configuration file located in GetCurrentDirectory, and then AppContext.BaseDirectory. You can also find the exact directory by calling these methods from your code.
Configuration Parameters
- LogDirectoryis the directory where the output log file will be stored. It can be an absolute path or a relative path to the current directory.
- FileSizeis a positive integer, which specifies the log file size in KiB. This value must be within range- [1024, 131072](1 MiB /<= size /<= 128 MiB), or it will be rounded to the closest upper or lower limit. The log file will never exceed this configured size, and will be overwritten in a circular way.
- LogLevelis the lowest level of the events to be captured. It has to be one of the values of the- EventLevelenum. The level signifies the severity of an event. Lower severity levels encompass higher severity levels. For example,- Warningincludes the- Errorand- Criticallevels.
- FormatMessageis a boolean value that controls whether log messages should be formatted by replacing placeholders (- {0},- {1}, etc.) with their actual parameter values. When set to- false(default), messages are logged with unformatted placeholders followed by raw parameter values. When set to- true, placeholders are replaced with formatted parameter values for improved readability.- Example with - FormatMessage: false(default):- 2025-07-24T01:45:04.1020880Z:Measurements from Instrument '{0}', Meter '{1}' will be ignored. Reason: '{2}'. Suggested action: '{3}'{dotnet.gc.collections}{System.Runtime}{Instrument belongs to a Meter not subscribed by the provider.}{Use AddMeter to add the Meter to the provider.}- Example with - FormatMessage: true:- 2025-07-24T01:44:44.7059260Z:Measurements from Instrument 'dotnet.gc.collections', Meter 'System.Runtime' will be ignored. Reason: 'Instrument belongs to a Meter not subscribed by the provider.'. Suggested action: 'Use AddMeter to add the Meter to the provider.'
Remarks
A FileSize-KiB log file named as ExecutableName.ProcessId.log (e.g.
foobar.exe.12345.log) will be generated at the specified directory
LogDirectory, into which logs are written to.
If the SDK fails to parse the LogDirectory, FileSize or LogLevel fields as
the specified format, the configuration file will be treated as invalid and no
log file would be generated.
When the LogDirectory or FileSize is found to be changed, the SDK will create
or overwrite a file with new logs according to the new configuration. The
configuration file has to be no more than 4 KiB. In case the file is larger than
4 KiB, only the first 4 KiB of content will be read.
The log file might not be a proper text file format to achieve the goal of having
minimal overhead and bounded resource usage: it may have trailing NULs if log
text is less than configured size; once write operation reaches the end, it will
start from beginning and overwrite existing text.
References
| Product | Versions Compatible and additional computed target framework versions. | 
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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 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. | 
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. | 
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. | 
| .NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. | 
| MonoAndroid | monoandroid was computed. | 
| MonoMac | monomac was computed. | 
| MonoTouch | monotouch was computed. | 
| Tizen | tizen40 was computed. tizen60 was computed. | 
| Xamarin.iOS | xamarinios was computed. | 
| Xamarin.Mac | xamarinmac was computed. | 
| Xamarin.TVOS | xamarintvos was computed. | 
| Xamarin.WatchOS | xamarinwatchos was computed. | 
- 
                                                    .NETFramework 4.6.2- Microsoft.Extensions.Diagnostics.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Logging.Configuration (>= 9.0.0)
- OpenTelemetry.Api.ProviderBuilderExtensions (>= 1.13.1)
 
- 
                                                    .NETStandard 2.0- Microsoft.Extensions.Diagnostics.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Logging.Configuration (>= 9.0.0)
- OpenTelemetry.Api.ProviderBuilderExtensions (>= 1.13.1)
 
- 
                                                    .NETStandard 2.1- Microsoft.Extensions.Diagnostics.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Logging.Configuration (>= 9.0.0)
- OpenTelemetry.Api.ProviderBuilderExtensions (>= 1.13.1)
 
- 
                                                    net8.0- Microsoft.Extensions.Diagnostics.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Logging.Configuration (>= 9.0.0)
- OpenTelemetry.Api.ProviderBuilderExtensions (>= 1.13.1)
 
- 
                                                    net9.0- Microsoft.Extensions.Diagnostics.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Logging.Configuration (>= 9.0.0)
- OpenTelemetry.Api.ProviderBuilderExtensions (>= 1.13.1)
 
NuGet packages (448)
Showing the top 5 NuGet packages that depend on OpenTelemetry:
| Package | Downloads | 
|---|---|
| OpenTelemetry.Extensions.Hosting Contains extensions to start OpenTelemetry in applications using Microsoft.Extensions.Hosting | |
| OpenTelemetry.Exporter.OpenTelemetryProtocol OpenTelemetry protocol exporter for OpenTelemetry .NET | |
| OpenTelemetry.Exporter.Console Console exporter for OpenTelemetry .NET | |
| OpenTelemetry.Instrumentation.GrpcNetClient gRPC for .NET client instrumentation for OpenTelemetry .NET. | |
| OpenTelemetry.Exporter.Prometheus.AspNetCore ASP.NET Core middleware for hosting OpenTelemetry .NET Prometheus Exporter | 
GitHub repositories (68)
Showing the top 20 popular GitHub repositories that depend on OpenTelemetry:
| Repository | Stars | 
|---|---|
| dotnet/runtime 
                                                            .NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
                                                         | |
| dotnetcore/CAP 
                                                            Distributed transaction solution in micro-service base on eventually consistency, also an eventbus with Outbox pattern
                                                         | |
| quartznet/quartznet 
                                                            Quartz Enterprise Scheduler .NET
                                                         | |
| Azure/azure-sdk-for-net 
                                                            This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net. 
                                                         | |
| dotnet/tye 
                                                            Tye is a tool that makes developing, testing, and deploying microservices and distributed applications easier. Project Tye includes a local orchestrator to make developing microservices easier and the ability to deploy microservices to Kubernetes with minimal configuration.
                                                         | |
| microsoft/kiota 
                                                            OpenAPI based HTTP Client code generator
                                                         | |
| modelcontextprotocol/csharp-sdk 
                                                            The official C# SDK for Model Context Protocol servers and clients. Maintained in collaboration with Microsoft.
                                                         | |
| JasperFx/marten 
                                                            .NET Transactional Document DB and Event Store on PostgreSQL
                                                         | |
| linq2db/linq2db 
                                                            Linq to database provider.
                                                         | |
| BrighterCommand/Brighter 
                                                            A framework for building messaging apps with .NET and C#.
                                                         | |
| Nexus-Mods/NexusMods.App 
                                                            Home of the development of the Nexus Mods App
                                                         | |
| asynkron/protoactor-dotnet 
                                                            Proto Actor - Ultra fast distributed actors for Go, C# and Java/Kotlin
                                                         | |
| JasperFx/wolverine 
                                                            Supercharged .NET server side development!
                                                         | |
| DuendeSoftware/products 
                                                            The most flexible and standards-compliant OpenID Connect and OAuth 2.x framework for ASP.NET Core
                                                         | |
| DearVa/Everywhere 
                                                            A context-aware AI assistant for your desktop. Ready to respond intelligently, seamlessly integrating multiple LLMs and MCP tools.
                                                         | |
| thangchung/clean-architecture-dotnet 
                                                            🕸 Yet Another .NET Clean Architecture, but for Microservices project. It uses Minimal Clean Architecture with DDD-lite, CQRS-lite, and just enough Cloud-native patterns apply on the simple eCommerce sample and run on Tye with Dapr extension 🍻
                                                         | |
| drasi-project/drasi-platform 
                                                            The Data Change Processing platform
                                                         | |
| SteeltoeOSS/Steeltoe 
                                                            .NET Components for Externalized Configuration, Database Connectors, Service Discovery, Logging and Distributed Tracing, Application Management, Security, and more.
                                                         | |
| 2881099/FreeRedis 
                                                            🦄 FreeRedis is .NET40+ redis client. supports cluster, sentinel, master-slave, pub-sub, lua, pipeline, transaction, streams, redisearch, client-side-caching, and pooling.
                                                         | |
| CodeMazeBlog/CodeMazeGuides 
                                                            The main repository for all the Code Maze guides
                                                         | 
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 1.14.0-rc.1 | 4,269 | 10/21/2025 | |
| 1.13.1 | 901,757 | 10/9/2025 | |
| 1.13.0 | 663,746 | 10/1/2025 | |
| 1.12.0 | 20,503,164 | 4/30/2025 | |
| 1.11.2 | 12,408,597 | 3/4/2025 | |
| 1.9.0 | 55,410,221 | 6/14/2024 | |
| 1.9.0-rc.1 | 356,890 | 6/7/2024 | |
| 1.9.0-alpha.1 | 112,678 | 5/20/2024 | |
| 1.8.1 | 27,546,183 | 4/18/2024 | |
| 1.8.0 | 10,093,413 | 4/3/2024 | |
| 1.8.0-rc.1 | 2,314,499 | 3/27/2024 | |
| 1.8.0-beta.1 | 265,342 | 3/14/2024 | |
| 1.7.0 | 18,381,042 | 12/9/2023 | |
| 1.7.0-rc.1 | 2,566,589 | 11/30/2023 | |
| 1.7.0-alpha.1 | 727,913 | 10/17/2023 | |
| 1.6.0 | 23,247,235 | 9/6/2023 | |
| 1.6.0-rc.1 | 3,048,592 | 8/21/2023 | |
| 1.6.0-alpha.1 | 623,556 | 7/12/2023 | |
| 1.5.1 | 16,804,936 | 6/26/2023 | |
| 1.5.0 | 4,414,641 | 6/6/2023 | |
| 1.5.0-rc.1 | 2,824,575 | 5/26/2023 | |
| 1.5.0-alpha.2 | 1,177,817 | 4/1/2023 | |
| 1.5.0-alpha.1 | 1,634,255 | 3/8/2023 | |
| 1.4.0 | 17,915,888 | 2/24/2023 | |
| 1.4.0-rc.4 | 3,278,122 | 2/11/2023 | |
| 1.4.0-rc.3 | 815,249 | 2/2/2023 | |
| 1.4.0-rc.2 | 1,088,362 | 1/9/2023 | |
| 1.4.0-rc.1 | 1,397,439 | 12/12/2022 | |
| 1.4.0-beta.3 | 2,175,075 | 11/7/2022 | |
| 1.4.0-beta.2 | 1,198,157 | 10/17/2022 | |
| 1.4.0-beta.1 | 433,749 | 9/30/2022 | |
| 1.4.0-alpha.2 | 1,860,832 | 8/18/2022 | |
| 1.4.0-alpha.1 | 1,634,706 | 8/3/2022 | |
| 1.3.2 | 4,615,590 | 12/20/2022 | |
| 1.3.1 | 8,394,452 | 9/8/2022 | |
| 1.3.0 | 9,130,595 | 6/3/2022 | |
| 1.3.0-rc.2 | 1,906,063 | 6/1/2022 | |
| 1.3.0-beta.2 | 222,446 | 5/17/2022 | |
| 1.3.0-beta.1 | 2,659,830 | 4/20/2022 | |
| 1.2.0 | 6,785,999 | 4/15/2022 | |
| 1.2.0-rc5 | 764,083 | 4/13/2022 | |
| 1.2.0-rc4 | 826,758 | 3/30/2022 | |
| 1.2.0-rc3 | 1,142,407 | 3/5/2022 | |
| 1.2.0-rc2 | 2,787,003 | 2/3/2022 | |
| 1.2.0-rc1 | 2,417,200 | 11/30/2021 | |
| 1.2.0-beta2.1 | 497,758 | 11/19/2021 | |
| 1.2.0-beta1 | 5,549,849 | 10/8/2021 | |
| 1.2.0-alpha4 | 46,284 | 9/23/2021 | |
| 1.2.0-alpha3 | 20,920 | 9/14/2021 | |
| 1.2.0-alpha2 | 97,906 | 8/25/2021 | |
| 1.2.0-alpha1 | 127,981 | 7/23/2021 | |
| 1.1.0 | 11,432,724 | 7/13/2021 | |
| 1.1.0-rc1 | 277,981 | 6/26/2021 | |
| 1.1.0-beta4 | 2,494,569 | 6/9/2021 | |
| 1.1.0-beta3 | 244,443 | 5/12/2021 | |
| 1.1.0-beta2 | 531,676 | 4/23/2021 | |
| 1.1.0-beta1 | 1,428,764 | 3/19/2021 | |
| 1.0.1 | 11,540,872 | 2/10/2021 | |
| 1.0.0-rc4 | 43,164 | 2/9/2021 | |
| 1.0.0-rc3 | 32,870 | 2/5/2021 | |
| 1.0.0-rc2 | 343,296 | 1/30/2021 | |
| 1.0.0-rc1.1 | 664,932 | 11/18/2020 | |
| 0.8.0-beta.1 | 124,055 | 11/5/2020 | |
| 0.7.0-beta.1 | 28,660 | 10/16/2020 | |
| 0.6.0-beta.1 | 1,116,240 | 9/16/2020 | |
| 0.5.0-beta.2 | 19,438 | 8/28/2020 | |
| 0.4.0-beta.2 | 146,092 | 7/25/2020 | |
| 0.3.0-beta.1 | 5,367 | 7/23/2020 | |
| 0.2.0-alpha.275 | 248,262 | 5/19/2020 | |
| 0.2.0-alpha.220 | 462,368 | 5/19/2020 | |
| 0.2.0-alpha.179 | 183,693 | 1/28/2020 | |
| 0.2.0-alpha.100 | 249,923 | 11/5/2019 | |
| 0.2.0-alpha.40 | 176,065 | 9/24/2019 | |
| 0.2.0-alpha.5 | 28,964 | 8/3/2019 | 
For highlights and announcements see: https://github.com/open-telemetry/opentelemetry-dotnet/blob/core-1.13.1/RELEASENOTES.md.
        For detailed changes see: https://github.com/open-telemetry/opentelemetry-dotnet/blob/core-1.13.1/src/OpenTelemetry/CHANGELOG.md.