Skip to content

A simple .NET application with a business metrics visualised in grafana and other services.

Notifications You must be signed in to change notification settings

mojski/button-shop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Button Shop - visualize web store statistics in grafana dashboard

A brilliant inventor has developed a machine for making buttons. In his online store, he sells tons of buttons in three colors: red, green, and blue. On busy days, he wants to plan his work efficiently. He needs to visualize how many orders they have to process to adjust future button production and packing machine operations.

Business dashboard

Useful dashboard for app user with business statistics.

dashboard example

Technical dashboard

Dashboard for admin contains ASP .NET app metrics, logs, traces and docker infrastructure metrics.

alt text

Dashboard based on grafana repository dashboards:

All of them can be imported through the Grafana UI.

Actual architecture

By storing metrics in Redis using the {instance_id}_{metric_name} key format and exposing them to Prometheus through a separate service that reads data from Redis, it is possible to coordinate multiple instances of the main application.

Healthchecks

There are two options. Checking healthchecks directly or via web api. The second solution provides a real check of whether the application can connect to a given service. Additionally, it allows for convenient use of uniform responses by the balckbox service.

Run demo

Run all in one docker compose:

cd src
docker compose up -d

Or run infra docker compose and .NET app from VS or dotnet cli command:

cd infra
docker compose up -d
cd ../src/WebApi
dotnet run # or just run it from VS

TODO

  • finish dashboards
  • aspnet core dashboard
  • loki
  • open telemetry
  • add validation
  • Add request behavior to handle custom exceptions
  • alerts
  • shop cilents simulations app
  • test project
  • tracing
  • clean architecture
  • unit tests
  • add ci/cd basic jobs
  • kubernetes
  • Dockerfile for app
  • docker comppose for app and infra
  • move to .NET 9

About

A simple .NET application with a business metrics visualised in grafana and other services.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages