A Python automation system processes a batch of events and writes an audit trail into Cloud Logging. The system sometimes receives the same event twice due to retries. Which behavior ensures the audit log remains consistent and avoids double-counting?

Answer

Attach a deterministic audit ID derived from event content and write using an upsert-like pattern or idempotent keying

Explanation

Deterministic keys enable idempotent logging so duplicate deliveries do not create multiple audit entries or inflated counts.

Last reviewed: October 2026

Reviewed by FirstInTest Editorial Team

Report an error
QuestionBack to list