mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 12:08:20 +00:00
OpaqueVal: Register TelemetryVals, too
Even if they are not serializable, OpaqueMgr::TypeID() is called during BuildJSON() for them and that previously just aborted. Closes #3473
This commit is contained in:
parent
2284ad4b85
commit
aa5d7f5a73
6 changed files with 55 additions and 0 deletions
|
@ -5,6 +5,8 @@
|
|||
# @TEST-EXEC: zeek -b %INPUT >output
|
||||
# @TEST-EXEC: btest-diff output
|
||||
|
||||
@load base/frameworks/telemetry
|
||||
|
||||
type color: enum { Red, White, Blue };
|
||||
|
||||
type myrec1: record {
|
||||
|
@ -132,4 +134,27 @@ event zeek_init()
|
|||
# Opaque
|
||||
local o1: opaque of topk = topk_init(5);
|
||||
print to_json(o1);
|
||||
|
||||
# Telemetry values wrapping opaque values.
|
||||
local gauge_family = Telemetry::register_gauge_family([
|
||||
$prefix="btest",
|
||||
$name="btest_testing_gauge",
|
||||
$unit="1",
|
||||
$help_text="Btest testing",
|
||||
$labels=vector("dim_1"),
|
||||
]);
|
||||
local gauge = Telemetry::gauge_with(gauge_family, vector("dim_1_value"));
|
||||
print to_json(gauge);
|
||||
print to_json(gauge_family);
|
||||
|
||||
local counter_family = Telemetry::register_counter_family([
|
||||
$prefix="btest",
|
||||
$name="btest_testing_counter",
|
||||
$unit="1",
|
||||
$help_text="Btest testing",
|
||||
$labels=vector("dim_1"),
|
||||
]);
|
||||
local counter = Telemetry::counter_with(counter_family, vector("dim_1_value"));
|
||||
print to_json(counter);
|
||||
print to_json(counter_family);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue