Convert telemetry code to use prometheus-cpp

This commit is contained in:
Tim Wojtulewicz 2024-03-01 13:43:37 -07:00
parent 97a35011a7
commit a0ae06b3cd
22 changed files with 1517 additions and 1195 deletions

View file

@ -49,7 +49,7 @@ void EventHandler::Call(Args* vl, bool no_remote, double ts) {
telemetry_mgr->CounterFamily("zeek", "event-handler-invocations", {"name"},
"Number of times the given event handler was called", "1", true);
call_count = eh_invocations_family.GetOrAdd({{"name", name}});
call_count = eh_invocations_family->GetOrAdd({{"name", name}});
}
call_count->Inc();
@ -113,4 +113,6 @@ void EventHandler::NewEvent(Args* vl) {
event_mgr.Dispatch(ev);
}
uint64_t EventHandler::CallCount() const { return call_count ? call_count->Value() : 0; }
} // namespace zeek