l8events

Events

Event processing and distribution.

Overview

l8events is a shared event, alarm, and maintenance library for Layer 8 projects. It provides generic protobuf types, Go backend packages, and reusable l8ui components that any consumer project can import. Like l8notify, it depends only on google.golang.org/protobuf -- no l8orm, l8services, l8bus, or consumer project dependencies.

Core Types

EventRecord

Immutable after creation. Captures a single occurrence with category, severity, source information, timestamps, and extensible attributes. Events can generate alarms via the generatedAlarmId field.

AlarmRecord

State machine lifecycle. Alarms progress through states: Active, Acknowledged, Cleared, Suppressed. Each state change is recorded in a stateHistory audit trail. Supports deduplication via dedupKey, occurrence counting, severity changes, and attached notes.

MaintenanceWindow

Time-bounded suppression windows. Supports recurrence patterns (daily, weekly, monthly) with scope filtering by entity IDs and types.

Enums

Severity
INFO, WARNING, MINOR, MAJOR, CRITICAL
AlarmState
ACTIVE, ACKNOWLEDGED, CLEARED, SUPPRESSED
EventState
NEW, PROCESSED, DISCARDED, ARCHIVED
EventCategory
17 categories: Audit, System, Monitoring, Security, Integration, Custom, Network, Kubernetes, Performance, Syslog, Trap, Compute, Storage, Power, GPU, Topology, Automation
MaintenanceStatus
SCHEDULED, ACTIVE, COMPLETED, CANCELLED

Category Event Messages

16 typed event messages, one per EventCategory. Each shares common fields (eventId, propertyId, sourceId, sourceType) and adds domain-specific parsed fields. The propertyId references the exact attribute in a source model via l8reflect property paths.

Examples: AuditEvent (login, config change), NetworkEvent (BGP, OSPF, interface), KubernetesEvent (pod, node, deployment), GpuEvent (temperature, utilization, memory).

Go Packages

state -- Alarm State Machine

Validates alarm state transitions. Enforces the allowed transition graph and returns errors for invalid transitions.

archive -- Archive Engine

Generic archive engine for moving resolved events and alarms to cold storage.

maintenance -- Window Evaluator

Evaluates whether a given entity at a given time falls within an active maintenance window. Handles recurrence expansion.

convert -- Event Converter

Converter engine with a Parser interface and dispatch system. Ships with 16 built-in parsers covering all event categories: Audit, System, Monitoring, Security, Integration, Performance, Syslog, Trap, Automation (ops), Network, Kubernetes, Compute, Storage, Power, GPU, Topology (infra).

l8ui Components

Alarm Table
Column definitions and form for alarm records
Alarm Detail
State history and notes renderer
Event Viewer
Event table columns and form
Archive Viewer
Archive table columns for both alarms and events
Maintenance Windows
Columns and form for maintenance window management
State Actions
Acknowledge, Clear, and Suppress action buttons
Shared Enums
Severity, alarm state, event category enums with renderers