Simple set of ASP.NET Core applications to explore distributed tracing support, as well as the standard W3C Trace Context usage.
ConsoleApp
- stand-alone app with a single service.
The simplest way to see this in action is looking at the logs, as we can then see this information printed out.
Even better than seeing things printed in the console, is to centralize the logs, then use the filters to find the logs we want. To see it in action, we're using Seq.
For this sample, we'll use OpenTelemetry and Jaeger.
OpenTelemetry provides a set of tools to capture the trace information and then make available to observability tools (like Zipkin and Jaeger). OpenTelemetry provides a set of NuGet packages we can use to easily integration with .NET.
Jaeger UI: http://localhost:16686
docker exec -it opentelemetrytests-mysql-1 bash mysql -uuser -pPassword1
Before running the .NET applications, we need to have our dependencies up, which in this case are RabbitMQ, PostgreSQL, Seq, Zipkin and Jaeger. To get them all running, there's a Docker Compose file in the repository root, so we just need to execute:
docker compose -f docker-compose.yml up
dotnet ef migrations add SeedData
dotnet ef database update
.\WebAppClient\bin\debug\net6.0\WebAppClient.exe
.\QueueConsumer\bin\Debug\net6.0\QueueConsumer.exe
Each workshop stage has a corresponding Git commit and can be retrieved using git checkout with a respective hash:
- Setting up Docker containers (460306)
- Simple console app (01db6a)
- Web App with support for MS SQL Server and MySQL (Windows and Mac/Intel) (9f66e3)
- Support for Azure SQL Edge (Mac/M1) (6edbd8)
- Web App Client (241515)
- RabbitMQ publisher and consumer (36d289)
To do this exploration in general, but particularly the RabbitMQ bits, relied heavily on the docs and examples provided in the OpenTelemetry .NET repository, like the OpenTelemetry Example Application.