-
Notifications
You must be signed in to change notification settings - Fork 1
Feature nip11 monitoring #570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements NIP-11 monitoring functionality that tracks database health and exposes system status through the NIP-11 information endpoint. The implementation adds comprehensive status tracking with a finite state machine (FSM) to monitor database read/write operations and detect error conditions.
Changes:
- Added database status tracking with FSM-based error detection (consecutive operation threshold: 3 failures within 60 seconds)
- Implemented periodic database health checks that write and read test events to verify functionality
- Integrated status reporting into the NIP-11 HTTP handler to expose system health via the relay information document
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
database/query/status.go |
New file implementing status tracking FSM and worker goroutine for monitoring database operations |
database/query/status_test.go |
Comprehensive tests for FSM state transitions and status tracker functionality |
database/query/query.go |
Integration of status tracking hooks for read/write operations |
database/query/global.go |
Global initialization of status tracker alongside database client |
database/query/client.go |
Added operation reporter callback for status tracking |
server/http/nip11/system_status.go |
New file implementing system status collection and periodic database health checks |
server/http/nip11/nip11.go |
Refactored to include system status in NIP-11 response and use streaming JSON encoding |
server/http/nip11/nip11_test.go |
Tests for system status collector behavior using synctest for deterministic time control |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
abf3afe to
2bbccc5
Compare
2bbccc5 to
89c169b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 18 out of 19 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.