Skip to content

rgl/opentelemetry-dotnet-playground

Repository files navigation

About

Build

This is a OpenTelemetry .NET playground.

The following components are used:

components

Usage (Ubuntu 22.04)

# create the environment defined in docker-compose.yml
# and leave it running in the background.
docker compose up --detach --build --wait

# show running containers.
docker compose ps

# show logs.
docker compose logs

# show the quotes container health check output log.
docker inspect --format '{{json .State.Health }}' \
  "$(docker compose ps quotes --format '{{.Name}}')" \
  | jq -r '.Log[].Output'

# open a container network interface in wireshark.
./wireshark.sh quotes

# open the quotes service swagger.
xdg-open http://localhost:8000/swagger

# make a request.
http \
  --verbose \
  http://localhost:8000/quote

# make a failing request.
http \
  --verbose \
  http://localhost:8000/quote?opsi=opsi

# make a request that includes a parent trace.
# NB the dotnet trace id will be set to the traceparent trace id.
# NB the tracestate does not seem to be stored or propagated anywhere.
# NB traceparent syntax: <version>-<trace-id>-<parent-id-aka-span-id>-<trace-flags>
http \
  --verbose \
  http://localhost:8000/quote \
  traceparent:00-10000000000000000000000000000000-1000000000000000-01 \
  tracestate:x.client.state=example

# make a request to quotetext, which in turn, makes a nested request to quote.
http \
  --verbose \
  http://localhost:8000/quotetext

# make a failing request to quotetext, which in turn, makes a nested failing
# request to quote.
http \
  --verbose \
  http://localhost:8000/quotetext?opsi=opsi

# make a request that includes a parent trace.
# NB the dotnet trace id will be set to the traceparent trace id.
# NB the tracestate does not seem to be stored or propagated anywhere.
# NB traceparent syntax: <version>-<trace-id>-<parent-id-aka-span-id>-<trace-flags>
http \
  --verbose \
  http://localhost:8000/quotetext \
  traceparent:00-20000000000000000000000000000000-1000000000000000-01 \
  tracestate:x.client.state=example

# open aspire dashboard (metrics/traces/logs).
xdg-open http://localhost:18888

# destroy the environment.
docker compose down --remove-orphans --volumes --timeout=0

List this repository dependencies (and which have newer versions):

GITHUB_COM_TOKEN='YOUR_GITHUB_PERSONAL_TOKEN' ./renovate.sh

Notes

Reference