Skip to content

kimcuhoang/practical-net-otelcollector

Repository files navigation

.NET with OpenTelemetry Collector

Overview

Quick Start

  1. Starting infrastructure from docker compose
docker compose -f ./local/infra/docker-compose.observability.yaml up -d
  1. Starting service by using tye
tye run ./local/tye/tye.yaml --dashboard
  1. Observe
  • Making some requests to http://localhost:6002/hello or execute via Visual Studio

Execute http via Visual Studio

  • Access grafana at http://localhost:3000 to explore 4 datasources: Jaeger, Zipkin, Prometheus & Loki

Grafana Jaeger

Grafana Zipkin

Grafana Prometheus

Grafana Loki

Development

Register & configure

  • Refer to ObservabilityRegistration.cs

  • There are the following methods that named as its functionality

    • AddTracing
    • AddMetrics
    • AddSerilog
  • There is only one public method which is AddObservability. This is used in Program.cs

var webApplicationBuilder = WebApplication.CreateBuilder(args);

webApplicationBuilder.AddObservability();

// Other lines of code

Give a Star! 🌟

If you liked this project or if it helped you, please give a star ⭐ for this repository. Thank you!!!


Resources