Try adding Broker::metrics_import_topics, stuck

This commit is contained in:
Arne Welzel 2022-08-08 17:15:02 +02:00
parent 857b21ae73
commit c2ca92d772
4 changed files with 60 additions and 0 deletions

View file

@ -152,6 +152,13 @@ export {
## BROKER_METRICS_EXPORT_TOPIC is defined.
option metrics_export_topic = "";
## Topics imported for metrics. This should be set on the node that
## is importing metrics from other nodes.
## Zeek overrides any value provided in zeek_init or earlier at
## startup if the environment variable
## BROKER_METRICS_IMPORT_TOPICS is defined.
option metrics_import_topics: vector of string = vector();
## ID for the metrics exporter. When setting a target topic for the
## exporter, Broker sets this option to the suffix of the new topic *unless*
## the ID is a non-empty string. Since setting a topic starts the periodic
@ -462,6 +469,12 @@ function update_metrics_export_topic(id: string, val: string): string
return val;
}
function update_metrics_import_topics(id: string, topics: vector of string): vector of string
{
Broker::__set_metrics_import_topics(topics);
return topics;
}
function update_metrics_export_endpoint_name(id: string, val: string): string
{
Broker::__set_metrics_export_endpoint_name(val);
@ -487,6 +500,11 @@ event zeek_init()
Broker::metrics_export_topic);
Option::set_change_handler("Broker::metrics_export_topic",
update_metrics_export_topic);
# import topics
update_metrics_import_topics("Broker::metrics_import_topics",
Broker::metrics_import_topics);
Option::set_change_handler("Broker::metrics_import_topics",
update_metrics_import_topics);
# endpoint name
update_metrics_export_endpoint_name("Broker::metrics_export_endpoint_name",
Broker::metrics_export_endpoint_name);