I-Synergy.Framework.OpenTelemetry 2025.11119.10110

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

OpenTelemetry Integration Guide

Overview

The I-Synergy.Framework provides a flexible OpenTelemetry integration that separates instrumentation configuration from exporter configuration. This separation allows for cleaner code organization and better maintainability.

Key Concepts

  • Instrumentation: Defines what to collect (which libraries, frameworks, or custom sources to monitor)
  • Exporters: Defines where to send the collected telemetry data (console, OTLP endpoint, Azure Monitor, etc.)

Architecture

The OpenTelemetry integration in I-Synergy.Framework consists of:

  • ITelemetryProvider interface that defines the contract
  • OpenTelemetryProvider implementation
  • Extension methods for different provider builders (Tracer, Meter, Logger)

Usage Guide

Basic Setup

// In Program.cs or Startup.cs
builder.Logging.AddOpenTelemetry(
    builder.Configuration,
    builder.Environment,
    infoService,
    "Telemetry",
    tracerInstrumentationAction: ConfigureTracingInstrumentation,
    tracerExportersAction: ConfigureTracingExporters,
    meterInstrumentationAction: ConfigureMetricsInstrumentation,
    meterExportersAction: ConfigureMetricsExporters,
    loggerInstrumentationAction: ConfigureLoggingInstrumentation,
    loggerExportersAction: ConfigureLoggingExporters);

Instrumentation Actions

Instrumentation actions should configure what telemetry data to collect.
These actions should add sources, configure sampling, and set up instrumentation for specific libraries or frameworks.

private static void ConfigureTracingInstrumentation(TracerProviderBuilder builder)
{
    // Add sources to collect data from
    builder.AddSource("MyApplicationName");
    
    // Add instrumentation for specific libraries
    builder.AddHttpClientInstrumentation(opts => 
    {
        opts.RecordException = true;
        opts.EnrichWithException = (activity, exception) =>
        {
            activity.SetTag("error.type", exception.GetType().Name);
            activity.SetTag("error.message", exception.Message);
        };
    });
    
    // Add ASP.NET Core instrumentation
    builder.AddAspNetCoreInstrumentation();
}

Exporter Actions

Exporter actions should configure where to send the collected telemetry data.
These actions should add exporters to different backends or services.

private static void ConfigureTracingExporters(TracerProviderBuilder builder)
{
    // Add Azure Monitor exporter
    builder.AddAzureMonitorTraceExporter(options =>
    {
        options.ConnectionString = "your-connection-string";
    });
    
    // Add Jaeger exporter
    builder.AddJaegerExporter(options =>
    {
        options.AgentHost = "localhost";
        options.AgentPort = 6831;
    });
}

Integration Examples

Azure Monitor Integration
builder.Logging.AddOpenTelemetry(
    builder.Configuration,
    builder.Environment,
    infoService,
    "Telemetry",
    tracerInstrumentationAction: builder =>
    {
        builder.AddSource(infoService.ProductName);
        builder.AddHttpClientInstrumentation();
    },
    tracerExportersAction: builder =>
    {
        var connectionString = builder.Configuration["Telemetry:ConnectionString"];
        if (!string.IsNullOrEmpty(connectionString))
        {
            builder.AddAzureMonitorTraceExporter(options =>
            {
                options.ConnectionString = connectionString;
            });
        }
    },
    meterExportersAction: builder =>
    {
        var connectionString = builder.Configuration["Telemetry:ConnectionString"];
        if (!string.IsNullOrEmpty(connectionString))
        {
            builder.AddAzureMonitorMetricExporter(options =>
            {
                options.ConnectionString = connectionString;
            });
        }
    },
    loggerExportersAction: builder =>
    {
        var connectionString = builder.Configuration["Telemetry:ConnectionString"];
        if (!string.IsNullOrEmpty(connectionString))
        {
            builder.AddOpenTelemetry(options =>
            {
                options.AddAzureMonitorLogExporter(o => 
                    o.ConnectionString = connectionString);
            });
        }
    });
Sentry Integration
builder.Logging.AddOpenTelemetry(
    builder.Configuration,
    builder.Environment,
    infoService,
    "Telemetry",
    tracerInstrumentationAction: builder =>
    {
        builder.AddSource(infoService.ProductName);
        builder.AddSentry();

        SentrySdk.Init(options =>
        {
            builder.Configuration.GetSection("Telemetry").Bind(options);
            options.Environment = builder.Environment.EnvironmentName;
            options.Debug = builder.Environment.IsDevelopment();
            options.ServerName = infoService.ProductName;
            options.Release = infoService.ProductVersion.ToString();
            options.UseOpenTelemetry();
        });
    });

Advanced Configuration

Manual Instrumentation

For manual instrumentation, you can inject and use the ActivitySource that's registered by the framework:

public class MyService
{
    private readonly ActivitySource _activitySource;

    public MyService(ActivitySource activitySource)
    {
        _activitySource = activitySource;
    }

    public void DoSomething()
    {
        using var activity = _activitySource.StartActivity("DoSomething");
        activity?.SetTag("custom.tag", "value");
        
        // Your code here
    }
}

Custom Resource Attributes

You can add custom resource attributes through the OpenTelemetryOptions:

{
  "Telemetry": {
    "CustomAttributes": {
      "deployment.region": "WestEurope",
      "service.team": "MyTeam"
    }
  }
}

These attributes will be added to all telemetry data sent from your application.

Product Compatible and additional computed target framework versions.
.NET 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 (4)

Showing the top 4 NuGet packages that depend on I-Synergy.Framework.OpenTelemetry:

