Skip to content

Add WebSocket Monitoring Support #24

@GabrielChaves1

Description

@GabrielChaves1

Summary

I would like to propose the implementation of WebSocket monitoring support in GoVisual. The idea is to allow the dashboard to display not only HTTP requests, but also WebSocket handshakes and messages exchanged between client and server, grouped by connection.

Motivation

  • Modern APIs often use WebSocket for real-time communication.
  • This would make it much easier to debug and analyze Go applications that use WebSocket.

Proposed Solution

  • Add optional fields to the RequestLog struct to identify WebSocket logs (e.g., connection ID, direction, message type).
  • Create a helper (e.g., WrapWebSocket) to wrap WebSocket handlers and log handshakes and messages.
  • Adapt the dashboard to visually differentiate and filter WebSocket logs.

Note

I have some doubts regarding the current structure of the project. As it stands, the architecture is designed to work only with the Wrap function for HTTP servers, and it is not able to handle other types of connections, such as WebSocket or gRPC.

I would appreciate feedback or suggestions on how we could refactor or redesign the core to make it more flexible and extensible for other communication types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions