mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 01:28:20 +00:00
Restore label_names field in MetricOpts record
This commit is contained in:
parent
1cdca7c1d0
commit
99e64aa113
6 changed files with 55 additions and 46 deletions
|
@ -14,42 +14,42 @@ global btest_a_cf = Telemetry::register_counter_family([
|
|||
$prefix="btest",
|
||||
$name="a_test",
|
||||
$unit="",
|
||||
$help_text="A btest metric"],
|
||||
vector("x", "y")
|
||||
);
|
||||
$help_text="A btest metric",
|
||||
$label_names=vector("x", "y")
|
||||
]);
|
||||
|
||||
global btest_b_cf = Telemetry::register_counter_family([
|
||||
$prefix="btest",
|
||||
$name="b_test",
|
||||
$unit="",
|
||||
$help_text="Another btest metric"],
|
||||
vector("x", "y")
|
||||
);
|
||||
$help_text="Another btest metric",
|
||||
$label_names=vector("x", "y")
|
||||
]);
|
||||
|
||||
global btest_c_cf = Telemetry::register_counter_family([
|
||||
$prefix="btest",
|
||||
$name="c_test",
|
||||
$unit="",
|
||||
$help_text="The last btest metric"],
|
||||
vector("x", "y")
|
||||
);
|
||||
$help_text="The last btest metric",
|
||||
$label_names=vector("x", "y")
|
||||
]);
|
||||
|
||||
global system_sensor_temp_gf = Telemetry::register_gauge_family([
|
||||
$prefix="system",
|
||||
$name="sensor_temperature",
|
||||
$unit="celsius",
|
||||
$help_text="Temperatures reported by sensors in the system"],
|
||||
vector("name")
|
||||
);
|
||||
$help_text="Temperatures reported by sensors in the system",
|
||||
$label_names=vector("name")
|
||||
]);
|
||||
|
||||
global btest_sample_histogram_hf = Telemetry::register_histogram_family([
|
||||
$prefix="btest",
|
||||
$name="sample_histogram",
|
||||
$unit="",
|
||||
$help_text="A sample histogram that is not returned by Telemetry::collect_metrics",
|
||||
$bounds=vector(1.0, 2.0, 3.0, 4.0, 5.0)],
|
||||
vector("dim")
|
||||
);
|
||||
$bounds=vector(1.0, 2.0, 3.0, 4.0, 5.0),
|
||||
$label_names=vector("dim")
|
||||
]);
|
||||
|
||||
function print_metrics(what: string, metrics: vector of Telemetry::Metric)
|
||||
{
|
||||
|
|
|
@ -18,11 +18,11 @@ global connection_duration_hf = Telemetry::register_histogram_family([
|
|||
global realistic_connection_duration_hf = Telemetry::register_histogram_family([
|
||||
$prefix="zeek",
|
||||
$name="realistic_connection_duration",
|
||||
$label_names=vector("proto"),
|
||||
$unit="seconds",
|
||||
$help_text="Monitored connection durations by protocol",
|
||||
$bounds=vector(0.1, 1.0, 10.0, 30.0, 60.0, 120.0, 300, 900.0, 1800.0)],
|
||||
vector("proto"),
|
||||
);
|
||||
$bounds=vector(0.1, 1.0, 10.0, 30.0, 60.0, 120.0, 300, 900.0, 1800.0),
|
||||
]);
|
||||
|
||||
global connection_duration_h = Telemetry::histogram_with(connection_duration_hf);
|
||||
|
||||
|
|
|
@ -140,9 +140,9 @@ event zeek_init()
|
|||
$prefix="btest",
|
||||
$name="btest_testing_gauge",
|
||||
$unit="",
|
||||
$help_text="Btest testing"],
|
||||
vector("dim_1"),
|
||||
);
|
||||
$help_text="Btest testing",
|
||||
$label_names=vector("dim_1"),
|
||||
]);
|
||||
local gauge = Telemetry::gauge_with(gauge_family, vector("dim_1_value"));
|
||||
print to_json(gauge);
|
||||
print to_json(gauge_family);
|
||||
|
@ -151,9 +151,9 @@ event zeek_init()
|
|||
$prefix="btest",
|
||||
$name="btest_testing_counter",
|
||||
$unit="",
|
||||
$help_text="Btest testing"],
|
||||
vector("dim_1"),
|
||||
);
|
||||
$help_text="Btest testing",
|
||||
$label_names=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