Package Downloads
I-Synergy.Framework.AspNetCore

I-Synergy Framework AspNetCore

I-Synergy.Framework.UI

I-Synergy UI Framework for Windows, Linux, Android and WebAssembly

I-Synergy.Framework.OpenTelemetry.Sentry

I-Synergy Framework OpenTelemetry for Sentry

I-Synergy.Framework.OpenTelemetry.ApplicationInsights

I-Synergy Framework OpenTelemetry library for ApplicationInsights

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2025.11130.12248 74 11/30/2025
2025.11130.12134-preview 71 11/30/2025
2025.11130.11725-preview 76 11/30/2025
2025.11130.11553-preview 70 11/30/2025
2025.11130.11515-preview 73 11/30/2025
2025.11130.11420.59-preview 75 11/30/2025
2025.11130.11323.56-preview 79 11/30/2025
2025.11129.10227.14-preview 93 11/29/2025
2025.11120.10114 498 11/20/2025
2025.11119.10110 483 11/19/2025
2025.11118.12340.33-preview 467 11/18/2025
2025.11117.12349.4-preview 439 11/17/2025
2025.11117.11937.47-preview 445 11/17/2025
2025.11113.11532.29-preview 333 11/13/2025
2025.11113.10128.57-preview 332 11/13/2025
2025.11110.10306.55-preview 281 11/10/2025
2025.11109.10018.48-preview 182 11/8/2025
2025.11108.10119.29-preview 164 11/8/2025
2025.11106.10037.1-preview 237 11/6/2025
2025.11105.10254.54-preview 237 11/5/2025
2025.11105.10141.16-preview 229 11/5/2025
2025.11104.12308.54-preview 230 11/4/2025
2025.11104.10144.47-preview 243 11/4/2025
2025.11102.12003.8-preview 233 11/2/2025
2025.11102.11228.52-preview 228 11/2/2025
2025.11102.10309.42-preview 169 11/2/2025
2025.11029.11433.38-preview 233 10/29/2025
2025.11029.10201.38-preview 220 10/29/2025
2025.11027.11947.55-preview 233 10/27/2025
2025.11022.12207.12-preview 209 10/22/2025
2025.11019.12053.37-preview 206 10/19/2025
2025.11016.11750.24-preview 211 10/16/2025
2025.11015.10219.44-preview 210 10/15/2025
2025.11014.10245.12-preview 213 10/14/2025
2025.11012.10130.11-preview 215 10/12/2025
2025.11010.10052.52-preview 279 10/9/2025
2025.11001.12118.13-preview 280 10/1/2025
2025.10925.10144.25-preview 321 9/25/2025
2025.10921.11353.29-preview 322 9/21/2025
2025.10913.11841.29-preview 250 9/13/2025
2025.10912.12351.59-preview 199 9/12/2025
2025.10912.10210.52-preview 268 9/12/2025
2025.10911.10131.43-preview 264 9/10/2025
2025.10910.12340.34-preview 279 9/10/2025
2025.10910.11327.15-preview 266 9/10/2025
2025.10910.11206.45-preview 277 9/10/2025
2025.10910.10230.58-preview 275 9/10/2025
2025.10908.12343.47-preview 297 9/8/2025
2025.10904.12337.35-preview 308 9/4/2025
2025.10904.12245.51-preview 313 9/4/2025
2025.10904.11425.5-preview 300 9/4/2025
2025.10904.10323.39-preview 316 9/4/2025
2025.10826.11425.3-preview 367 8/26/2025
2025.10825.12350.9-preview 308 8/25/2025
2025.10810.10248-preview 258 8/10/2025
2025.10809.10146.35-preview 298 8/9/2025
2025.10806.12031.49-preview 371 8/6/2025
2025.10806.11955.54-preview 366 8/6/2025
2025.10806.11433.24-preview 375 8/6/2025
2025.10709.10105.39-preview 295 7/8/2025
2025.10707.12320.3-preview 300 7/7/2025
2025.10706.11957.9-preview 297 7/6/2025
2025.10702.11752.47-preview 294 7/2/2025
2025.10702.11256.17-preview 301 7/2/2025
2025.10702.11119.10-preview 294 7/2/2025
2025.10702.10000.31-preview 297 7/1/2025
2025.10701.11524.1-preview 298 7/1/2025
2025.10701.11310.13-preview 294 7/1/2025
2025.10630.12022.58-preview 287 6/30/2025
2025.10612.12134.8-preview 475 6/12/2025
2025.10611.12313.53-preview 408 6/11/2025
2025.10603.10159.54-preview 241 6/3/2025
2025.10602.11908.9-preview 257 6/2/2025
2025.10601.10124.29-preview 198 5/31/2025
2025.10531.12235.29-preview 205 5/31/2025
2025.10530.10121.50-preview 252 5/29/2025
2025.10527.12202.4-preview 256 5/27/2025
2025.10526.12034.25-preview 247 5/26/2025
2025.10521.11828.30-preview 254 5/21/2025
2025.10520.11715.6-preview 265 5/20/2025
2025.10520.11515.16-preview 255 5/20/2025
2025.10518.12303.43-preview 253 5/18/2025
2025.10518.11257.36-preview 260 5/18/2025
2025.10517.12347.27-preview 212 5/17/2025
2025.10517.12003.6-preview 210 5/17/2025
2025.10516.11720.13-preview 284 5/16/2025
2025.10514.12334.2-preview 342 5/14/2025
2025.10514.10015.27-preview 337 5/13/2025
2025.10511.11032.32-preview 290 5/11/2025