penyland / OTEL1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction to OpenTelemetry in .NET

By Peter Nylander 2024

This is the repo for the talk "Introduction to OpenTelemetry in .NET" by Peter Nylander at the .NET Skåne user group event 24/4 2024.

The talk is a simple introduction how to get started with OpenTelemetry in .NET.

The repo is structured like so that each commit represents one step of the presentation

  1. Creating the web api that we are going to use for rest of the talk
  2. Logging
  3. Standard metrics
  4. Custom metrics
  5. Tracing
  6. Tracing -> Downstream api
  7. Custom tracing
  8. Custom tracing - add tag to span
  9. Custom tracing - add events to span

During the talk I used the .NET Aspire dashboard to easily demonstrate how to view logs, metrics and traces.

Start the dashboard by executing the following command:

docker run --rm -it -p 18888:18888 -p 4317:18889 -d --name aspire-dashboard -e DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS='true' mcr.microsoft.com/dotnet/nightly/aspire-dashboard:8.0.0-preview.5

You can also run Grafana LGTM as the OpenTelemetry backend. I also showed this briefly.

Start Grafana by executing:

docker run -p 3000:3000 -p 4317:4317 -p 4318:4318 --rm -ti grafana/otel-lgtm

About


Languages

Language:C# 100.0%