Skip to content

Latest commit

 

History

History
55 lines (36 loc) · 1.7 KB

File metadata and controls

55 lines (36 loc) · 1.7 KB

Build Status

Nuget

PlusUltra.OpenTracing.HttpPropagation

This package basically extracts the OpenTracing context from incoming Http requests and creates child scopes for each outgoing Http request allowing you to easily track the communication to and from your microservices.

Getting started

Install the package:

Install-Package PlusUltra.OpenTracing.HttpPropagation

Register on your ConfigureServices:

services.AddHttpTracingPropagation();

Having an ITracer registered

This tool requires you to provide an ITracer through dependency injection. If you have not done so already, you can register one like this:

services.AddSingleton(serviceProvider =>
{
    var loggerFactory = serviceProvider.GetRequiredService<ILoggerFactory>();
    var senderResolver = new Jaeger.Senders.SenderResolver(loggerFactory);

    Jaeger.Configuration.SenderConfiguration
        .DefaultSenderResolver = senderResolver.RegisterSenderFactory<ThriftSenderFactory>();

    var config = Jaeger.Configuration.FromIConfiguration(loggerFactory, Configuration);

    return config.GetTracer();
});

appsettings.json:

{
  "JAEGER_SERVICE_NAME": "service1",
  "JAEGER_SAMPLER_TYPE": "const"
}

Examples

jaeger

Check out the projects on examples.