-
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/hello
or execute via Visual Studio
- Access
grafana
athttp://localhost:3000
to explore 4 datasources: Jaeger, Zipkin, Prometheus & Loki
-
Refer to ObservabilityRegistration.cs
-
There are the following methods that named as its functionality
AddTracing
AddMetrics
AddSerilog
-
There is only one
public
method which isAddObservability
. This is used in Program.cs
var webApplicationBuilder = WebApplication.CreateBuilder(args);
webApplicationBuilder.AddObservability();
// Other lines of code
If you liked this project or if it helped you, please give a star ⭐ for this repository. Thank you!!!