mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Merge branch 'topic/christian/broker-prometheus-cpp'
* topic/christian/broker-prometheus-cpp: Update the scripts.base.frameworks.telemetry.internal-metrics test Revert "Temporarily disable the scripts/base/frameworks/telemetry/internal-metrics btest" Bump Broker to pull in new Prometheus support and pass in Zeek's registry
This commit is contained in:
commit
c4bc9078ef
6 changed files with 48 additions and 54 deletions
8
CHANGES
8
CHANGES
|
@ -1,3 +1,11 @@
|
|||
7.0.0-dev.467 | 2024-07-11 12:14:52 -0700
|
||||
|
||||
* Update the scripts.base.frameworks.telemetry.internal-metrics test (Christian Kreibich, Corelight)
|
||||
|
||||
* Revert "Temporarily disable the scripts/base/frameworks/telemetry/internal-metrics btest" (Christian Kreibich, Corelight)
|
||||
|
||||
* Bump Broker to pull in new Prometheus support and pass in Zeek's registry (Dominik Charousset and Christian Kreibich, Corelight)
|
||||
|
||||
7.0.0-dev.461 | 2024-07-10 18:45:36 +0200
|
||||
|
||||
* Extend btest for logging of disabled analyzers (Jan Grashoefer, Corelight)
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
7.0.0-dev.461
|
||||
7.0.0-dev.467
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit c47de11e4b84f24e8b501c3b1a446ad808e4964a
|
||||
Subproject commit fada26ae504981f7f5524bf2a5c82ae49acd556d
|
|
@ -189,7 +189,7 @@ struct opt_mapping {
|
|||
class BrokerState {
|
||||
public:
|
||||
BrokerState(broker::configuration config, size_t congestion_queue_size)
|
||||
: endpoint(std::move(config)),
|
||||
: endpoint(std::move(config), telemetry_mgr->GetRegistry()),
|
||||
subscriber(
|
||||
endpoint.make_subscriber({broker::topic::statuses(), broker::topic::errors()}, congestion_queue_size)) {}
|
||||
|
||||
|
|
|
@ -1,40 +1,27 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
### broker |12|
|
||||
Telemetry::INT_GAUGE, broker, connections, [type], [native], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_GAUGE, broker, connections, [type], [web-socket], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_COUNTER, broker, processed-messages, [type], [data], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_COUNTER, broker, processed-messages, [type], [command], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_COUNTER, broker, processed-messages, [type], [routing-update], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_COUNTER, broker, processed-messages, [type], [ping], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_COUNTER, broker, processed-messages, [type], [pong], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_GAUGE, broker, buffered-messages, [type], [data], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_GAUGE, broker, buffered-messages, [type], [command], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_GAUGE, broker, buffered-messages, [type], [routing-update], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_GAUGE, broker, buffered-messages, [type], [ping], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_GAUGE, broker, buffered-messages, [type], [pong], 0.0
|
||||
count_value, 0
|
||||
### caf |5|
|
||||
Telemetry::INT_COUNTER, caf.system, rejected-messages, [], [], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_COUNTER, caf.system, processed-messages, [], [], 7.0
|
||||
count_value, 7
|
||||
Telemetry::INT_GAUGE, caf.system, running-actors, [], [], 2.0
|
||||
count_value, 2
|
||||
Telemetry::INT_GAUGE, caf.system, queued-messages, [], [], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_GAUGE, caf.actor, mailbox-size, [name], [broker.core], 0.0
|
||||
count_value, 0
|
||||
### caf |2|
|
||||
Telemetry::DOUBLE_HISTOGRAM, caf.actor, processing-time, [0.00001, 0.0001, 0.0005, 0.001, 0.01, 0.1, 0.5, 1.0, 5.0, inf], [name], [broker.core]
|
||||
Telemetry::DOUBLE_HISTOGRAM, caf.actor, mailbox-time, [0.00001, 0.0001, 0.0005, 0.001, 0.01, 0.1, 0.5, 1.0, 5.0, inf], [name], [broker.core]
|
||||
Telemetry::COUNTER, broker, broker_processed_messages_total, [type], [command], 0.0
|
||||
value, 0.0
|
||||
Telemetry::GAUGE, broker, broker_buffered_messages, [type], [command], 0.0
|
||||
value, 0.0
|
||||
Telemetry::COUNTER, broker, broker_processed_messages_total, [type], [data], 0.0
|
||||
value, 0.0
|
||||
Telemetry::GAUGE, broker, broker_buffered_messages, [type], [data], 0.0
|
||||
value, 0.0
|
||||
Telemetry::GAUGE, broker, broker_connections, [type], [native], 0.0
|
||||
value, 0.0
|
||||
Telemetry::COUNTER, broker, broker_processed_messages_total, [type], [ping], 0.0
|
||||
value, 0.0
|
||||
Telemetry::GAUGE, broker, broker_buffered_messages, [type], [ping], 0.0
|
||||
value, 0.0
|
||||
Telemetry::COUNTER, broker, broker_processed_messages_total, [type], [pong], 0.0
|
||||
value, 0.0
|
||||
Telemetry::GAUGE, broker, broker_buffered_messages, [type], [pong], 0.0
|
||||
value, 0.0
|
||||
Telemetry::COUNTER, broker, broker_processed_messages_total, [type], [routing-update], 0.0
|
||||
value, 0.0
|
||||
Telemetry::GAUGE, broker, broker_buffered_messages, [type], [routing-update], 0.0
|
||||
value, 0.0
|
||||
Telemetry::GAUGE, broker, broker_connections, [type], [web-socket], 0.0
|
||||
value, 0.0
|
||||
### broker |0|
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# @TEST-DOC: Query some internal broker/caf related metrics as they use the int64_t versions, too.
|
||||
# @TEST-DOC: Query Broker's telemetry to verify it ends up in Zeek's registry.
|
||||
# Note compilable to C++ due to globals being initialized to a record that
|
||||
# has an opaque type as a field.
|
||||
# @TEST-KNOWN-FAILURE: Implementation for prometheus-cpp missing in broker
|
||||
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
|
||||
# @TEST-EXEC: zcat <$TRACES/echo-connections.pcap.gz | zeek -b -Cr - %INPUT > out
|
||||
# @TEST-EXEC: btest-diff out
|
||||
|
@ -9,17 +8,19 @@
|
|||
|
||||
@load base/frameworks/telemetry
|
||||
|
||||
redef running_under_test = T;
|
||||
|
||||
function print_histogram_metrics(what: string, metrics: vector of Telemetry::HistogramMetric)
|
||||
{
|
||||
print fmt("### %s |%s|", what, |metrics|);
|
||||
for (i in metrics)
|
||||
{
|
||||
local m = metrics[i];
|
||||
print m$opts$metric_type, m$opts$prefix, m$opts$name, m$opts$bounds, m$opts$labels, m$labels;
|
||||
print m$opts$metric_type, m$opts$prefix, m$opts$name, m$opts$bounds, m$label_names, m?$label_values ? m$label_values : vector();
|
||||
# Don't output actual values as they are runtime dependent.
|
||||
# print m$values, m$sum, m$observations;
|
||||
if ( m$opts?$count_bounds )
|
||||
print m$opts$count_bounds;
|
||||
if ( m$opts?$bounds )
|
||||
print m$opts$bounds;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,19 +30,17 @@ function print_metrics(what: string, metrics: vector of Telemetry::Metric)
|
|||
for (i in metrics)
|
||||
{
|
||||
local m = metrics[i];
|
||||
print m$opts$metric_type, m$opts$prefix, m$opts$name, m$opts$labels, m$labels, m$value;
|
||||
print m$opts$metric_type, m$opts$prefix, m$opts$name, m$label_names, m?$label_values ? m$label_values : vector(), m$value;
|
||||
|
||||
if (m?$count_value)
|
||||
print "count_value", m$count_value;
|
||||
if (m?$value)
|
||||
print "value", m$value;
|
||||
}
|
||||
}
|
||||
|
||||
event zeek_done() &priority=-100
|
||||
{
|
||||
local broker_metrics = Telemetry::collect_metrics("broker", "*");
|
||||
local broker_metrics = Telemetry::collect_metrics("broker*", "*");
|
||||
print_metrics("broker", broker_metrics);
|
||||
local caf_metrics = Telemetry::collect_metrics("caf*", "*");
|
||||
print_metrics("caf", caf_metrics);
|
||||
local caf_histogram_metrics = Telemetry::collect_histogram_metrics("caf*", "*");
|
||||
print_histogram_metrics("caf", caf_histogram_metrics);
|
||||
local broker_histogram_metrics = Telemetry::collect_histogram_metrics("broker*", "*");
|
||||
print_histogram_metrics("broker", broker_histogram_metrics);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue