-
Use OpenTelemetry to collect traces and metrics and Serilog to collect log's messages; then all of them will only export to OpenTelemetry Collector (OTEL collector in short).
-
The collector then exports to
- Zipkin and/or Jaeger for tracings
- Prometheus for metrics
- Loki for log's messages
-
All of them are visualized on Grafana
- Starting infrastructure from docker compose
docker compose -f ./local/infra/docker-compose.observability.yaml up -d- Starting
weather-service
dotnet run --project ./src/Microservices/Microservices.WeatherService/Microservices.WeatherService.csproj- Starting
client-service
dotnet run --project src/ClientApps/ClientApps.ClientSimulator/ClientApps.ClientSimulator.csproj- Observe
- Making some requests to
http://localhost:6002/helloor execute via Visual Studio
- Access
grafanaathttp://localhost:3000to explore 4 datasources: Jaeger, Zipkin, Prometheus & Loki
-
Refer to ObservabilityRegistration.cs
-
There are the following methods that named as its functionality
AddTracingAddMetricsAddSerilog
-
There is only one
publicmethod which isAddObservability. This is used in Program.cs
var webApplicationBuilder = WebApplication.CreateBuilder(args);
webApplicationBuilder.AddObservability();
// Other lines of codeIf you liked this project or if it helped you, please give a star ⭐ for this repository. Thank you!!!




