VOOZH about

URL: https://www.nuget.org/packages/JF91.OpenTelemetry/

⇱ NuGet Gallery | JF91.OpenTelemetry 1.2.3




JF91.OpenTelemetry 1.2.3

dotnet add package JF91.OpenTelemetry --version 1.2.3
 
 
NuGet\Install-Package JF91.OpenTelemetry -Version 1.2.3
 
 
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="JF91.OpenTelemetry" Version="1.2.3" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JF91.OpenTelemetry" Version="1.2.3" />
 
Directory.Packages.props
<PackageReference Include="JF91.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 JF91.OpenTelemetry --version 1.2.3
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: JF91.OpenTelemetry, 1.2.3"
 
 
#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 JF91.OpenTelemetry@1.2.3
 
 
#: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=JF91.OpenTelemetry&version=1.2.3
 
Install as a Cake Addin
#tool nuget:?package=JF91.OpenTelemetry&version=1.2.3
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Use this package to integrate OpenTelemetry into your ASP.NET Web API using appsettings.json

<br>

Follow these steps to get it done:

1: Install Nuget Package
dotnet add package JF91.OpenTelemetry

<br>

2: Add this after var builder = WebApplication.CreateBuilder(args);
builder.Services.AddOpenTelemetryServices(builder.Configuration);
2.2: Customize settings (Optional):
Custom options are optional which means that you can mix options from appsettings.json with the ones defined below
builder.Services.AddOpenTelemetryServices
(
 builder.Configuration,
 jaegerOptions =>
 {
 jaegerOptions.Enabled = true;
 jaegerOptions.Endpoint = "http://www.test.com";
 jaegerOptions.Protocol = JaegerProtocols.Http;
 },
 zipkinOptions =>
 {
 zipkinOptions.Enabled = true;
 zipkinOptions.Endpoint = "http://www.test.com";
 },
 influxdbOptions =>
 {
 influxdbOptions.Enabled = true;
 influxdbOptions.Url = "http://www.test.com";
 influxdbOptions.Protocol = JaegerProtocols.Http;
 },
 new List<Action<Otlp>>
 {
 otlp_one =>
 {
 otlp_one.Enabled = true;
 otlp_one.Url = "http://www.test.com";
 otlp_one.Protocol = OtlpProtocols.Http;
 },
 otlp_two =>
 {
 otlp_two.Enabled = true;
 otlp_two.Url = "http://www.test2.com";
 otlp_two.Protocol = OtlpProtocols.Grpc;
 }
 },
 prometheusOptions =>
 {
 prometheusOptions.Enabled = true;
 prometheusOptions.ScrapeEndpointPath = "/test";
 prometheusOptions.ScrapeResponseCacheDurationMilliseconds = 1000;
 }
);
IMPORTANT: For a custom options list to OTLP Exporters, you need to have the same ammount of entries in appsettings.json with the same order.

Example 1: 3 OTLP Exporters in appsettings.json and 2 Custom Options will override the first 2 OTLP Exportes in appsettings.json from the first 2 Custom Options.

Example 2: 2 OTLP Exporters in appsettings.json and 3 Custom Options will override the 2 OTLP Exporters in appsettings.json from the first 2 Custom Options.

<br>

3: Add this before app.Run();
app.AddOpenTelemetryExtensions();

<br>

4: Add this to your appsettings.json and modify it to your needs:
"OpenTelemetrySettings": {
 "EnableTraces": true,
 "EnableMetrics": true,
 "Exporters": {
 "Console": {
 "Enabled": true
 },
 "Jaeger": {
 "Enabled": true,
 "Endpoint": "http://localhost:14268/api/traces",
 "Protocol": "udp"
 },
 "Zipkin": {
 "Enabled": false,
 "Endpoint": " https://localhost:9411/api/v2/spans"
 },
 "Prometheus": {
 "Enabled": true,
 "ScrapeEndpointPath": "/metrics-text",
 "ScrapeResponseCacheDurationMilliseconds": 300
 },
 "InfluxDB": {
 "Enabled": false,
 "Url": "http://localhost:8086",
 "Protocol": "http"
 },
 "Otlp": [
 {
 "Enabled": true,
 "Url": "http://localhost:4317",
 "Protocol": "grpc"
 },
 {
 "Enabled": false,
 "Url": "http://localhost:4317",
 "Protocol": "http"
 }
 ]
 },
 "Instrumentation": {
 "Http": true,
 "EfCore": false,
 "Hangfire": false,
 "SqlClient": false,
 "Redis": false
 }
}

Properties Values:

  • Jaeger.Protocol: udp / http | Default ⇒ udp

  • [OtlpProtocols] > InfluxDB.Protocol: grpc / http | Default ⇒ grpc

Reference: https://opentelemetry.io/docs/instrumentation/net/exporters/
Product Versions Compatible and additional computed target framework versions.
.NET net7.0 net7.0 is compatible.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 was computed.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows 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.2.3 479 7/24/2023
1.2.2 233 7/23/2023
1.2.0 282 7/12/2023
1.0.1 256 7/11/2023

Version 1.2.3:
# Fixed non-null exception when not passing an OTLP Options List

Version 1.2.2:
# Added delegates for each parent settings providing the ability to customize all options for tracing and metrics.

Version 1.2:
# Added OTLP Exporter Colletion
# appsettings.json extended with OTLP Exporter Array