Google Sign-In Required

Use your company Google account to access the BetterFleet private content.

Back to private home

BetterFleet Support Private
Skip to content
BetterFleet Dev Wiki
bf-manage-incidents
Initializing search
    bf-dev
    • Home
    • Product Capabilities
    • Process
    • Current Work
    • System Design
    • Software Reference
    • Operations
    bf-dev
    • Home
      • Overview
      • Manage
      • Overview
      • Product Engineering Workflow
      • Product Engineering Delivery
      • Product Engineering Workflow in Linear
        • GitLab Feature Flags
        • In-App Docs Authoring
        • Release Notes
      • Templates
      • Publishing
      • Workflow Companions
      • Overview
      • Active Artifacts
      • Backlog Artifacts
      • Archived Artifacts
      • Overview
      • Microgrid
      • OSCP
        • Challenge
        • Specification
        • Spec
        • Architecture
        • Overview
        • Script Runtime Model
        • Compose Profiles and Modes
        • Repo Topology
        • CI and Release Integration
        • Overview
        • Internal Application Diagrams
          • Overview
          • Web Model
          • Core Model
        • Service Interaction Flows
        • Data and State
          • Index
          • bf-manage-web
          • bf-manage-core
          • bf-manage-connect
          • bf-manage-sitepwrmon
          • bf-manage-incidents
            • What this service is
            • Code anatomy
            • Architectural characteristics
            • Documentation and tests in-repo
            • Internal request lifecycle
          • bf-telematics
          • bf-depot-sim
          • bf-manage-roaming
          • bf-support-microsite
          • bf-digital-twin
          • bf-schedule-creator
        • Overview
        • Internal Application Diagrams
        • Migration and Flags
        • Simulation Request Lifecycle
          • Index
          • bf-bnl-ui
          • bf-bnl-settings
          • bf-bnl-schedule-analysis-compute
          • bf-route-modelling
          • bf-schedule-creator
          • bf-digital-twin
        • Overview
        • Secrets and Env Strategy
        • Vendors and Local Dependencies
        • ADRs
        • Service Matrix
        • Cloud Dependencies
        • Ports and URLs
      • Onboarding
      • Daily Operations Runbook
        • Overview
        • Staging Hotfix Release
        • Production Hotfix Release
        • Terraform Plan Dry Runs
      • Troubleshooting
      • Testing Guide
    • What this service is
    • Code anatomy
    • Architectural characteristics
    • Documentation and tests in-repo
    • Internal request lifecycle

    bf-manage-incidents¶

    What this service is¶

    bf-manage-incidents is the incident/event intelligence service. It ingests event streams, applies grouping/rule logic, persists incidents, and drives notification workflows.

    Code anatomy¶

    • src/app.py: FastAPI entrypoint and app wiring.
    • src/incidents/*: incident domain logic, including rule-engine modules.
    • src/event_bus/*: event ingestion/consumption and event abstractions.
    • src/notifications/*: formatting, channel dispatch, and notification delivery logic.
    • src/watcher/*: monitoring/watcher workflows.
    • src/maintenance_window/*: suppression/scheduling windows around alerts.
    • src/db/alembic: migrations and persistence boundary.

    Architectural characteristics¶

    • Event-driven domain service with explicit notification and maintenance-window subdomains.
    • Dedicated incidents database (postgresql-incidents) boundary.

    Documentation and tests in-repo¶

    • README describes incident grouping intent and flow.
    • Tests organized by subdomain (incident, event_bus, notifications, watcher, maintenance_window).

    Internal request lifecycle¶

    sequenceDiagram
      participant Source as event source
      participant Bus as event bus
      participant Engine as rule engine
      participant Incident as incident module
      participant Notify as notification module
      participant Db as incidents database
    
      Source->>Bus: emit event
      Bus->>Engine: route event for evaluation
      Engine->>Incident: create or update incident
      Incident->>Db: persist incident state
      Incident->>Notify: trigger notification action
      Notify-->>Source: downstream notification side effects
    Made with Material for MkDocs