Minor improvements to example doc (#6033)

This commit is contained in:
Cijo Thomas 2024-12-16 11:29:16 -08:00 committed by GitHub
parent c94c422e31
commit e0a10f7890
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 24 additions and 4 deletions

View File

@ -1,6 +1,6 @@
# OpenTelemetry ASP.NET Core 7 Web API Example # OpenTelemetry ASP.NET Core Web API Example
This example uses the new WebApplication host that ships with .NET 7 This example uses the new WebApplication host that ships with .NET
and shows how to setup and shows how to setup
1. OpenTelemetry logging 1. OpenTelemetry logging
@ -13,7 +13,27 @@ service name, version and the machine on which this program is running.
The sample rate is set to emit all the traces using `AlwaysOnSampler`. The sample rate is set to emit all the traces using `AlwaysOnSampler`.
You can try out different samplers like `TraceIdRatioBasedSampler`. You can try out different samplers like `TraceIdRatioBasedSampler`.
## Running Dependencies via Docker
The example by default writes telemetry to stdout. To enable telemetry export
via OTLP, update the `appsettings.json` file to replace `"console"` with
`"otlp"`. Launching the application will then send telemetry data via OTLP.
Use the provided "docker-compose.yaml" file to spin up the
required dependencies, including:
- **OTel Collector** Accept telemetry and forwards them to Tempo, Prometheus
- **Prometheus** to store metrics
- **Grafana (UI)** UI to view metrics, traces. (Exemplars can be used to jump
from metrics to traces)
- **Tempo** to store traces // TODO: Add a logging store also.
Once the Docker containers are running, you can access the **Grafana UI** at:
[http://localhost:3000/](http://localhost:3000/)
## References ## References
* [ASP.NET Core 3.1 Example](https://github.com/open-telemetry/opentelemetry-dotnet/tree/98cb28974af43fc893ab80a8cead6e2d4163e144/examples/AspNetCore) - [ASP.NET Core](https://learn.microsoft.com/aspnet/core/introduction-to-aspnet-core)
* [OpenTelemetry Project](https://opentelemetry.io/) - [Docker](http://docker.com)
- [Prometheus](http://prometheus.io/docs)
- [Tempo](https://github.com/grafana/tempo)