lux4rd0 / weatherflow-collector

The WeatherFlow Collector is a comprehensive data collection system that gathers weather data from local UDP broadcasts and remote APIs. It seamlessly feeds this data into InfluxDB V2, which can be visualized using a set of pre-configured Grafana dashboards. The application provides real-time current conditions and detailed forecasts.
https://labs.lux4rd0.com/weatherflow-collector/
GNU Affero General Public License v3.0
77 stars 9 forks source link

v5.1.55 - Enhanced WebSocket Connection Monitoring #28

Closed lux4rd0 closed 4 months ago

lux4rd0 commented 4 months ago

The recent WeatherFlow Collector WebSocket Client update introduces enhanced monitoring and logging capabilities specifically focused on capturing scenarios where no data is received for a specified time. This change aims to improve the reliability and maintainability of the WebSocket connections by providing more informative log messages and ensuring timely reconnections when data is not received within the expected timeframe.

Key Changes

  1. Human-Readable Log Messages:

    • The log messages now present the elapsed time since the last received message in a more readable format, displaying seconds up to 60 and then converting to minutes and seconds for longer durations.
    • Example: "Last message received 45.32 seconds ago" or "Last message received 2 minutes and 15.47 seconds ago."
  2. Inclusion of Timeout Duration in Logs:

    • The warning log now includes the timeout duration when the WebSocket connection check detects no data received within the specified timeout duration.
    • This provides clear context on the monitoring parameters and aids in troubleshooting and monitoring the system's performance.
    • Example: "No data received within timeout duration of 2 minutes. Last event received at 2024-07-02 09:08:57. Restarting connection."
  3. Periodic Connection Checks:

    • An info log message is added before each sleep cycle to indicate that a connection check is being performed.
    • This ensures visibility into the monitoring process and confirms that checks are happening at regular intervals.
    • Example: "Performing connection check. Last message received 45.32 seconds ago."

Business Impact

Example Log Messages

This update promptly detects and addresses any periods of inactivity during which no data is received, enhancing the system's robustness. Please review the changes and monitor the log outputs to ensure the updates function as expected.