neo icon indicating copy to clipboard operation
neo copied to clipboard

[Telemetry 1/4] Add telemetry hooks to Neo core

Open Jim8y opened this issue 3 months ago • 1 comments

Summary

This PR adds static event hooks to the Neo core P2P layer to enable telemetry collection without modifying the core behavior.

Changes

  • Add MessageSent event to RemoteNode for tracking outgoing messages
  • Add ConnectionChanged event for monitoring peer connection lifecycle
  • Wrap event invocations in try-catch to prevent telemetry failures from crashing the node

Files Changed

  • src/Neo/Network/P2P/RemoteNode.cs

Test Plan

  • [x] Build passes
  • [x] Existing unit tests pass
  • [x] Event handlers with exceptions don't crash the node

Part of Telemetry Feature

This is PR 1 of 4 for adding comprehensive telemetry support to Neo nodes:

  1. [This PR] Core hooks - Add event hooks to Neo core
  2. Plugin + Collectors - Main telemetry plugin and metric collectors
  3. Health endpoints - Kubernetes-compatible health check endpoints
  4. Documentation - README and monitoring configurations

Jim8y avatar Dec 12 '25 01:12 Jim8y

As is suggested and requested from @shargon and @vncoelho , telemetry is split into 4 prs. These prs will not be merged into master directly, but will go to telemetry first.

Jim8y avatar Dec 12 '25 01:12 Jim8y