This repo contains the sample code and files for the blog post here. It shows how to use the OpenTelemetry.NET libraries to capture traces for incoming http requests, and use the Grafana Agent to forward them Grafana Cloud Tempo.
- Edit
agent.yaml
and supply your Grafana Cloud user name and api keys for Tempo. - Start the agent and the example app for the .NET framework you are interested in.
docker-compose up dotnet6 agent
- Generate some requests
curl http://localhost:5000/weather
(this works for all examples) - Browse to
https://<your_stack>.grafana.net
and explore the traces.- Click on the Search tab and then Run query. By default it will show traces received in the last hour.
- Try looking up a trace by ID. Each example logs the message
"Getting weather forecast traceID=<ID>"
. Copy and paste this ID into theTraceID
tab and then Run query to view the specific trace.