Blip.Starter.Common.Traces 0.0.14

There is a newer version of this package available.
See the version list below for details.
dotnet add package Blip.Starter.Common.Traces --version 0.0.14                
NuGet\Install-Package Blip.Starter.Common.Traces -Version 0.0.14                
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="Blip.Starter.Common.Traces" Version="0.0.14" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Blip.Starter.Common.Traces --version 0.0.14                
#r "nuget: Blip.Starter.Common.Traces, 0.0.14"                
#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 Blip.Starter.Common.Traces as a Cake Addin
#addin nuget:?package=Blip.Starter.Common.Traces&version=0.0.14

// Install Blip.Starter.Common.Traces as a Cake Tool
#tool nuget:?package=Blip.Starter.Common.Traces&version=0.0.14                

Blip.Starter.Common.Traces

First of all, please read all pages of our Tracing documentation.

You should also read about how .NET Core works with diagnostics distributed tracing.

You must configure your application to be able to instrument it with OpenTelemetry. Follow the configuration above and to instrument follow our .NET instrumentation guideline.

Configuring your application to use OpenTelemetry

To configure your applications to use OpenTelemetry, you need to add Blip.Starter.Common.Traces NuGet package to your project.

The NuGet package is published in our private NuGet repository: https://dev.azure.com/curupira/BLiP/_artifacts/feed/BlipNuget/NuGet/Blip.Starter.Common.Traces/overview

To access it locally you will need to install Azure Artifacts credential provider.

ASP.NET Core

Then, in your Startup.cs file or anywhere you configure the framework, add the following code:

// You can change the configuration if needed
ITraceConfiguration configuration = DefaultTraceConfiguration();
 
// Add the services to the IServiceCollection using the extension from AspNetIntegration
services.AddTracing(configuration);

If you currently use OpenTracing in your project, you can enable the integration with OpenTelemetry by using the EnableOpenTracingShim option in the configuration. Then you can access the ITracer interface using the GlobalTracer.instance global variable from OpenTracing.

Manual configuration

If you must configure OpenTelemetry manually because you do not use ASP.NET Core, you can do it like this:

// You can change the configuration if needed
ITraceConfiguration configuration = DefaultTraceConfiguration();
 
var builder = OpenTelemetryEngine.ConfigureTracer(configuration);

// After building the OpenTelemetry is ready to be used
// Here we are using the 'using var' keyword to dispose the tracer provider when the scope ends (application shutdown), so this code must be in your main method
using var tracerProvider = builder.build();
OpenTracing

If you currently have the OpenTracing configured and is using the ITracer interface you can also integrate OpenTelemetry with it to obtain the ITracer interface:

// Instantiate the OpenTracing shim for compatibility with ITracer
var tracer = new TracerShim(
    tracerProvider.GetTracer(OpenTracingEngine.Source),
    Propagators.DefaultTextMapPropagator);

GlobalTracer.Register(tracer);

// Get ITracer interface using GlobalTracer.Instance where needed

Sending traces to Grafana Tempo

After configuring the instrumentation, you must configure the exporter to send the traces to Grafana Tempo.

This can be done with several environment variables. Please read the documentation to learn what is needed to send traces to Grafana Tempo.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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 was computed.  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. 
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
0.0.23 95 7/25/2024
0.0.20 1,355 2/27/2024
0.0.19 83 2/22/2024
0.0.18 781 1/31/2024
0.0.17 410 12/28/2023
0.0.16 513 11/6/2023
0.0.15 265 10/19/2023
0.0.14 345 10/10/2023
0.0.12 215 9/26/2023