mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
broker/WebSocketShim: Add calls to Telemetry hooks
WebSocket clients with Broker do not use the normal Broker backend, so we need to add the telemetry invocations explicitly.
This commit is contained in:
parent
376e6dba97
commit
6a84237a95
1 changed files with 6 additions and 0 deletions
|
@ -118,6 +118,9 @@ bool WebSocketShim::DoPublishEvent(const std::string& topic, zeek::cluster::deta
|
|||
return false;
|
||||
}
|
||||
|
||||
size_t size = r->as_data().shared_envelope()->raw_bytes().second;
|
||||
Telemetry().OnOutgoingEvent(topic, r->name(), cluster::detail::SerializationInfo{size});
|
||||
|
||||
auto msg = broker::data_envelope::make(broker::topic(topic), r->as_data());
|
||||
state->hub.publish(std::move(msg));
|
||||
return true;
|
||||
|
@ -176,6 +179,9 @@ void WebSocketShim::ProcessMessage(std::string_view topic, broker::zeek::Event&
|
|||
return;
|
||||
}
|
||||
|
||||
size_t size = ev.as_data().shared_envelope()->raw_bytes().second;
|
||||
Telemetry().OnIncomingEvent(topic, r->HandlerName(), cluster::detail::SerializationInfo{size});
|
||||
|
||||
ProcessEvent(topic, std::move(*r));
|
||||
}
|
||||
void WebSocketShim::ProcessMessage(std::string_view topic, broker::zeek::Invalid& invalid) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue