How would you automate the collection of incident response data from running Docker containers on Google Cloud without disrupting production workloads?
Implement a read-only collector that merges per-container incident-event streams without modifying them. Return events in timestamp order, break equal timestamps by container ID, remove duplicate event IDs, and stop after max_records results.
Use collect_incident_data(container_events, max_records). container_events maps container IDs to lists of event dictionaries, each containing event_id, timestamp, kind, and payload; each list is already timestamp-sorted. Return a list of event dictionaries.
def collect_incident_data(container_events, max_records):