-
Notifications
You must be signed in to change notification settings - Fork 4
feat(metrics): add peer_user field to connection status metrics #37
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: main
Are you sure you want to change the base?
Conversation
Add peer_user field to peer connection status metrics to track user associations. The field uses user_id if available, otherwise defaults to "unknown".
sample:
`netbird_peer_connection_status_by_name{connected="true",peer_id="d3jrlkb8ksqc73eashr0",peer_name="DESKTOP-HJKSFGJ",peer_user="jhon.doe"} 1`
🛡️ External PR Security Check - Approval Required
👥 For Maintainers - Action Required🔍 Before approving:
✅ To approve (choose one method): 🎯 Quick approval via comment (recommended): 📝 Alternative comment formats:
🏷️ Manual approval:
🧪 Test Status✅ Running without approval:
🔒 Awaiting approval:
🔐 Security Note: Only maintainers with write access can approve. This protects repository secrets from malicious code. |
🧪 External PR Test Workflow Status
|
| Test Category | Status | Details |
|---|---|---|
| Basic Tests | 🔄 Running | Unit tests, linting, Docker build |
| Integration Tests | 🔒 Requires Approval | Add 'approved-for-testing' label or comment '/approve' |
| Docker Compose | 🔒 Requires Approval | Add 'approved-for-testing' label or comment '/approve' |
| Helm Chart | 🔒 Requires Approval | Add 'approved-for-testing' label or comment '/approve' |
🔐 For Maintainers
To run the full test suite with secrets:
Option 1: Add the approved-for-testing label
Option 2: Comment one of these approval commands:
/approve/approve-testingapproved for testing
Security Note: Only approve PRs from trusted contributors after thorough code review.
✅ Basic Tests Complete
🔒 Integration Tests Still Require ApprovalFor a maintainer to run tests that require secrets, please:
|
|
/approved |
✅ Approved via CommentApproved by: @matanbaruch This external PR has been approved for testing with secrets. The full test suite will run automatically. Tests that will now run:
Future commits to this PR will automatically run the full test suite without requiring re-approval. |
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 adds a peer_user field to connection status metrics to track user associations with peers, using the user_id when available or "unknown" as a fallback. It also makes the API URL configurable in docker-compose.
- Adds
peer_userlabel to thenetbird_peer_connection_status_by_namemetric - Implements logic to populate the peer_user field with user_id or "unknown"
- Makes NETBIRD_API_URL configurable with default fallback in docker-compose
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/exporters/peers.go | Adds peer_user field to metrics with user_id handling |
| docker-compose.yml | Makes API URL configurable with environment variable |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
✅ Basic Tests Complete
|
🧪 External PR Test Workflow Status
|
✅ Basic Tests Complete
|
Description
Add peer_user field to peer connection status metrics to track user associations. The field uses user_id if available, otherwise defaults to "unknown". sample:
netbird_peer_connection_status_by_name{connected="true",peer_id="d3jrlkb8ksqc73eashr0",peer_name="DESKTOP-HJKSFGJ",peer_user="jhon.doe"} 1