Skip to content

Latest commit

 

History

History
59 lines (42 loc) · 1.9 KB

File metadata and controls

59 lines (42 loc) · 1.9 KB

OpenTelemetry Example Application

This set of projects is an example distributed application comprised of two components:

  1. An ASP.NET Core Web API
  2. A background Worker Service

The application demonstrates a number of OpenTelemetry concepts:

  • OpenTelemetry APIs for distributed context propagation.
  • Basic conventions of how messaging systems are handled in OpenTelemetry.

The Web API publishes messages to RabbitMQ which the Worker Service consumes. Distributed context propagation is achieved using OpenTelemetry APIs to inject and extract trace context in the headers of the published messages.

The Zipkin exporter is configured for viewing the distributed traces.

Running the example

A running instance of RabbitMQ and Zipkin are required. These can easily be spun up in docker containers.

The WebApi and WorkerService projects can be run from this directory as follows:

dotnet run --project WebApi
dotnet run --project WorkerService

Instead of running the projects individually, if you are using Docker Desktop, a docker-compose file is provided. This makes standing up the Zipkin and RabbitMQ dependencies easy, as well as starting both applications.

To run the example using docker-compose, run the following from this directory:

docker-compose up --build

With everything running:

  • Invoke the Web API to send a message.
  • If you have run RabbitMQ and Zipkin with default settings:
    • View your traces with Zipkin here
    • Manage RabbitMQ here
      • user = guest
      • password = guest

References