opentelemetry-dotnet/examples/MicroserviceExample
Mikel Blanchard 9836d3addb
[DependencyInjection] Introduce new package and refactor SDK (#3923)
2022-12-08 15:24:44 -08:00
..
Utils add nullable enable to Common.props and disable in projects. (#3964) 2022-12-05 15:33:57 -08:00
WebApi [DependencyInjection] Introduce new package and refactor SDK (#3923) 2022-12-08 15:24:44 -08:00
WorkerService [DependencyInjection] Introduce new package and refactor SDK (#3923) 2022-12-08 15:24:44 -08:00
.dockerignore End-to-end example applications (#936) 2020-08-09 23:59:10 -07:00
README.md Reworded documentation based on recommendation from another PR (#2689) 2021-11-30 14:34:01 -08:00
docker-compose.yml Removed explicit setting of default guest user (#2682) 2021-11-26 12:15:36 -08:00

README.md

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:

References