{
 "recorded_at": "2026-12-01T12:01:21Z",
 "flight": "55555555-5555-5555-5555-555555555555",
 "steps": [
  {
   "key": "search",
   "calls": [
    {
     "method": "GET",
     "path": "/flights?origin=DME&destination=AER&date=2027-04-01",
     "body": null,
     "response": {
      "status": 200,
      "body": [
       {
        "id": "55555555-5555-5555-5555-555555555555",
        "flight_number": "S71025",
        "airline_code": "S7",
        "airline_name": "S7 Airlines",
        "origin": "DME",
        "destination": "AER",
        "departure_time": "2027-04-01T06:00:00Z",
        "arrival_time": "2027-04-01T10:00:00Z",
        "total_seats": 2,
        "available_seats": 2,
        "price": "12500.00",
        "status": "SCHEDULED"
       }
      ],
      "ms": 58
     }
    }
   ],
   "state": {
    "flights": [
     {
      "flight": "S71025",
      "available_seats": 2,
      "total_seats": 2,
      "status": "SCHEDULED"
     }
    ],
    "seat_reservations": [],
    "bookings": [],
    "redis": {
     "master": "172.30.0.10:6379",
     "keys": [
      {
       "key": "search:DME:AER:2027-04-01",
       "ttl": 297
      }
     ]
    }
   },
   "logs": {
    "booking-service": [],
    "flight-service": [
     "2026-12-01 12:01:21,528 INFO flight_service.cache cache miss search:DME:AER:2027-04-01"
    ],
    "redis-sentinel-1": []
   }
  },
  {
   "key": "search-again",
   "calls": [
    {
     "method": "GET",
     "path": "/flights?origin=DME&destination=AER&date=2027-04-01",
     "body": null,
     "response": {
      "status": 200,
      "body": [
       {
        "id": "55555555-5555-5555-5555-555555555555",
        "flight_number": "S71025",
        "airline_code": "S7",
        "airline_name": "S7 Airlines",
        "origin": "DME",
        "destination": "AER",
        "departure_time": "2027-04-01T06:00:00Z",
        "arrival_time": "2027-04-01T10:00:00Z",
        "total_seats": 2,
        "available_seats": 2,
        "price": "12500.00",
        "status": "SCHEDULED"
       }
      ],
      "ms": 18
     }
    }
   ],
   "state": {
    "flights": [
     {
      "flight": "S71025",
      "available_seats": 2,
      "total_seats": 2,
      "status": "SCHEDULED"
     }
    ],
    "seat_reservations": [],
    "bookings": [],
    "redis": {
     "master": "172.30.0.10:6379",
     "keys": [
      {
       "key": "search:DME:AER:2027-04-01",
       "ttl": 292
      }
     ]
    }
   },
   "logs": {
    "booking-service": [],
    "flight-service": [
     "2026-12-01 12:01:26,364 INFO flight_service.cache cache hit search:DME:AER:2027-04-01"
    ],
    "redis-sentinel-1": []
   }
  },
  {
   "key": "book",
   "calls": [
    {
     "method": "POST",
     "path": "/bookings",
     "body": {
      "user_id": "u1",
      "flight_id": "55555555-5555-5555-5555-555555555555",
      "passenger_name": "Иван Петров",
      "passenger_email": "ivan@example.com",
      "seat_count": 2
     },
     "response": {
      "status": 201,
      "body": {
       "id": "9df6658c-28d8-42ad-bb20-dc52c3e8cd67",
       "user_id": "u1",
       "flight_id": "55555555-5555-5555-5555-555555555555",
       "passenger_name": "Иван Петров",
       "passenger_email": "ivan@example.com",
       "seat_count": 2,
       "total_price": "25000.00",
       "status": "CONFIRMED",
       "created_at": "2026-12-01T12:01:31.291594Z",
       "updated_at": "2026-12-01T12:01:31.291594Z"
      },
      "ms": 45
     }
    }
   ],
   "state": {
    "flights": [
     {
      "flight": "S71025",
      "available_seats": 0,
      "total_seats": 2,
      "status": "SCHEDULED"
     }
    ],
    "seat_reservations": [
     {
      "booking": "9df6658c",
      "seat_count": 2,
      "status": "ACTIVE"
     }
    ],
    "bookings": [
     {
      "id": "9df6658c",
      "user_id": "u1",
      "seat_count": 2,
      "total_price": 25000.0,
      "status": "CONFIRMED"
     }
    ],
    "redis": {
     "master": "172.30.0.10:6379",
     "keys": []
    }
   },
   "logs": {
    "booking-service": [
     "2026-12-01 12:01:31,294 INFO booking_service booking 9df6658c-28d8-42ad-bb20-dc52c3e8cd67 confirmed: 2 seats on flight 55555555-5555-5555-5555-555555555555",
     "INFO:     172.19.0.1:54956 - \"POST /bookings HTTP/1.1\" 201 Created"
    ],
    "flight-service": [
     "2026-12-01 12:01:31,269 INFO flight_service.cache cache miss flight:55555555-5555-5555-5555-555555555555",
     "2026-12-01 12:01:31,282 INFO flight_service reserved 2 seats on flight 55555555-5555-5555-5555-555555555555 for booking 9df6658c-28d8-42ad-bb20-dc52c3e8cd67",
     "2026-12-01 12:01:31,283 INFO flight_service.cache cache invalidated flight:55555555-5555-5555-5555-555555555555, search:DME:AER:2027-04-01, search:DME:AER:any",
     "2026-12-01 12:01:32,284 INFO flight_service.cache cache invalidated flight:55555555-5555-5555-5555-555555555555, search:DME:AER:2027-04-01, search:DME:AER:any"
    ],
    "redis-sentinel-1": []
   }
  },
  {
   "key": "sold-out",
   "calls": [
    {
     "method": "POST",
     "path": "/bookings",
     "body": {
      "user_id": "u2",
      "flight_id": "55555555-5555-5555-5555-555555555555",
      "passenger_name": "Анна Смирнова",
      "passenger_email": "anna@example.com",
      "seat_count": 1
     },
     "response": {
      "status": 409,
      "body": {
       "error_code": "NOT_ENOUGH_SEATS",
       "message": "only 0 seats left, requested 1"
      },
      "ms": 13
     }
    }
   ],
   "state": {
    "flights": [
     {
      "flight": "S71025",
      "available_seats": 0,
      "total_seats": 2,
      "status": "SCHEDULED"
     }
    ],
    "seat_reservations": [
     {
      "booking": "9df6658c",
      "seat_count": 2,
      "status": "ACTIVE"
     }
    ],
    "bookings": [
     {
      "id": "9df6658c",
      "user_id": "u1",
      "seat_count": 2,
      "total_price": 25000.0,
      "status": "CONFIRMED"
     }
    ],
    "redis": {
     "master": "172.30.0.10:6379",
     "keys": [
      {
       "key": "flight:55555555-5555-5555-5555-555555555555",
       "ttl": 296
      }
     ]
    }
   },
   "logs": {
    "booking-service": [
     "INFO:     172.19.0.1:54962 - \"POST /bookings HTTP/1.1\" 409 Conflict"
    ],
    "flight-service": [
     "2026-12-01 12:01:35,391 INFO flight_service.cache cache miss flight:55555555-5555-5555-5555-555555555555"
    ],
    "redis-sentinel-1": []
   }
  },
  {
   "key": "cancel",
   "calls": [
    {
     "method": "POST",
     "path": "/bookings/9df6658c-28d8-42ad-bb20-dc52c3e8cd67/cancel",
     "body": null,
     "response": {
      "status": 200,
      "body": {
       "id": "9df6658c-28d8-42ad-bb20-dc52c3e8cd67",
       "user_id": "u1",
       "flight_id": "55555555-5555-5555-5555-555555555555",
       "passenger_name": "Иван Петров",
       "passenger_email": "ivan@example.com",
       "seat_count": 2,
       "total_price": "25000.00",
       "status": "CANCELLED",
       "created_at": "2026-12-01T12:01:31.291594Z",
       "updated_at": "2026-12-01T12:01:40.441872Z"
      },
      "ms": 30
     }
    }
   ],
   "state": {
    "flights": [
     {
      "flight": "S71025",
      "available_seats": 2,
      "total_seats": 2,
      "status": "SCHEDULED"
     }
    ],
    "seat_reservations": [
     {
      "booking": "9df6658c",
      "seat_count": 2,
      "status": "RELEASED"
     }
    ],
    "bookings": [
     {
      "id": "9df6658c",
      "user_id": "u1",
      "seat_count": 2,
      "total_price": 25000.0,
      "status": "CANCELLED"
     }
    ],
    "redis": {
     "master": "172.30.0.10:6379",
     "keys": []
    }
   },
   "logs": {
    "booking-service": [
     "2026-12-01 12:01:40,464 INFO booking_service booking 9df6658c-28d8-42ad-bb20-dc52c3e8cd67 cancelled",
     "INFO:     172.19.0.1:32872 - \"POST /bookings/9df6658c-28d8-42ad-bb20-dc52c3e8cd67/cancel HTTP/1.1\" 200 OK"
    ],
    "flight-service": [
     "2026-12-01 12:01:40,456 INFO flight_service released 2 seats on flight 55555555-5555-5555-5555-555555555555 for booking 9df6658c-28d8-42ad-bb20-dc52c3e8cd67",
     "2026-12-01 12:01:40,456 INFO flight_service.cache cache invalidated flight:55555555-5555-5555-5555-555555555555, search:DME:AER:2027-04-01, search:DME:AER:any",
     "2026-12-01 12:01:41,459 INFO flight_service.cache cache invalidated flight:55555555-5555-5555-5555-555555555555, search:DME:AER:2027-04-01, search:DME:AER:any"
    ],
    "redis-sentinel-1": []
   }
  },
  {
   "key": "no-key",
   "calls": [
    {
     "method": "gRPC",
     "path": "flight.v1.FlightService/GetFlight",
     "body": {
      "id": "55555555-5555-5555-5555-555555555555"
     },
     "response": {
      "status": "UNAUTHENTICATED",
      "body": "UNAUTHENTICATED missing or invalid x-api-key"
     }
    }
   ],
   "state": {
    "flights": [
     {
      "flight": "S71025",
      "available_seats": 2,
      "total_seats": 2,
      "status": "SCHEDULED"
     }
    ],
    "seat_reservations": [
     {
      "booking": "9df6658c",
      "seat_count": 2,
      "status": "RELEASED"
     }
    ],
    "bookings": [
     {
      "id": "9df6658c",
      "user_id": "u1",
      "seat_count": 2,
      "total_price": 25000.0,
      "status": "CANCELLED"
     }
    ],
    "redis": {
     "master": "172.30.0.10:6379",
     "keys": []
    }
   },
   "logs": {
    "booking-service": [],
    "flight-service": [],
    "redis-sentinel-1": []
   }
  },
  {
   "key": "redis-down",
   "calls": [
    {
     "method": "GET",
     "path": "/flights/55555555-5555-5555-5555-555555555555",
     "body": null,
     "response": {
      "status": 200,
      "body": {
       "id": "55555555-5555-5555-5555-555555555555",
       "flight_number": "S71025",
       "airline_code": "S7",
       "airline_name": "S7 Airlines",
       "origin": "DME",
       "destination": "AER",
       "departure_time": "2027-04-01T06:00:00Z",
       "arrival_time": "2027-04-01T10:00:00Z",
       "total_seats": 2,
       "available_seats": 2,
       "price": "12500.00",
       "status": "SCHEDULED"
      },
      "ms": 1013
     }
    }
   ],
   "failover_seconds": 5.8,
   "state": {
    "flights": [
     {
      "flight": "S71025",
      "available_seats": 2,
      "total_seats": 2,
      "status": "SCHEDULED"
     }
    ],
    "seat_reservations": [
     {
      "booking": "9df6658c",
      "seat_count": 2,
      "status": "RELEASED"
     }
    ],
    "bookings": [
     {
      "id": "9df6658c",
      "user_id": "u1",
      "seat_count": 2,
      "total_price": 25000.0,
      "status": "CANCELLED"
     }
    ],
    "redis": {
     "master": "172.30.0.11:6379",
     "keys": []
    }
   },
   "logs": {
    "booking-service": [],
    "flight-service": [
     "2026-12-01 12:01:50,217 WARNING flight_service.cache cache unavailable, reading from database: Timeout connecting to server",
     "2026-12-01 12:01:50,720 WARNING flight_service.cache cache unavailable, flight:55555555-5555-5555-5555-555555555555 not stored: Timeout connecting to server"
    ],
    "redis-sentinel-1": [
     "1:X 01 Dec 2026 12:01:54.331 # +sdown master flights-cache 172.30.0.10 6379",
     "1:X 01 Dec 2026 12:01:54.403 # +odown master flights-cache 172.30.0.10 6379 #quorum 2/2",
     "1:X 01 Dec 2026 12:01:54.403 # +try-failover master flights-cache 172.30.0.10 6379",
     "1:X 01 Dec 2026 12:01:54.488 # +elected-leader master flights-cache 172.30.0.10 6379",
     "1:X 01 Dec 2026 12:01:54.488 # +failover-state-select-slave master flights-cache 172.30.0.10 6379",
     "1:X 01 Dec 2026 12:01:54.572 # +selected-slave slave 172.30.0.11:6379 172.30.0.11 6379 @ flights-cache 172.30.0.10 6379",
     "1:X 01 Dec 2026 12:01:54.572 * +failover-state-send-slaveof-noone slave 172.30.0.11:6379 172.30.0.11 6379 @ flights-cache 172.30.0.10 6379",
     "1:X 01 Dec 2026 12:01:54.624 * +failover-state-wait-promotion slave 172.30.0.11:6379 172.30.0.11 6379 @ flights-cache 172.30.0.10 6379",
     "1:X 01 Dec 2026 12:01:55.443 # +promoted-slave slave 172.30.0.11:6379 172.30.0.11 6379 @ flights-cache 172.30.0.10 6379",
     "1:X 01 Dec 2026 12:01:55.443 # +failover-state-reconf-slaves master flights-cache 172.30.0.10 6379",
     "1:X 01 Dec 2026 12:01:55.523 # +failover-end master flights-cache 172.30.0.10 6379",
     "1:X 01 Dec 2026 12:01:55.523 # +switch-master flights-cache 172.30.0.10 6379 172.30.0.11 6379",
     "1:X 01 Dec 2026 12:01:55.523 * +slave slave 172.30.0.10:6379 172.30.0.10 6379 @ flights-cache 172.30.0.11 6379",
     "1:X 01 Dec 2026 12:02:00.561 # +sdown slave 172.30.0.10:6379 172.30.0.10 6379 @ flights-cache 172.30.0.11 6379"
    ]
   }
  },
  {
   "key": "redis-new-master",
   "calls": [
    {
     "method": "GET",
     "path": "/flights/55555555-5555-5555-5555-555555555555",
     "body": null,
     "response": {
      "status": 200,
      "body": {
       "id": "55555555-5555-5555-5555-555555555555",
       "flight_number": "S71025",
       "airline_code": "S7",
       "airline_name": "S7 Airlines",
       "origin": "DME",
       "destination": "AER",
       "departure_time": "2027-04-01T06:00:00Z",
       "arrival_time": "2027-04-01T10:00:00Z",
       "total_seats": 2,
       "available_seats": 2,
       "price": "12500.00",
       "status": "SCHEDULED"
      },
      "ms": 31
     }
    },
    {
     "method": "GET",
     "path": "/flights/55555555-5555-5555-5555-555555555555",
     "body": null,
     "response": {
      "status": 200,
      "body": {
       "id": "55555555-5555-5555-5555-555555555555",
       "flight_number": "S71025",
       "airline_code": "S7",
       "airline_name": "S7 Airlines",
       "origin": "DME",
       "destination": "AER",
       "departure_time": "2027-04-01T06:00:00Z",
       "arrival_time": "2027-04-01T10:00:00Z",
       "total_seats": 2,
       "available_seats": 2,
       "price": "12500.00",
       "status": "SCHEDULED"
      },
      "ms": 6
     }
    }
   ],
   "state": {
    "flights": [
     {
      "flight": "S71025",
      "available_seats": 2,
      "total_seats": 2,
      "status": "SCHEDULED"
     }
    ],
    "seat_reservations": [
     {
      "booking": "9df6658c",
      "seat_count": 2,
      "status": "RELEASED"
     }
    ],
    "bookings": [
     {
      "id": "9df6658c",
      "user_id": "u1",
      "seat_count": 2,
      "total_price": 25000.0,
      "status": "CANCELLED"
     }
    ],
    "redis": {
     "master": "172.30.0.11:6379",
     "keys": [
      {
       "key": "flight:55555555-5555-5555-5555-555555555555",
       "ttl": 297
      }
     ]
    }
   },
   "logs": {
    "booking-service": [],
    "flight-service": [
     "2026-12-01 12:02:01,749 INFO flight_service.cache cache miss flight:55555555-5555-5555-5555-555555555555",
     "2026-12-01 12:02:01,757 INFO flight_service.cache cache hit flight:55555555-5555-5555-5555-555555555555"
    ],
    "redis-sentinel-1": []
   }
  },
  {
   "key": "flight-down",
   "calls": [
    {
     "method": "GET",
     "path": "/flights/55555555-5555-5555-5555-555555555555",
     "body": null,
     "response": {
      "status": 503,
      "body": {
       "error_code": "FLIGHT_SERVICE_UNAVAILABLE",
       "message": "failed to connect to all addresses; last error: UNKNOWN: ipv4:172.19.0.4:50051: tcp handshaker shutdown"
      },
      "ms": 907
     }
    },
    {
     "method": "GET",
     "path": "/flights/55555555-5555-5555-5555-555555555555",
     "body": null,
     "response": {
      "status": 503,
      "body": {
       "error_code": "FLIGHT_SERVICE_UNAVAILABLE",
       "message": "failed to connect to all addresses; last error: UNKNOWN: ipv4:172.19.0.4:50051: tcp handshaker shutdown"
      },
      "ms": 306
     }
    },
    {
     "method": "GET",
     "path": "/flights/55555555-5555-5555-5555-555555555555",
     "body": null,
     "response": {
      "status": 503,
      "body": {
       "error_code": "FLIGHT_SERVICE_UNAVAILABLE",
       "message": "failed to connect to all addresses; last error: UNKNOWN: ipv4:172.19.0.4:50051: tcp handshaker shutdown"
      },
      "ms": 306
     }
    },
    {
     "method": "GET",
     "path": "/flights/55555555-5555-5555-5555-555555555555",
     "body": null,
     "response": {
      "status": 503,
      "body": {
       "error_code": "FLIGHT_SERVICE_UNAVAILABLE",
       "message": "failed to connect to all addresses; last error: UNKNOWN: ipv4:172.19.0.4:50051: tcp handshaker shutdown"
      },
      "ms": 323
     }
    },
    {
     "method": "GET",
     "path": "/flights/55555555-5555-5555-5555-555555555555",
     "body": null,
     "response": {
      "status": 503,
      "body": {
       "error_code": "FLIGHT_SERVICE_UNAVAILABLE",
       "message": "failed to connect to all addresses; last error: UNKNOWN: ipv4:172.19.0.4:50051: tcp handshaker shutdown"
      },
      "ms": 307
     }
    },
    {
     "method": "GET",
     "path": "/flights/55555555-5555-5555-5555-555555555555",
     "body": null,
     "response": {
      "status": 503,
      "body": {
       "error_code": "FLIGHT_SERVICE_UNAVAILABLE",
       "message": "Flight Service is unavailable, circuit breaker is OPEN"
      },
      "ms": 26
     }
    }
   ],
   "state": {
    "flights": [
     {
      "flight": "S71025",
      "available_seats": 2,
      "total_seats": 2,
      "status": "SCHEDULED"
     }
    ],
    "seat_reservations": [
     {
      "booking": "9df6658c",
      "seat_count": 2,
      "status": "RELEASED"
     }
    ],
    "bookings": [
     {
      "id": "9df6658c",
      "user_id": "u1",
      "seat_count": 2,
      "total_price": 25000.0,
      "status": "CANCELLED"
     }
    ],
    "redis": {
     "master": "172.30.0.11:6379",
     "keys": [
      {
       "key": "flight:55555555-5555-5555-5555-555555555555",
       "ttl": 285
      }
     ]
    }
   },
   "logs": {
    "booking-service": [
     "2026-12-01 12:02:11,473 WARNING booking_service.grpc retry /flight.v1.FlightService/GetFlight after UNAVAILABLE, attempt 1 of 3, waiting 100 ms",
     "2026-12-01 12:02:11,574 WARNING booking_service.grpc retry /flight.v1.FlightService/GetFlight after UNAVAILABLE, attempt 2 of 3, waiting 200 ms",
     "2026-12-01 12:02:11,779 WARNING booking_service.grpc retry /flight.v1.FlightService/GetFlight after UNAVAILABLE, attempt 1 of 3, waiting 100 ms",
     "2026-12-01 12:02:11,880 WARNING booking_service.grpc retry /flight.v1.FlightService/GetFlight after UNAVAILABLE, attempt 2 of 3, waiting 200 ms",
     "2026-12-01 12:02:12,084 WARNING booking_service.grpc retry /flight.v1.FlightService/GetFlight after UNAVAILABLE, attempt 1 of 3, waiting 100 ms",
     "2026-12-01 12:02:12,184 WARNING booking_service.grpc retry /flight.v1.FlightService/GetFlight after UNAVAILABLE, attempt 2 of 3, waiting 200 ms",
     "2026-12-01 12:02:12,407 WARNING booking_service.grpc retry /flight.v1.FlightService/GetFlight after UNAVAILABLE, attempt 1 of 3, waiting 100 ms",
     "2026-12-01 12:02:12,508 WARNING booking_service.grpc retry /flight.v1.FlightService/GetFlight after UNAVAILABLE, attempt 2 of 3, waiting 200 ms",
     "2026-12-01 12:02:12,714 WARNING booking_service.grpc retry /flight.v1.FlightService/GetFlight after UNAVAILABLE, attempt 1 of 3, waiting 100 ms",
     "2026-12-01 12:02:12,815 WARNING booking_service.grpc retry /flight.v1.FlightService/GetFlight after UNAVAILABLE, attempt 2 of 3, waiting 200 ms",
     "2026-12-01 12:02:13,016 WARNING booking_service.grpc circuit breaker CLOSED -> OPEN"
    ],
    "flight-service": [],
    "redis-sentinel-1": []
   }
  },
  {
   "key": "flight-back",
   "calls": [
    {
     "method": "GET",
     "path": "/flights/55555555-5555-5555-5555-555555555555",
     "body": null,
     "response": {
      "status": 200,
      "body": {
       "id": "55555555-5555-5555-5555-555555555555",
       "flight_number": "S71025",
       "airline_code": "S7",
       "airline_name": "S7 Airlines",
       "origin": "DME",
       "destination": "AER",
       "departure_time": "2027-04-01T06:00:00Z",
       "arrival_time": "2027-04-01T10:00:00Z",
       "total_seats": 2,
       "available_seats": 2,
       "price": "12500.00",
       "status": "SCHEDULED"
      },
      "ms": 10
     }
    }
   ],
   "state": {
    "flights": [
     {
      "flight": "S71025",
      "available_seats": 2,
      "total_seats": 2,
      "status": "SCHEDULED"
     }
    ],
    "seat_reservations": [
     {
      "booking": "9df6658c",
      "seat_count": 2,
      "status": "RELEASED"
     }
    ],
    "bookings": [
     {
      "id": "9df6658c",
      "user_id": "u1",
      "seat_count": 2,
      "total_price": 25000.0,
      "status": "CANCELLED"
     }
    ],
    "redis": {
     "master": "172.30.0.11:6379",
     "keys": [
      {
       "key": "flight:55555555-5555-5555-5555-555555555555",
       "ttl": 262
      }
     ]
    }
   },
   "logs": {
    "booking-service": [
     "2026-12-01 12:02:36,548 WARNING booking_service.grpc circuit breaker OPEN -> HALF_OPEN",
     "2026-12-01 12:02:36,553 WARNING booking_service.grpc circuit breaker HALF_OPEN -> CLOSED"
    ],
    "flight-service": [
     "2026-12-01 12:02:36,552 INFO flight_service.cache cache hit flight:55555555-5555-5555-5555-555555555555"
    ],
    "redis-sentinel-1": []
   }
  }
 ]
}