This is a demo project showing how to monitor a .NET Web API using Prometheus and visualize metrics using Grafana.
- ASP.NET Core
- Prometheus-net
- Grafana
- Docker & Docker Compose
docker-compose up --build
Then open:
- API: http://localhost:5000/hello
- Prometheus: http://localhost:9090
- Grafana: http://localhost:3000 (admin / admin)
You can create a custom dashboard in Grafana using metrics like:
http_requests_received_total
Add panels using this metric to monitor incoming HTTP requests.
/Dockerfile
: Builds the .NET app/prometheus.yml
: Prometheus config/docker-compose.yml
: Orchestrates services/Program.cs
: Minimal API with Prometheus metrics
MIT