Audit Service
Simple event logging for audit trails.
On This Page
- What It Does
- Key Capabilities
- How It Fits Together
- Common Use Cases
- What You Donβt Have to Build
- Technical Details
What It Does
The Audit Service provides a straightforward way to record events. Services can log actions with an event type, optional user ID, and a flexible data payload. By default, events are recorded to BigQuery. Once in BigQuery, audit logs become fully queryable using standard SQL.
Key Capabilities
| Capability | Description |
|---|---|
| Event Logging | Record events with a type, optional user ID, and custom JSON payload |
| Flexible Payload | Attach any structured data to log entries via the generic additionalData field |
| Async Processing | Logs are processed via Cloud Tasks to avoid blocking your services |
| BigQuery Storage | By default, logs are stored in BigQuery, partitioned by month |
How It Fits Together
ββββββββββββββββββββββββββββββββββββββββ
β Your Services β
β (call AuditLogService.log()) β
ββββββββββββββββββββ¬ββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββ
β Cloud Tasks β
β (async processing) β
ββββββββββββββββββββ¬ββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββ
β Event Storage β
β (BigQuery by default) β
ββββββββββββββββββββββββββββββββββββββββCommon Use Cases
- Compliance logging: Record user actions that need an audit trail
- Event tracking: Log significant events for later analysis
- Debugging context: Capture contextual data to help investigate issues
What You Donβt Have to Build
- Event logging infrastructure
- BigQuery integration
- Async processing with Cloud Tasks
- JSON payload storage
- Monthly partitioning
- Audit trail querying
Technical Details
The Audit Service is straightforward - it provides simple event logging without heavy-lifting features. All events are logged asynchronously to prevent blocking your services.
π€ This documentation was generated using AI and human-proofed for accuracy.
Last updated on