mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
cluster: Introduce telemetry component
This commit is contained in:
parent
d3593e0489
commit
4c34274a6c
11 changed files with 543 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
# Load the core cluster support.
|
||||
@load ./main
|
||||
@load ./pools
|
||||
@load ./telemetry
|
||||
|
||||
@if ( Cluster::is_enabled() )
|
||||
|
||||
|
|
40
scripts/base/frameworks/cluster/telemetry.zeek
Normal file
40
scripts/base/frameworks/cluster/telemetry.zeek
Normal file
|
@ -0,0 +1,40 @@
|
|||
## Module for cluster telemetry.
|
||||
module Cluster::Telemetry;
|
||||
|
||||
export {
|
||||
type Type: enum {
|
||||
## Creates counter metrics for incoming and for outgoing
|
||||
## events without labels.
|
||||
INFO,
|
||||
## Creates counter metrics for incoming and outgoing events
|
||||
## labeled with handler and normalized topic names.
|
||||
VERBOSE,
|
||||
## Creates histogram metrics using the serialized message size
|
||||
## for events, labeled by topic, handler and script location
|
||||
## (outgoing only).
|
||||
DEBUG,
|
||||
};
|
||||
|
||||
## The telemetry types to enable for the core backend.
|
||||
const core_metrics: set[Type] = {
|
||||
INFO,
|
||||
} &redef;
|
||||
|
||||
## The telemetry types to enable for WebSocket backends.
|
||||
const websocket_metrics: set[Type] = {
|
||||
INFO,
|
||||
} &redef;
|
||||
|
||||
## Table used for normalizing topic names that contain random parts.
|
||||
## Map to an empty string to skip recording a specific metric
|
||||
## completely.
|
||||
const topic_normalizations: table[pattern] of string = {
|
||||
[/^zeek\.cluster\.nodeid\..*/] = "zeek.cluster.nodeid.__normalized__",
|
||||
[/^zeek\/cluster\/nodeid\/.*/] = "zeek/cluster/nodeid/__normalized__",
|
||||
} &ordered &redef;
|
||||
|
||||
## For the DEBUG metrics, the histogram buckets to use.
|
||||
const message_size_bounds: vector of double = {
|
||||
10.0, 50.0, 100.0, 500.0, 1000.0, 5000.0, 10000.0, 50000.0,
|
||||
} &redef;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue