Skip to content

Commit c97c89a

Browse files
authored
chore: reduce spammy websocket message handling logs (#869)
2 parents 2f9fffb + 2364a4c commit c97c89a

File tree

1 file changed

+6
-8
lines changed
  • tycho-indexer/src/services

1 file changed

+6
-8
lines changed

tycho-indexer/src/services/ws.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ impl WsActor {
284284
let handle = ctx.add_stream(stream);
285285
actor.subscriptions.insert(subscription_id, handle);
286286
actor.compression_enabled.insert(subscription_id, compression);
287-
debug!("Added subscription to hashmap");
288287
gauge!("websocket_extractor_subscriptions_active", "subscription_id" => subscription_id.to_string()).increment(1);
289288
counter!(
290289
"websocket_extractor_subscriptions_metadata",
@@ -451,12 +450,11 @@ impl StreamHandler<Result<ws::Message, ws::ProtocolError>> for WsActor {
451450
self.heartbeat = Instant::now();
452451
}
453452
Ok(ws::Message::Text(text)) => {
454-
debug!(actor_id = %self.id, text = %text, "Websocket text message received");
453+
trace!(actor_id = %self.id, text = %text, "Websocket text message received");
455454

456455
// Try to deserialize the message to a Message enum
457456
match serde_json::from_str::<Command>(&text) {
458457
Ok(message) => {
459-
debug!(actor_id = %self.id, "Parsed command successfully");
460458
// Handle the message based on its variant
461459
match message {
462460
Command::Subscribe {
@@ -465,18 +463,18 @@ impl StreamHandler<Result<ws::Message, ws::ProtocolError>> for WsActor {
465463
compression,
466464
partial_blocks,
467465
} => {
468-
debug!(actor_id = %self.id, %extractor_id, "Message handler: Processing subscribe request");
466+
trace!(actor_id = %self.id, %extractor_id, "Message handler: Processing subscribe request");
469467
self.subscribe(
470468
ctx,
471469
&extractor_id.clone().into(),
472470
include_state,
473471
compression,
474472
partial_blocks,
475473
);
476-
debug!(actor_id = %self.id, %extractor_id, "Message handler: Subscribe method completed");
474+
trace!(actor_id = %self.id, %extractor_id, "Message handler: Subscribe method completed");
477475
}
478476
Command::Unsubscribe { subscription_id } => {
479-
debug!(%subscription_id, "Unsubscribing from subscription");
477+
trace!(%subscription_id, "Unsubscribing from subscription");
480478
self.unsubscribe(ctx, subscription_id);
481479
}
482480
}
@@ -495,11 +493,11 @@ impl StreamHandler<Result<ws::Message, ws::ProtocolError>> for WsActor {
495493
}
496494
}
497495
Ok(ws::Message::Binary(bin)) => {
498-
debug!("Websocket binary message received");
496+
trace!("Websocket binary message received");
499497
ctx.binary(bin)
500498
}
501499
Ok(ws::Message::Close(reason)) => {
502-
debug!(reason = ?reason, "Websocket close message received");
500+
trace!(reason = ?reason, "Websocket close message received");
503501
ctx.close(reason);
504502
ctx.stop()
505503
}

0 commit comments

Comments
 (0)