Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

BookInfo Application

BookInfo is a simple microservices application that displays information about books. It's perfect for learning distributed tracing concepts and testing DeepTrace functionality.

Application Architecture

BookInfo consists of four microservices:

┌─────────────────┐    ┌─────────────────┐
│   Product Page  │◄──►│  Details Service│
│   (Frontend)    │    │                 │
└─────────┬───────┘    └─────────────────┘
          │
          ▼
┌─────────────────┐    ┌─────────────────┐
│ Reviews Service │◄──►│ Ratings Service │
│                 │    │                 │
└─────────────────┘    └─────────────────┘

Services Overview

ServiceDescriptionTechnologyPort
Product PageFrontend service that displays book informationPython9080
Details ServiceProvides book details (author, ISBN, etc.)Ruby9080
Reviews ServiceManages book reviewsJava9080
Ratings ServiceProvides book ratingsNode.js9080

Prerequisites

  • Docker and Docker Compose installed
  • DeepTrace server running
  • Ports 9080 available

Quick Deployment

1. Deploy BookInfo Services

Navigate to the BookInfo directory and deploy all services:

cd tests/workload/bookinfo
sudo bash deploy.sh

The deployment script will:

  • Install Docker and Docker Compose (if needed)
  • Pull required Docker images
  • Launch all services using Docker Compose
  • Set up service networking

2. Verify Deployment

Check that all services are running:

sudo docker ps | grep bookinfo

You should see containers for:

  • bookinfo-productpage
  • bookinfo-details
  • bookinfo-reviews
  • bookinfo-ratings

3. Access the Application

Open your browser and visit:

http://localhost:9080/productpage

You should see the BookInfo product page displaying book information.

Generate Traffic for Tracing

Automated Traffic Generation

Use the provided client script to generate test traffic:

sudo bash client.sh

This script will:

  • Start an interactive shell inside the client container
  • Issue frontend requests against the BookInfo application
  • Generate HTTP traffic between microservices
  • Create network traces for DeepTrace to capture

Manual Traffic Generation

You can also generate traffic manually:

# Generate multiple requests
for i in {1..100}; do
  curl -s http://localhost:9080/productpage > /dev/null
  echo "Request $i completed"
  sleep 1
done

Traffic Patterns

The BookInfo application generates the following traffic patterns:

  1. Frontend Requests: User requests to product page
  2. Service-to-Service Calls:
    • Product Page → Details Service
    • Product Page → Reviews Service
    • Reviews Service → Ratings Service
  3. Database Queries: Internal service data access

Integration with DeepTrace

Complete Workflow

  1. Deploy BookInfo:

    cd tests/workload/bookinfo
    sudo bash deploy.sh
    
  2. Start DeepTrace Agent:

    sudo docker exec -it deeptrace_server python -m cli.src.cmd agent run
    
  3. Generate Traffic:

    sudo bash client.sh
    
  4. Process Traces:

    sudo docker exec -it deeptrace_server python -m cli.src.cmd asso algo deeptrace
    sudo docker exec -it deeptrace_server python -m cli.src.cmd assemble
    
  5. View Results: Access Kibana at http://YOUR_SERVER_IP:5601

Expected Trace Data

When properly configured, you should see traces showing:

  • HTTP requests between services
  • Service response times
  • Request flow through the microservice architecture
  • Network connection details

Troubleshooting

Services Not Starting

# Check container logs
sudo docker logs bookinfo-productpage
sudo docker logs bookinfo-details
sudo docker logs bookinfo-reviews
sudo docker logs bookinfo-ratings

# Restart services
sudo docker-compose restart

No Network Traffic Captured

  1. Ensure DeepTrace agent is running
  2. Verify services are generating traffic
  3. Check that containers are on the same network
  4. Confirm eBPF programs are loaded

Port Conflicts

If port 9080 is already in use:

# Check what's using the port
sudo netstat -tulpn | grep 9080

# Stop conflicting services or modify docker-compose.yaml

Cleanup

Stop BookInfo Services

sudo bash clear.sh

This will:

  • Stop all BookInfo containers
  • Remove containers and networks
  • Clean up Docker resources

Complete Cleanup

# Remove all BookInfo images
sudo docker rmi $(sudo docker images | grep bookinfo | awk '{print $3}')

# Remove unused networks
sudo docker network prune -f

Advanced Configuration

Custom Configuration

You can modify the docker-compose.yaml file to:

  • Change service ports
  • Add environment variables
  • Configure resource limits
  • Enable additional logging

Performance Testing

For performance testing with BookInfo:

# Install Apache Bench
sudo apt-get install apache2-utils

# Run load test
ab -n 1000 -c 10 http://localhost:9080/productpage

Next Steps