https://github.com/cecilphillip/grafana-otel-dotnet
Sample setup showing ASP.NET Core observability with Prometheus, Loki, Grafana, Opentelemetry Collector
https://github.com/cecilphillip/grafana-otel-dotnet
aspnetcore dotnet grafana loki opentelemetry prometheus tempo
Last synced: 4 months ago
JSON representation
Sample setup showing ASP.NET Core observability with Prometheus, Loki, Grafana, Opentelemetry Collector
- Host: GitHub
- URL: https://github.com/cecilphillip/grafana-otel-dotnet
- Owner: cecilphillip
- License: mit
- Created: 2023-05-15T15:09:52.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-01T03:05:14.000Z (about 1 year ago)
- Last Synced: 2025-06-14T05:04:32.139Z (4 months ago)
- Topics: aspnetcore, dotnet, grafana, loki, opentelemetry, prometheus, tempo
- Language: C#
- Homepage:
- Size: 203 KB
- Stars: 67
- Watchers: 3
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# ASP.NET Core observability w/ Grafana OSS Stack
Sample application showing how to write up ASP.NET Core with OpenTelemetry and export to Prometheus, Loki, and Tempo using the OpenTelemetry Collector
## Prerequisites
* [.NET SDK v7.0+](https://get.dot.net/)
* [Docker Desktop](https://www.docker.com/products/docker-desktop/)## Setup
The demo is made up of a few projects written in C#.
* [Web API](src/BackendApiService) - Backend HTTP Weather API built with ASP.NET Core
* [Website](src/MainService) - Front facing UI using the default Blazor Server template### Configured Ports 🔌
| Application | Port(s) |
|-------------------------|------------|
| Web API | 5006 |
| Website | 5238 |
| Loki | 3100 |
| Prometheus UI | 9090 |
| Grafana UI | 3000 |
| OpenTelemetry Collector | 4317, 4318 |### Running the demo 🚀
Run the infrastructure components with the provided [docker-compose.yml](./docker-compose.yml) file.```shell
> docker compose -p grafana-demo up
```
> 👀 This setup will create a **./tmp/** folder in the root of the project folder that will be mounted as a volume
> in the infrastructure containers.Start both .NET applications
Backend Web API
```shell
> cd src/BackendApiService
> dotnet run
```
Front facing web API
```shell
> cd src/MainService
> dotnet run
```