OpenTelemetry 1.10.0

Prefix Reserved
dotnet add package OpenTelemetry --version 1.10.0                
NuGet\Install-Package OpenTelemetry -Version 1.10.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="OpenTelemetry" Version="1.10.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add OpenTelemetry --version 1.10.0                
#r "nuget: OpenTelemetry, 1.10.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.
// Install OpenTelemetry as a Cake Addin
#addin nuget:?package=OpenTelemetry&version=1.10.0

// Install OpenTelemetry as a Cake Tool
#tool nuget:?package=OpenTelemetry&version=1.10.0                

OpenTelemetry .NET SDK

NuGet NuGet

<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"
}

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
  1. LogDirectory is the directory where the output log file will be stored. It can be an absolute path or a relative path to the current directory.

  2. FileSize is 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.

  3. LogLevel is the lowest level of the events to be captured. It has to be one of the values of the EventLevel enum. The level signifies the severity of an event. Lower severity levels encompass higher severity levels. For example, Warning includes the Error and Critical levels.

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 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. 
.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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (301)

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.Exporter.Jaeger

Jaeger exporter for OpenTelemetry .NET

OpenTelemetry.Instrumentation.GrpcNetClient

gRPC for .NET client instrumentation for OpenTelemetry .NET

GitHub repositories (53)

Showing the top 5 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.
Version Downloads Last updated
1.10.0 21,101 11/12/2024
1.10.0-rc.1 5,524 11/1/2024
1.10.0-beta.1 21,320 9/30/2024
1.9.0 11,945,184 6/14/2024
1.9.0-rc.1 131,496 6/7/2024
1.9.0-alpha.1 56,731 5/20/2024
1.8.1 9,016,539 4/18/2024
1.8.0 3,925,071 4/3/2024
1.8.0-rc.1 791,274 3/27/2024
1.8.0-beta.1 113,969 3/14/2024
1.7.0 11,741,516 12/9/2023
1.7.0-rc.1 1,423,677 11/30/2023
1.7.0-alpha.1 504,964 10/17/2023
1.6.0 13,657,465 9/6/2023
1.6.0-rc.1 1,497,344 8/21/2023
1.6.0-alpha.1 441,170 7/12/2023
1.5.1 10,954,174 6/26/2023
1.5.0 3,490,048 6/6/2023 1.5.0 is deprecated.
1.5.0-rc.1 1,872,668 5/26/2023
1.5.0-alpha.2 1,037,614 4/1/2023
1.5.0-alpha.1 1,266,411 3/8/2023
1.4.0 13,416,955 2/24/2023
1.4.0-rc.4 2,750,929 2/11/2023
1.4.0-rc.3 715,410 2/2/2023
1.4.0-rc.2 919,377 1/9/2023
1.4.0-rc.1 1,238,489 12/12/2022
1.4.0-beta.3 1,972,986 11/7/2022
1.4.0-beta.2 1,006,330 10/17/2022
1.4.0-beta.1 412,518 9/30/2022
1.4.0-alpha.2 1,698,742 8/18/2022
1.4.0-alpha.1 1,550,749 8/3/2022
1.3.2 3,671,527 12/20/2022
1.3.1 7,162,030 9/8/2022
1.3.0 7,990,302 6/3/2022 1.3.0 is deprecated because it has critical bugs.
1.3.0-rc.2 1,552,672 6/1/2022
1.3.0-beta.2 202,170 5/17/2022
1.3.0-beta.1 2,326,084 4/20/2022
1.2.0 5,279,864 4/15/2022 1.2.0 is deprecated because it has critical bugs.
1.2.0-rc5 562,247 4/13/2022
1.2.0-rc4 780,191 3/30/2022
1.2.0-rc3 1,092,278 3/5/2022
1.2.0-rc2 2,523,167 2/3/2022
1.2.0-rc1 2,231,342 11/30/2021
1.2.0-beta2.1 437,491 11/19/2021
1.2.0-beta1 4,869,335 10/8/2021
1.2.0-alpha4 41,713 9/23/2021
1.2.0-alpha3 20,285 9/14/2021
1.2.0-alpha2 92,800 8/25/2021
1.2.0-alpha1 122,356 7/23/2021
1.1.0 9,700,649 7/13/2021 1.1.0 is deprecated because it has critical bugs.
1.1.0-rc1 272,812 6/26/2021
1.1.0-beta4 2,115,284 6/9/2021
1.1.0-beta3 233,935 5/12/2021
1.1.0-beta2 522,430 4/23/2021
1.1.0-beta1 1,223,556 3/19/2021
1.0.1 7,889,934 2/10/2021 1.0.1 is deprecated because it has critical bugs.
1.0.0-rc4 41,630 2/9/2021
1.0.0-rc3 32,444 2/5/2021
1.0.0-rc2 322,569 1/30/2021
1.0.0-rc1.1 649,570 11/18/2020
0.8.0-beta.1 120,117 11/5/2020
0.7.0-beta.1 28,208 10/16/2020
0.6.0-beta.1 915,051 9/16/2020
0.5.0-beta.2 18,891 8/28/2020
0.4.0-beta.2 141,524 7/25/2020
0.3.0-beta.1 3,189 7/23/2020
0.2.0-alpha.275 238,337 5/19/2020
0.2.0-alpha.220 439,961 5/19/2020
0.2.0-alpha.179 176,716 1/28/2020
0.2.0-alpha.100 246,827 11/5/2019
0.2.0-alpha.40 136,735 9/24/2019
0.2.0-alpha.5 12,825 8/3/2019