zeek/scripts/base/frameworks/broker
Christian Kreibich f5fbad23ff Add peer buffer update tracking to the Broker manager's event_observer
This implements basic tracking of each peering's current fill level, the maximum
level over a recent time interval (via a new Broker::buffer_stats_reset_interval
tunable, defaulting to 1min), and the number of times a buffer overflows. For
the disconnect policy this is the number of depeerings, but for drop_newest and
drop_oldest it implies the number of messages lost.

This doesn't use "proper" telemetry metrics for a few reasons: this tracking is
Broker-specific, so we need to track each peering via endpoint_ids, while we
want the metrics to use Cluster node name labels, and the latter live in the
script layer. Using broker::endpoint_id directly as keys also means we rely on
their ability to hash in STL containers, which should be fast.

This does not track the buffer levels for Broker "clients" (as opposed to
"peers"), i.e. WebSockets, since we currently don't have a way to name these,
and we don't want to use ephemeral Broker IDs in their telemetry.

To make the stats accessible to the script layer the Broker manager (via a new
helper class that lives in the event_observer) maintains a TableVal mapping
Broker IDs to a new BrokerPeeringStats record. The table's members get updated
every time that table is requested. This minimizes new val instantiation and
allows the script layer to customize the BrokerPeeringStats record by redefing,
updating fields, etc. Since we can't use Zeek vals outside the main thread, this
requires some care so all table updates happen only in the Zeek-side table
updater, PeerBufferState::GetPeeringStatsTable().
2025-04-24 22:47:18 -07:00
..
__load__.zeek Support re-peering with Broker peers that fall behind 2024-12-06 15:18:05 -08:00
backpressure.zeek Use Broker peering directionality when re-peering after backpressure overflows 2025-04-21 14:08:42 -07:00
log.zeek Merge remote-tracking branch 'origin/topic/neverlord/broker-logging' 2025-03-31 18:53:43 +02:00
main.zeek Add peer buffer update tracking to the Broker manager's event_observer 2025-04-24 22:47:18 -07:00
README More bro-to-zeek renaming in scripts and other files 2019-05-16 02:36:41 -05:00
store.zeek broker/store: Extend SQLiteOptions around data safety and performance 2023-01-30 10:25:37 +01:00

The Broker communication framework facilitates connecting to remote Zeek
instances to share state and transfer events.