Skip to content
This repository was archived by the owner on Sep 24, 2025. It is now read-only.

QuesmaOrg/grafana-troubleshooting-app

Repository files navigation

Grafana Troubleshooting App

A minimal microservices application for demonstrating monitoring, logging, and troubleshooting scenarios with Grafana, Prometheus, and Loki.

It's a bit bugged on purpose. Below there are 3 scenarios with bugs in the app, which Grafana dashboards help to identify.

Architecture

Frontend (Port 3003) → Product Service (Port 3001) ← → Order Service (Port 3002)
                            ↓                              ↓
                    PostgreSQL DB                  PostgreSQL DB
                            (Port 5432)              (Port 5433)

Services

  • Product Service (Port 3001) - Product catalog and inventory
  • Order Service (Port 3002) - Orders, cart, and user auth
  • Frontend Service (Port 3003) - React web interface
  • Health Monitor (Port 5001) - Service health dashboard
  • Grafana (Port 3000) - Monitoring dashboards
  • Prometheus (Port 9090) - Metrics collection
  • Loki (Port 3100) - Log aggregation
  • Random Service (Port 5002) - Random Test service. Can be e.g. safely stopped to see changes in monitoring.

Quick Start

# Start all services
docker-compose up -d

# Start with rebuild
docker-compose up --build -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

Access

Test users for Frontend:

Bug 1: Simultaneous purchase of the same product with total quantity > N available

In order tab you can set up delay with which Product DB will be updated with an order. It simulates a slow connection to the Product DB.

Example: You have quantity 25 of some item, 1 customer buys 25, another 24.

Both orders will succeed if you do them fast enough (if you set up slider to 10sec, you have 10sec to click both orders to be created).

To simulate that, login from 2 tabs, e.g.

You can track that bug in Grafana dashboard (Order DB and Product DB values should match):

Start:

Application Screenshot

After 2 purchases:

Application Screenshot

Bug 2: Order creation when product DB is down

Let's add some products to Order cart, and then stop our Product DB:

docker compose down product-db

Create an order. It creates successfully: Application Screenshot But even after starting Product DB again

docker compose up product-db -d

It isn't updated and still shows 25 quantity available, just like before creating the order. Application Screenshot

You can track that bug in Grafana dashboard:

Start:

Application Screenshot

After our simulation:

Application Screenshot

Bug 3: Order creation when Order DB is down

Let's add some products to Order cart, and then stop our Order DB:

docker compose down order-db

Create an order. It creates successfully: Application Screenshot But even after starting Order DB again

docker compose up order-db -d

No information about order is propagated to the DB, and it also disappears from Frontend. Application Screenshot

User might be under wrong impression that the order was created, when in fact it wasn't.

You can track that bug in Grafana dashboard (Frontend and Order DB values should match):

Start:

Application Screenshot

After our simulation:

Application Screenshot

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •