mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
chore: add telemetry event in case we see large datagrams (#7335)
If we see these, something fishy is going on (see #7332), so we should definitely know about these by recording Sentry events. These can potentially be per packet so we only send a telemetry event which gets sampled at a rate of 1%.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use crate::{device_channel::Device, dns, sockets::Sockets};
|
||||
use domain::base::Message;
|
||||
use firezone_logging::{err_with_sources, std_dyn_err, telemetry_span};
|
||||
use firezone_logging::{err_with_sources, std_dyn_err, telemetry_event, telemetry_span};
|
||||
use futures::{
|
||||
future::{self, Either},
|
||||
stream, Stream, StreamExt,
|
||||
@@ -412,6 +412,7 @@ fn is_max_wg_packet_size(d: &DatagramIn) -> bool {
|
||||
let len = d.packet.len();
|
||||
if len > MAX_DATAGRAM_PAYLOAD {
|
||||
tracing::debug!(from = %d.from, %len, "Dropping too large datagram (max allowed: {MAX_DATAGRAM_PAYLOAD} bytes)");
|
||||
telemetry_event!(from = %d.from, %len, "Dropping too large datagram (max allowed: {MAX_DATAGRAM_PAYLOAD} bytes)");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user