Steeltoe Documentation
  • Why Steeltoe
    Overview Microservices Cloud Web Applications Event Driven
  • Get Started
    Steeltoe Initializr Guides Documentation API Browser Blog
  • Projects
    Steeltoe Application Configuration Steeltoe Circuit Breakers Steeltoe Dynamic Logging Steeltoe Management Steeltoe Messaging Steeltoe Network File Shares Steeltoe Security Steeltoe Service Connectors Steeltoe Service Discovery Steeltoe Stream
  • Support
  • Community
Search Results for

    Table of Contents
    . . .

    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

      <ItemGroup>
      ...
         <PackageReference Include="Steeltoe.Management.TracingCore" Version="3.1.0" />
      ...
      </ItemGroup>
      
    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

    • .NET cli
    • Visual Studio
    dotnet run<PATH_TO>\DistributedTracingExample.csproj
    

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

    1. Choose the top Debug menu, then choose Start Debugging (F5). This should bring up a browser with the app running
    2. Navigate to the endpoint (you may need to change the port number) http://localhost:8080/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
    X
    • Edit this page