Add peer buffer update tracking to Broker manager's logging adapter

This implements basic counts for each peering's fill level and overflows.  We
don't use proper telemetry here since doing so makes more sense at the Zeek
cluster level, so we can label updates with cluster node names. See subsequent
commit for that part.
This commit is contained in:
Christian Kreibich 2025-04-15 18:08:16 -07:00
parent 37011571db
commit 0a05a9aa99
6 changed files with 168 additions and 8 deletions

View file

@ -391,6 +391,9 @@ export {
## Returns: a unique identifier for the local broker endpoint.
global node_id: function(): string;
global peer_buffer_levels: function(): table[string] of count;
global peer_buffer_overflows: function(): table[string] of count;
## Sends all pending log messages to remote peers. This normally
## doesn't need to be used except for test cases that are time-sensitive.
global flush_logs: function(): count;
@ -551,6 +554,16 @@ function node_id(): string
return __node_id();
}
function peer_buffer_levels(): table[string] of count
{
return __peer_buffer_levels();
}
function peer_buffer_overflows(): table[string] of count
{
return __peer_buffer_overflows();
}
function flush_logs(): count
{
return __flush_logs();