Bỏ qua

Observability - Tóm tắt và Next Steps

✅ Đã hoàn thành

  1. ClickHouse connection string đã được fix (path-style /signoz)
  2. Query Service đang chạy (health check: {"status":"ok"})
  3. OTEL Collector đang chạy
  4. Databases đã tồn tại (signoz_traces, signoz_metrics, signoz_logs)

⚠️ Vấn đề hiện tại

ClickHouse chưa có bảng - Query Service cần bảng để lưu và query data.

Lỗi trong logs:

Unknown table expression identifier 'signoz_metrics.distributed_updated_metadata'

🎯 Giải pháp

  1. Mở browser: http://localhost:3301
  2. Đăng nhập hoặc tạo account (nếu lần đầu)
  3. Vào bất kỳ section nào:
  4. Traces
  5. Metrics
  6. Logs
  7. Query Service sẽ tự động tạo bảng khi xử lý request đầu tiên từ UI

Cách 2: Start Services và tạo traffic

Bước 1: Start Services

Services KHÔNG chạy trong Docker. Bạn cần start bằng NX:

# Terminal 1: Start tất cả services
yarn dev

# Hoặc start từng service:
yarn dev:gateway      # API Gateway (port 3000)
yarn dev:booking      # Booking Service (port 3003)

Kiểm tra services đang chạy:

lsof -i :3000  # API Gateway
lsof -i :3003  # Booking Service

Bước 2: Tạo Traffic

# Test API Gateway
curl http://localhost:3000/health

# Gửi nhiều requests
for i in {1..10}; do
  curl http://localhost:3000/health
  sleep 1
done

Bước 3: Kiểm tra bảng đã được tạo

Sau khi có traffic, Query Service sẽ tự động tạo bảng:

# Kiểm tra bảng
docker exec football-booking-backend-boilerplate-clickhouse-1 \
  clickhouse-client --password clickhouse123 \
  --query "SHOW TABLES FROM signoz_traces"

Nếu thấy các bảng như distributed_signoz_index_v3 → ✅ Bảng đã được tạo!

Bước 4: Kiểm tra trong Signoz UI

  1. Mở http://localhost:3301
  2. Vào Traces → "Last 15 minutes"
  3. Đợi 30-60 giây
  4. Bạn nên thấy traces!

📋 Checklist

  • [x] Signoz services đang chạy
  • [x] Query Service health check OK
  • [x] Databases tồn tại
  • [ ] Truy cập Signoz UI (http://localhost:3301) để trigger table creation
  • [ ] Start services (yarn dev)
  • [ ] Tạo traffic
  • [ ] Kiểm tra bảng đã được tạo
  • [ ] Xem data trong Signoz UI

🔍 Verify Commands

# 1. Check Query Service health
curl http://localhost:8083/api/v1/health
# Should return: {"status":"ok"}

# 2. Check ClickHouse tables (sau khi truy cập UI hoặc có traffic)
docker exec football-booking-backend-boilerplate-clickhouse-1 \
  clickhouse-client --password clickhouse123 \
  --query "SHOW TABLES FROM signoz_traces"

# 3. Check services đang chạy
lsof -i :3000
lsof -i :3003

# 4. Check OTEL Collector logs
docker logs --tail 20 football-booking-backend-boilerplate-signoz-otel-collector-1 | grep -i "exported\|received"

🚀 Quick Start (Tóm tắt)

# 1. Truy cập Signoz UI để trigger table creation
open http://localhost:3301
# Hoặc: curl http://localhost:8083/api/v1/health

# 2. Start services (trong terminal riêng)
yarn dev

# 3. Tạo traffic
curl http://localhost:3000/health

# 4. Đợi 30-60 giây, sau đó kiểm tra Signoz UI
# http://localhost:3301 → Traces → "Last 15 minutes"

📚 Tài liệu

  • docs/OBSERVABILITY-NEXT-STEPS.md - Hướng dẫn chi tiết
  • docs/OBSERVABILITY-FIX-GUIDE.md - Fix guide
  • docs/OBSERVABILITY-VIETNAMESE.md - FAQ tiếng Việt