Skip to main content

Documentation Index

Fetch the complete documentation index at: https://grantmaster.dev/llms.txt

Use this file to discover all available pages before exploring further.

Observability and Audit Strategy

This document details how we monitor system health and maintain a forensic record of all high-impact actions.

🏗️ Observability Stack Visual

🔍 The Audit Trail

Every state-changing operation (Create, Update, Delete) must emit an audit entry. This is enforced at the BaseService level.

Audit Schema

interface AuditLog {
  tenantId: string;
  userId: string;
  action: 'CREATE' | 'UPDATE' | 'DELETE' | 'EXPORT';
  resourceType: 'PURSUIT' | 'ORGANIZATION' | 'EFFORT';
  resourceId: string;
  previousState: any; // Omitted for large documents
  newState: any;
  timestamp: Timestamp;
  userAgent: string;
}

🚨 Error Tracking (Sentry)

We use Sentry with Breadcrumbs enabled. When an error occurs:
  1. Context: The tenantId and userId are automatically tagged.
  2. Path: The last 5 navigation steps and Firestore listener IDs are recorded.
  3. Alerting: High-severity errors in the production environment trigger a Slack notification to #ops-alerts.

📈 Performance Monitoring

  • Function Execution Time: Monitored via GCP Cloud Trace. Any function exceeding 10s triggers a “Cold Start” investigation.
  • Firestore Read Quotas: Monitored via the Firebase Usage dashboard. We set alerts at 80% of our daily budget.

🛠️ Accessing Logs

  • Developer: Use firebase functions:log or the GCP Console.
  • Support: Use the “Audit Trail” tab within the SuperAdmin organization view.