neo
neo copied to clipboard
[Telemetry 1/4] Add telemetry hooks to Neo core
Summary
This PR adds static event hooks to the Neo core P2P layer to enable telemetry collection without modifying the core behavior.
Changes
- Add
MessageSentevent toRemoteNodefor tracking outgoing messages - Add
ConnectionChangedevent 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:
- [This PR] Core hooks - Add event hooks to Neo core
- Plugin + Collectors - Main telemetry plugin and metric collectors
- Health endpoints - Kubernetes-compatible health check endpoints
- Documentation - README and monitoring configurations
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.