@stacksleuth/backend-agent
Version:
Comprehensive backend performance monitoring agent for Node.js applications - HTTP request tracing, database query optimization, memory profiling, and real-time metrics collection with WebSocket integration.
99 lines (68 loc) • 3.23 kB
Markdown
# @stacksleuth/backend-agent
<div align="center">

**StackSleuth Backend Agent**
[](https://badge.fury.io/js/%40stacksleuth%2Fbackend-agent)
[](https://opensource.org/licenses/MIT)
[](https://www.typescriptlang.org/)
[](https://nodejs.org/)
</div>
## 🚀 What is StackSleuth Backend Agent?
Comprehensive backend performance monitoring agent for Node.js applications - HTTP request tracing, database query optimization, memory profiling, and real-time metrics collection with WebSocket integration.
## ✨ Key Features
- 🚀 **HTTP Request Monitoring**: Automatic request/response tracking
- 📊 **Database Query Optimization**: Real-time query performance analysis
- 💾 **Memory Profiling**: Advanced memory leak detection and optimization
- 🔄 **Real-time Metrics**: Live performance data with WebSocket integration
- 🎯 **Custom Middleware**: Easy integration with existing applications
- 📈 **Performance Analytics**: Comprehensive performance data collection
- 🔧 **Framework Agnostic**: Works with Express, Koa, Fastify, and more
- ⚡ **Production Ready**: Minimal overhead, battle-tested implementation
## 📦 Installation
```bash
npm install @stacksleuth/backend-agent
```
```bash
yarn add @stacksleuth/backend-agent
```
```bash
pnpm add @stacksleuth/backend-agent
```
## 🏁 Quick Start
```typescript
import express from 'express';
import { BackendAgent } from '@stacksleuth/backend-agent';
const app = express();
const agent = new BackendAgent({
enabled: true,
sampleRate: 0.1
});
// Start monitoring
agent.startMonitoring();
// Middleware integration
app.use(agent.middleware());
app.get('/api/users', async (req, res) => {
// Your route logic
const users = await User.find();
res.json(users);
});
app.listen(3000, () => {
console.log('Server running with StackSleuth monitoring');
});
```
## 📚 Resources
- **[Official Documentation](https://github.com/Jack-GitHub12/StackSleuth#readme)**
- **[API Reference](https://github.com/Jack-GitHub12/StackSleuth/blob/main/docs/backend-agent.md)**
- **[Examples Repository](https://github.com/Jack-GitHub12/StackSleuth/tree/main/examples/backend-agent)**
## 🤝 Contributing
We welcome contributions! Please see our [Contributing Guide](https://github.com/Jack-GitHub12/StackSleuth/blob/main/CONTRIBUTING.md) for details.
## 📄 License
MIT License - see the [LICENSE](https://github.com/Jack-GitHub12/StackSleuth/blob/main/LICENSE) file for details.
---
<div align="center">
**[Website](https://github.com/Jack-GitHub12/StackSleuth)** •
**[Documentation](https://github.com/Jack-GitHub12/StackSleuth#readme)** •
**[NPM Registry](https://www.npmjs.com/package/@stacksleuth/backend-agent)** •
**[GitHub](https://github.com/Jack-GitHub12/StackSleuth)**
Made with ⚡ by [StackSleuth](https://github.com/Jack-GitHub12/StackSleuth)
</div>