02 · Avance Proyecto

Generar tráfico

1. Create Inventory

curl -i \
  -X POST http://localhost:3000/inventory \
  -H "Content-Type: application/json" \
  -d '{"sku":"ABC-1234-AB","qty":10}'

2. Get Inventory

curl -i http://localhost:3000/inventory/ABC-1234-AB

3. Reserve Quantity

curl -i -X POST http://localhost:3000/inventory/ABC-1234-AB/reserve \
  -H "Content-Type: application/json" \
  -d '{"qty":5,"orderId":"order-001"}'

4. Release Quantity

curl -i -X POST http://localhost:3000/inventory/ABC-1234-AB/release \
  -H "Content-Type: application/json" \
  -d '{"qty":3,"orderId":"order-001"}'

5. Replenish Inventory

Posibles Gráficas de Dashboards:

1. Service Health & Traffic Overview

  • Panels & PromQL

    • Total RPS

    • Latency P95 / P99

    • Error Rate (%)

2. HTTP Endpoint Performance

  • Variable: $route (set via Dashboard settings → Variables → New → Label “route” with query label_values(http_server_request_duration_seconds_bucket, route))

  • Panels (templated by $route)

    • RPS by route

    • P99 latency by route

3. Database Query Metrics

  • Panels

    • DB QPS

    • Slow Queries P95

    • Connection Pool Usage (if instrumented)

4. RabbitMQ Messaging Health

  • Panels

    • Messages Published/sec

    • Queue Depth (per queue)

    • Consumer Ack Rate

5. End-to-End Trace Explorer

  • Setup: Install the Tempo (or Jaeger) data source plugin

  • Panels:

    • Service Map (built-in)

    • Recent Traces Table: link traces to slow requests

6. Error & Exception Breakdown

  • Panels

    • Top Exceptions

    • 5xx Rate

7. Resource Utilization

  • Panels

    • CPU (%)

    • Memory RSS

    • Event-Loop Lag (if instrumented)

8. Business-Event Metrics

  • Panels

    • Replenish Events/sec

    • Reserve Events/sec

    • Replenish / Reserve Ratio

Última actualización