Table of Contents
Note

This guide applies to Steeltoe v3. Please open an issue if you'd like to help update the content for Steeltoe v4.

Using Distributed Tracing for debugging with Zipkin

This tutorial takes you through setting up a .NET Core application that sends tracing data to a Zipkin server.

Note

For more detailed examples, please refer to the Tracing project in the Steeltoe Samples Repository.

First, start a Zipkin instance. Depending on your hosting platform this is done in several ways.

  1. Using the Steeltoe dockerfile, start a local instance of Zipkin

    docker run --publish 9411:9411 steeltoeoss/zipkin
    
  2. Once everything is finished initializing, you will see a message confirming startup: Started ZipkinServer in xx seconds

  3. You can view the Zipkin dashboard by navigating to http://localhost:9411

Next, create a .NET Core WebAPI that interacts with Distributed Tracing

  1. Create a new ASP.NET Core WebAPI app with the Steeltoe Initializr

  2. Name the project "DistributedTracingExample"

  3. No dependency needs to be added

  4. Click Generate Project to download a zip containing the new project

  5. Extract the zipped project and open in your IDE of choice

  6. Add Steeltoe.Management.TracingCore NuGet package to your project

  7. Add Distributed Tracing to your startup services

    public void ConfigureServices(IServiceCollection services)
    {
       // Other service registrations...
    
       // Available through Steeltoe.Management.Tracing namespace
       services.AddDistributedTracingAspNetCore();
    }
    

Run the application

dotnet run<PATH_TO>\DistributedTracingExample.csproj

Navigate to the endpoint (you may need to change the port number) http://localhost:5000/api/values

  1. Now that you have successfully run a request through the app, navigate back to the zipkin dashboard and click the "Find Traces" button. This will search for recent traces. The result should show the trace for your request. Zipkin search
  2. Clicking on that trace will drill into the details. Then clicking on a specific action within the trace will give you even more detail. Zipkin detail