A comprehensive, secure observability solution for Node.js and Python applications with real-time monitoring, performance metrics, and agent authentication.
- Real-time request monitoring with IP-based filtering and shared secret authentication
- Performance metrics and slow request tracking
- Detailed request/response logging with full context
- Snapshot functionality for state preservation and analysis
- Modern React dashboard with dark/light mode support
- Agent authentication with whitelist and shared secret validation
- IPv6/IPv4 compatibility for proper IP filtering
- Cross-platform support for Windows, Linux, and macOS
- Automatic URL detection for agent registration
- Agent management with deletion capabilities
# Start everything (Dashboard + Demo Apps)
./run-demo-apps.shThis will launch:
- Dashboard: http://localhost:3000
- Node.js Demo: http://localhost:3010
- Python Demo: http://localhost:3011
- Install Dependencies
# Dashboard (React + Node.js)
cd observability/dashboard
npm install
npm run build
# Python Demo
cd ../../demo-python-app
pip install -r requirements.txt
# Node.js Demo (already has dependencies)
cd ../demo-nodejs-app
npm install- Start Dashboard
cd observability/dashboard
node server.js- Start Demo Apps (in separate terminals)
# Terminal 1 - Node.js Demo
cd demo-nodejs-app
node server.js
# Terminal 2 - Python Demo
cd demo-python-app
python app.pyobservability-for-node-js/
├── README.md # This file
├── CONTRIBUTING.md # Contributing guidelines
├── LICENSE # MIT License
├── run-demo-apps.sh # Quick start script
├── demo-nodejs-app/ # Node.js demo application
│ ├── server.js
│ ├── utils/agent.js
│ └── package.json
├── demo-python-app/ # Python demo application
│ ├── app.py
│ ├── utils/agent.py
│ └── requirements.txt
└── observability/ # Core observability system
├── agent/ # Agent implementations
│ ├── agent.js # Node.js agent
│ ├── agent.py # Python agent
│ └── agent.php # PHP agent (coming soon)
└── dashboard/ # React dashboard
├── src/ # React source code
├── build/ # Built React app
├── database.js # SQLite database
├── setup.js # API routes
├── server.js # Dashboard server
└── package.json
Configure observability/dashboard/agent-whitelist.json:
{
"allowedAgents": [
{
"agentId": "demo-nodejs-app-agent",
"sharedSecret": "nodejs-demo-secret-key-9999",
"allowedSources": ["localhost", "127.0.0.1", "::1"],
"description": "Demo Node.js application"
},
{
"agentId": "demo-python-app-agent",
"sharedSecret": "python-demo-secret-key-9999",
"allowedSources": ["localhost", "127.0.0.1", "::1"],
"description": "Demo Python Flask application"
}
],
"defaultAllowedSources": ["localhost", "127.0.0.1", "::1"],
"strictMode": true,
"logBlockedRequests": true,
"requireSharedSecret": true
}const ObservabilityAgent = require('./utils/observability/agent');
const observabilityAgent = new ObservabilityAgent({
agentId: 'your-agent-id',
appName: 'Your App Name',
appPort: 3000,
sharedSecret: 'your-secret-key-here',
observabilityUrl: 'http://localhost:3000',
heartbeatInterval: 5000,
batchSize: 10,
flushInterval: 2000
});
app.use(observabilityAgent.middleware());from utils.agent import ObservabilityAgent
observability_agent = ObservabilityAgent({
'agentId': 'your-agent-id',
'appName': 'Your App Name',
'appPort': 3000,
'sharedSecret': 'your-secret-key-here',
'observabilityUrl': 'http://localhost:3000',
'heartbeatInterval': 5000,
'batchSize': 10,
'flushInterval': 2000
})
before_request, after_request = observability_agent.middleware()
app.before_request(before_request)
app.after_request(after_request)- Agent ID:
demo-nodejs-app-agent - Shared Secret:
nodejs-demo-secret-key-9999 - Test Endpoints:
GET /slow-endpoint- 1 second delayGET /request-421- Returns 421 statusGET /request-401- Returns 401 statusGET /get-something- Basic GET endpointPOST /post-something- Basic POST endpointPUT /put-something- Basic PUT endpointPATCH /patch-something- Basic PATCH endpointDELETE /delete-something- Basic DELETE endpoint
- Agent ID:
demo-python-app-agent - Shared Secret:
python-demo-secret-key-9999 - Same test endpoints as Node.js demo
- Request metrics and success/failure rates
- Response time tracking with interactive charts
- Agent status and heartbeat monitoring
- Automatic data refresh every 15 seconds
- Detailed logs of all monitored requests
- Filter by agent, status code, and time range
- Search functionality for specific endpoints
- Pagination for large datasets
- Identify slow endpoints and performance bottlenecks
- Configurable slow request thresholds
- Performance trends and patterns
- View all registered agents with URLs
- Monitor agent status and last heartbeat
- Delete agents from the system
- Automatic URL detection during registration
- Create point-in-time snapshots
- Export snapshot data as JSON
- Compare application states over time
POST /api/agents/register
Content-Type: application/json
{
"agentId": "your-agent-id",
"appName": "Your App Name",
"appPort": 3000,
"appUrl": "http://localhost:3000",
"sharedSecret": "your-secret-key-here"
}POST /api/agents/{agentId}/heartbeat
Content-Type: application/json
x-shared-secret: your-secret-key-here
{
"sharedSecret": "your-secret-key-here"
}POST /api/metrics
Content-Type: application/json
{
"agentId": "your-agent-id",
"sharedSecret": "your-secret-key-here",
"metrics": [
{
"data": {
"method": "GET",
"endpoint": "/api/users",
"statusCode": 200,
"duration": 150,
"timestamp": "2025-01-19T05:15:02.240Z",
"userAgent": "Mozilla/5.0...",
"ip": "127.0.0.1"
}
}
]
}GET /api/stats- Get current statistics and agent listGET /api/logs- Get paginated request logsGET /api/slow- Get slow requests (threshold: 500ms)DELETE /api/agents/{agentId}- Delete an agentPOST /api/snapshots- Create a new snapshotGET /api/snapshots- List all snapshotsGET /api/snapshots/:id- Get specific snapshotGET /api/snapshots/:id/export- Export snapshot as JSONDELETE /api/snapshots/:id- Delete a snapshot
- IP Whitelist: Only allow agents from specified IP addresses/domains
- Shared Secret: Require cryptographic secret for agent registration and communication
- Strict Mode: Configurable enforcement of authentication policies
- Audit Logging: Complete logging of all authentication attempts
- IPv6 Support: Automatic conversion of IPv6-mapped IPv4 addresses
- Flexible Sources: Support for localhost, domains, and wildcards
- Request Validation: Proper handling of edge cases and undefined URLs
- Node.js 14+
- React 18+
- SQLite3 (for agent storage)
- Express.js (for API server)
- Node.js: Express 4.x (optional, for automatic monitoring)
- Python: Flask 2.x
- No external database required
- Performance: Minimal impact on application performance (< 5% overhead)
- Reliability: Built-in error handling and automatic recovery
- Security: End-to-end encryption for agent communication and IP-based access control
- Privacy: All data stays within your infrastructure - no external data transmission
- Compatibility: IPv6/IPv4 dual-stack support for modern networks
- Persistence: Logs and snapshots are stored on local filesystem (no cloud backup)
- Scalability: Best suited for small to medium applications (high-traffic apps may need log rotation)
- High Availability: No built-in clustering (single dashboard instance)
Contributions are welcome! Please read our contributing guidelines before submitting pull requests.
- Fork the repository
- Create a feature branch
- Make your changes
- Test with the demo applications
- Submit a pull request
MIT License - see LICENSE file for details.
Anastasios Bolkas
- GitHub: @anastasios-b
- Portfolio: anastasios-bolkas.tech
- Issues: Report bugs and request features on GitHub Issues
- Documentation: Check this README and inline code comments
- Demo: Run
./run-demo-apps.shto see everything in action