{"_id":"@ahmedhegazee/nestjs-telescope","name":"@ahmedhegazee/nestjs-telescope","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@ahmedhegazee/nestjs-telescope","version":"1.0.0","description":"Advanced observability and monitoring solution for NestJS applications with ML-powered analytics, enterprise features, and production-ready scaling","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc -p tsconfig.build.json","build:prod":"tsc --project tsconfig.prod.json","test":"jest --passWithNoTests","test:watch":"jest --watch","test:cov":"jest --coverage --passWithNoTests","test:debug":"node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand","test:e2e":"jest --config ./test/jest-e2e.json --passWithNoTests","test:performance":"ts-node test/week10-performance-load-test.ts","test:integration":"ts-node test/week9-integration.e2e-spec.ts","lint":"eslint \"{src,apps,libs,test}/**/*.ts\" --fix","format":"prettier --write \"src/**/*.ts\" \"test/**/*.ts\"","prepare":"npm run build","prepublishOnly":"npm run build","start":"node dist/main.js","start:dev":"ts-node src/main.ts","start:debug":"node --inspect-brk -r ts-node/register src/main.ts","start:prod":"node dist/main.js","migrate":"ts-node scripts/migrate.ts","seed":"ts-node scripts/seed.ts","docker:build":"docker build -t nestjs-telescope .","docker:run":"docker run -p 3000:3000 nestjs-telescope","docker:compose":"docker-compose up -d","k8s:deploy":"kubectl apply -f k8s/","k8s:delete":"kubectl delete -f k8s/","benchmark":"ts-node test/week9-performance.benchmark.ts","security:audit":"ts-node scripts/security-audit.ts","compliance:check":"ts-node scripts/compliance-check.ts","docs:generate":"typedoc --out docs src/","docs:serve":"http-server docs -p 8080","examples:run":"ts-node examples/week12-examples.ts","release:patch":"npm version patch && npm publish","release:minor":"npm version minor && npm publish","release:major":"npm version major && npm publish"},"keywords":["nestjs","telescope","observability","monitoring","analytics","ml","machine-learning","performance","debugging","enterprise","multi-tenant","scaling","production","typescript","nodejs"],"author":{"name":"Ahmed Hegazy","email":"ahmedhegazy@example.com","url":"https://github.com/ahmedhegazee"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ahmedhegazee/nestjs-telescope.git"},"bugs":{"url":"https://github.com/ahmedhegazee/nestjs-telescope/issues"},"homepage":"https://github.com/ahmedhegazee/nestjs-telescope","dependencies":{"@nestjs/common":"^10.0.0","@nestjs/config":"^3.0.0","@nestjs/core":"^10.0.0","@nestjs/event-emitter":"^2.0.0","@nestjs/platform-express":"^10.0.0","class-transformer":"^0.5.1","class-validator":"^0.14.0","clone-deep":"^4.0.1","deepmerge":"^4.3.1","dotenv":"^16.3.1","fast-deep-equal":"^3.1.3","lodash":"^4.17.21","nanoid":"^5.0.4","reflect-metadata":"^0.1.13","rxjs":"^7.8.1","uuid":"^9.0.1"},"devDependencies":{"@nestjs/cli":"^10.0.0","@nestjs/schematics":"^10.0.0","@nestjs/testing":"^10.0.0","@types/bcryptjs":"^2.4.6","@types/compression":"^1.7.5","@types/cors":"^2.8.17","@types/express":"^4.17.23","@types/ip":"^1.1.0","@types/jest":"^29.5.8","@types/jsonwebtoken":"^9.0.5","@types/lodash":"^4.14.202","@types/multer":"^1.4.11","@types/node":"^20.10.0","@types/nodemailer":"^6.4.14","@types/passport":"^1.0.16","@types/passport-jwt":"^3.0.13","@types/passport-oauth2":"^1.4.14","@types/supertest":"^2.0.16","@types/uuid":"^9.0.7","@typescript-eslint/eslint-plugin":"^6.13.0","@typescript-eslint/parser":"^6.13.0","concurrently":"^8.2.2","cross-env":"^7.0.3","eslint":"^8.54.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.1","http-server":"^14.1.1","jest":"^29.7.0","prettier":"^3.1.0","rimraf":"^5.0.5","supertest":"^6.3.3","ts-jest":"^29.1.1","ts-node":"^10.9.1","tsconfig-paths":"^4.1.0","typedoc":"^0.25.7","typescript":"^5.3.2","wait-on":"^7.2.0"},"engines":{"node":">=18.0.0","npm":">=8.0.0"},"peerDependencies":{"@nestjs/common":"^10.0.0","@nestjs/core":"^10.0.0","rxjs":"^7.8.1"},"optionalDependencies":{"@nestjs/bull":"^10.0.0","@nestjs/schedule":"^4.0.0","@nestjs/swagger":"^7.0.0","@nestjs/terminus":"^10.0.0","@nestjs/typeorm":"^10.0.0","@slack/web-api":"^6.10.0","ajv":"^8.12.0","bcryptjs":"^2.4.3","bull":"^4.12.0","cheerio":"^1.0.0-rc.12","compression":"^1.7.4","config":"^3.3.10","cors":"^2.8.5","csv-parser":"^3.0.0","discord.js":"^14.14.1","exceljs":"^4.4.0","express-rate-limit":"^7.1.5","express-slow-down":"^2.0.1","helmet":"^7.1.0","ip":"^1.1.8","is-empty":"^1.2.0","joi":"^17.11.0","jsonwebtoken":"^9.0.2","multer":"^1.4.5-lts.1","mysql2":"^3.6.5","nodemailer":"^6.9.7","passport":"^0.7.0","passport-jwt":"^4.0.1","passport-oauth2":"^1.7.0","pdf-lib":"^1.17.1","pg":"^8.11.3","pino":"^8.17.2","prom-client":"^15.0.0","puppeteer":"^21.6.1","redis":"^4.6.10","semver":"^7.5.4","sharp":"^0.33.0","socket.io":"^4.7.4","sqlite3":"^5.1.6","telegraf":"^4.15.6","twilio":"^4.19.0","typeorm":"^0.3.17","winston":"^3.11.0","ws":"^8.14.2","yup":"^1.3.3","zod":"^3.22.4"},"peerDependenciesMeta":{"@nestjs/common":{"optional":false},"@nestjs/core":{"optional":false},"rxjs":{"optional":false}},"prettier":{"singleQuote":true,"trailingComma":"all","printWidth":100,"tabWidth":2,"semi":true},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"npm test"}},"lint-staged":{"*.ts":["eslint --fix","prettier --write"]},"publishConfig":{"access":"public"},"funding":{"type":"github","url":"https://github.com/ahmedhegazee"},"_id":"@ahmedhegazee/nestjs-telescope@1.0.0","gitHead":"b8b65004ef7df1cbbccb11d81f66e52cda7ad179","_nodeVersion":"23.11.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-NYanU5deeF+nk1BOq6gYu5uUJIz2VdxqdreE61Y218exgx4W/I9cyprB8ZLN5hLeloU4BR+YXWjFk3nMt0wkQQ==","shasum":"267ab55a4686d43195869853266f7dbc73ad3b01","tarball":"https://registry.npmjs.org/@ahmedhegazee/nestjs-telescope/-/nestjs-telescope-1.0.0.tgz","fileCount":366,"unpackedSize":3437880,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDx+Y9kdONZQCRhe3wCcodSElhnB9fzIo0KY/3gOkVeaAIgM/nhMRC9Rfj7+KQnq2kWnfZM6GjCboQ7vXZgOJ5gHLM="}]},"_npmUser":{"name":"ahmedhegazee","email":"devahmedhegazee@gmail.com"},"directories":{},"maintainers":[{"name":"ahmedhegazee","email":"devahmedhegazee@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nestjs-telescope_1.0.0_1753880243029_0.06952710097496162"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-30T12:57:22.921Z","1.0.0":"2025-07-30T12:57:23.287Z","modified":"2025-07-30T12:57:23.585Z"},"maintainers":[{"name":"ahmedhegazee","email":"devahmedhegazee@gmail.com"}],"description":"Advanced observability and monitoring solution for NestJS applications with ML-powered analytics, enterprise features, and production-ready scaling","homepage":"https://github.com/ahmedhegazee/nestjs-telescope","keywords":["nestjs","telescope","observability","monitoring","analytics","ml","machine-learning","performance","debugging","enterprise","multi-tenant","scaling","production","typescript","nodejs"],"repository":{"type":"git","url":"git+https://github.com/ahmedhegazee/nestjs-telescope.git"},"author":{"name":"Ahmed Hegazy","email":"ahmedhegazy@example.com","url":"https://github.com/ahmedhegazee"},"bugs":{"url":"https://github.com/ahmedhegazee/nestjs-telescope/issues"},"license":"MIT","readme":"# 🚀 NestJS Telescope v1.0.0\n\n**Advanced observability and monitoring solution for NestJS applications with ML-powered analytics, **enterprise** features, and production-ready scaling.**\n\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![Build Status][build-image]][build-url]\n[![Coverage Status][coverage-image]][coverage-url]\n[![License][license-image]][license-url]\n\n## ✨ Features\n\n### 🔍 **Core Monitoring**\n- **Request Watcher**: HTTP request/response monitoring with performance metrics\n- **Query Watcher**: Database query analysis with optimization suggestions\n- **Exception Watcher**: Comprehensive error tracking with stack trace analysis\n- **Job Watcher**: Background job monitoring with Bull/BullMQ integration\n- **Cache Watcher**: Redis/Memory cache performance monitoring\n\n### 🤖 **ML-Powered Analytics**\n- **Anomaly Detection**: Statistical algorithms for detecting unusual patterns\n- **Performance Regression**: Trend analysis and degradation detection\n- **Query Optimization**: ML-based database optimization suggestions\n- **Predictive Insights**: Forecasting performance and resource usage\n- **Automated Alerting**: Intelligent alert generation and management\n\n### 🏢 **Enterprise Features**\n- **Multi-Tenant Support**: Complete tenant isolation and resource management\n- **Advanced Security**: SSO, OAuth2, SAML, LDAP integration\n- **Role-Based Access Control**: Granular permissions and policies\n- **Compliance**: GDPR, SOX, HIPAA, PCI compliance monitoring\n- **Custom Branding**: White-label capabilities and theme customization\n\n### ⚡ **Production Ready**\n- **Horizontal Scaling**: Distributed deployment with load balancing\n- **Advanced Caching**: Multi-tier caching with intelligent eviction\n- **Database Optimization**: Query optimization and indexing strategies\n- **Memory Management**: Garbage collection and leak detection\n- **Performance Benchmarking**: Comprehensive load testing suite\n\n### 🔧 **Developer Experience**\n- **TypeScript First**: Full type safety and IntelliSense support\n- **Comprehensive Testing**: Unit, integration, and performance tests\n- **Rich Documentation**: API docs, examples, and migration guides\n- **Easy Integration**: Simple setup with minimal configuration\n- **Extensible Architecture**: Plugin-based watcher system\n\n## 📦 Installation\n\n### Prerequisites\n\n- Node.js >= 18.0.0\n- npm >= 8.0.0\n- NestJS >= 10.0.0\n\n### Install the Package\n\n```bash\nnpm install ahmedhegazee/nestjs-telescope\n```\n\n### Install Optional Dependencies\n\nFor full functionality, install these optional dependencies:\n\n```bash\n# Database support\nnpm install @nestjs/typeorm typeorm pg mysql2 sqlite3\n\n# Job queue support\nnpm install @nestjs/bull bull\n\n# Cache support\nnpm install redis\n\n# Security features\nnpm install bcryptjs jsonwebtoken passport passport-jwt passport-oauth2\n\n# Email notifications\nnpm install nodemailer\n\n# Slack notifications\nnpm install @slack/web-api\n\n# PDF generation\nnpm install pdf-lib puppeteer\n\n# Excel export\nnpm install exceljs\n\n# Compression\nnpm install compression\n\n# Rate limiting\nnpm install express-rate-limit express-slow-down\n\n# Security headers\nnpm install helmet cors\n```\n\n## 🚀 Quick Start\n\n### 1. Basic Setup\n\n```typescript\nimport { Module } from '@nestjs/common';\nimport { TelescopeModule } from 'ahmedhegazee/nestjs-telescope';\n\n@Module({\n  imports: [\n    TelescopeModule.forRoot({\n      enabled: true,\n      storage: {\n        driver: 'file',\n        path: './telescope-storage'\n      },\n      watchers: {\n        request: true,\n        query: true,\n        exception: true,\n        job: true,\n        cache: true\n      }\n    })\n  ]\n})\nexport class AppModule {}\n```\n\n### 2. Advanced Configuration\n\n```typescript\nimport { Module } from '@nestjs/common';\nimport { TelescopeModule } from 'ahmedhegazee/nestjs-telescope';\n\n@Module({\n  imports: [\n    TelescopeModule.forRoot({\n      enabled: true,\n      \n      // Storage Configuration\n      storage: {\n        driver: 'database',\n        database: {\n          type: 'postgresql',\n          host: 'localhost',\n          port: 5432,\n          database: 'telescope',\n          username: 'user',\n          password: 'password'\n        },\n        retention: {\n          hours: 24,\n          maxEntries: 10000\n        }\n      },\n\n      // Watchers Configuration\n      watchers: {\n        request: {\n          enabled: true,\n          sampling: 100, // 100% sampling\n          maskSensitiveData: true,\n          excludePaths: ['/health', '/metrics'],\n          logSuccessfulResponseBodies: false\n        },\n        query: {\n          enabled: true,\n          slowQueryThreshold: 1000, // 1 second\n          connectionPoolMonitoring: true,\n          enableQueryAnalysis: true\n        },\n        exception: {\n          enabled: true,\n          grouping: true,\n          stackTraceAnalysis: true,\n          enableSourceMaps: true,\n          maxStackTraceDepth: 10\n        },\n        job: {\n          enabled: true,\n          queueMonitoring: true,\n          performanceTracking: true,\n          enableJobHistory: true\n        },\n        cache: {\n          enabled: true,\n          hitRatioTracking: true,\n          memoryUsageMonitoring: true,\n          enableCacheAnalysis: true\n        }\n      },\n\n      // ML Analytics Configuration\n      mlAnalytics: {\n        enabled: true,\n        anomalyDetection: true,\n        performanceRegression: true,\n        queryOptimization: true,\n        predictiveInsights: true,\n        dataRetention: 30 // days\n      },\n\n      // Alerting Configuration\n      alerting: {\n        enabled: true,\n        channels: {\n          email: {\n            enabled: true,\n            smtp: {\n              host: 'smtp.gmail.com',\n              port: 587,\n              secure: false,\n              auth: {\n                user: 'your-email@gmail.com',\n                pass: 'your-password'\n              }\n            }\n          },\n          slack: {\n            enabled: true,\n            webhookUrl: 'https://hooks.slack.com/services/YOUR/WEBHOOK/URL'\n          }\n        }\n      },\n\n      // Enterprise Features\n      enterpriseSecurity: {\n        enabled: true,\n        authentication: {\n          enabled: true,\n          methods: ['jwt', 'oauth2']\n        },\n        authorization: {\n          enabled: true,\n          rbac: true,\n          abac: true\n        }\n      },\n\n      multiTenant: {\n        enabled: true,\n        isolation: {\n          strategy: 'database',\n          databasePrefix: 'telescope_'\n        }\n      },\n\n      // DevTools Integration\n      devtools: {\n        enabled: true,\n        port: 3001,\n        features: {\n          dependencyGraph: true,\n          interactivePlayground: true,\n          performanceMetrics: true\n        }\n      }\n    })\n  ]\n})\nexport class AppModule {}\n```\n\n### 3. Environment Variables\n\nCreate a `.env` file in your project root:\n\n```env\n# Telescope Configuration\nTELESCOPE_ENABLED=true\nTELESCOPE_STORAGE_DRIVER=database\nTELESCOPE_STORAGE_DATABASE_URL=postgresql://user:pass@localhost:5432/telescope\n\n# Security\nJWT_SECRET=your-super-secret-jwt-key\nJWT_EXPIRES_IN=1h\n\n# Email Configuration\nSMTP_HOST=smtp.gmail.com\nSMTP_PORT=587\nSMTP_USER=your-email@gmail.com\nSMTP_PASS=your-app-password\n\n# Slack Configuration\nSLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK/URL\n\n# Redis Configuration\nREDIS_URL=redis://localhost:6379\n\n# Database Configuration\nDATABASE_URL=postgresql://user:pass@localhost:5432/telescope\n```\n\n## 📊 Dashboard\n\nAccess the Telescope dashboard at `http://localhost:3000/telescope` to view:\n\n- **Real-time Metrics**: Live performance and error monitoring\n- **Analytics Dashboard**: ML-powered insights and trends\n- **Query Analysis**: Database performance and optimization suggestions\n- **Job Monitoring**: Background job status and performance\n- **Cache Analytics**: Hit ratios and memory usage\n- **Security Audit**: Compliance and security monitoring\n\n## 🔧 API Reference\n\n### Core Services\n\n#### TelescopeService\n```typescript\nimport { TelescopeService } from 'ahmedhegazee/nestjs-telescope';\n\n@Injectable()\nexport class MyService {\n  constructor(private telescopeService: TelescopeService) {}\n\n  async recordEntry(entry: TelescopeEntry) {\n    await this.telescopeService.record(entry);\n  }\n\n  async findEntries(filter: TelescopeFilter) {\n    return await this.telescopeService.find(filter);\n  }\n\n  async getMetrics() {\n    return await this.telescopeService.getMetrics();\n  }\n}\n```\n\n#### MLAnalyticsService\n```typescript\nimport { MLAnalyticsService } from 'ahmedhegazee/nestjs-telescope';\n\n@Injectable()\nexport class AnalyticsService {\n  constructor(private mlAnalytics: MLAnalyticsService) {}\n\n  async getAnomalies() {\n    return await this.mlAnalytics.getAnomalies();\n  }\n\n  async getPredictiveInsights() {\n    return await this.mlAnalytics.getPredictiveInsights();\n  }\n\n  async getQueryOptimizations() {\n    return await this.mlAnalytics.getQueryOptimizations();\n  }\n}\n```\n\n#### AutomatedAlertingService\n```typescript\nimport { AutomatedAlertingService } from 'ahmedhegazee/nestjs-telescope';\n\n@Injectable()\nexport class AlertService {\n  constructor(private alerting: AutomatedAlertingService) {}\n\n  async createAlert(alert: AlertRule) {\n    return await this.alerting.createAlert(alert);\n  }\n\n  async getAlertHistory() {\n    return await this.alerting.getAlertHistory();\n  }\n}\n```\n\n### Controllers\n\n#### Health Controller\n```typescript\nGET /telescope/health\nGET /telescope/health/detailed\nGET /telescope/health/metrics\n```\n\n#### Analytics Controller\n```typescript\nGET /telescope/analytics/anomalies\nGET /telescope/analytics/predictions\nGET /telescope/analytics/optimizations\nPOST /telescope/analytics/query\n```\n\n#### Alerting Controller\n```typescript\nGET /telescope/alerts\nPOST /telescope/alerts\nPUT /telescope/alerts/:id\nDELETE /telescope/alerts/:id\n```\n\n## 🏢 Enterprise Features\n\n### Multi-Tenant Support\n\n```typescript\nimport { MultiTenantService } from 'ahmedhegazee/nestjs-telescope';\n\n@Injectable()\nexport class TenantService {\n  constructor(private multiTenantService: MultiTenantService) {}\n\n  async createTenant() {\n    // Tenant provisioning\n    const tenant = await this.multiTenantService.provisionTenant({\n      name: 'Acme Corp',\n      slug: 'acme-corp',\n      plan: 'enterprise',\n      metadata: {\n        industry: 'technology',\n        size: 'enterprise'\n      }\n    });\n\n    // Tenant-specific configuration\n    await this.multiTenantService.updateTenantConfiguration(tenant.id, {\n      features: {\n        mlAnalytics: true,\n        alerting: true\n      },\n      settings: {\n        dataRetention: 365,\n        samplingRate: 100\n      }\n    });\n\n    return tenant;\n  }\n}\n```\n\n### Advanced Security\n\n```typescript\nimport { EnterpriseSecurityService } from 'ahmedhegazee/nestjs-telescope';\n\n@Injectable()\nexport class SecurityService {\n  constructor(private securityService: EnterpriseSecurityService) {}\n\n  async authenticate() {\n    // Authentication\n    const authResult = await this.securityService.authenticate({\n      method: 'oauth2',\n      code: 'authorization_code'\n    });\n\n    return authResult;\n  }\n\n  async authorize(userId: string, action: string, resource: string) {\n    // Authorization\n    const authzResult = await this.securityService.authorize(\n      userId,\n      action,\n      resource,\n      { ipAddress: '192.168.1.1' }\n    );\n\n    return authzResult;\n  }\n\n  async getComplianceReport() {\n    // Compliance monitoring\n    const compliance = await this.securityService.generateComplianceReport();\n    return compliance;\n  }\n}\n```\n\n### Custom Branding\n\n```typescript\nimport { MultiTenantService } from 'ahmedhegazee/nestjs-telescope';\n\n@Injectable()\nexport class BrandingService {\n  constructor(private multiTenantService: MultiTenantService) {}\n\n  async updateBranding(tenantId: string) {\n    await this.multiTenantService.updateTenantBranding(tenantId, {\n      logo: 'https://example.com/logo.png',\n      primaryColor: '#007bff',\n      secondaryColor: '#6c757d',\n      companyName: 'Acme Corporation',\n      theme: 'dark'\n    });\n  }\n}\n```\n\n## ⚡ Performance & Scaling\n\n### Horizontal Scaling\n\n```typescript\nimport { HorizontalScalingService } from 'ahmedhegazee/nestjs-telescope';\n\n@Injectable()\nexport class ScalingService {\n  constructor(private scalingService: HorizontalScalingService) {}\n\n  async configureScaling() {\n    // Enable horizontal scaling\n    const scalingConfig = {\n      enabled: true,\n      clusterMode: true,\n      discovery: {\n        method: 'redis',\n        interval: 30000\n      },\n      loadBalancing: {\n        strategy: 'least-loaded',\n        healthCheckInterval: 10000\n      }\n    };\n\n    return scalingConfig;\n  }\n}\n```\n\n### Advanced Caching\n\n```typescript\nimport { AdvancedCachingService } from 'ahmedhegazee/nestjs-telescope';\n\n@Injectable()\nexport class CacheService {\n  constructor(private cacheService: AdvancedCachingService) {}\n\n  async configureCaching() {\n    // Multi-tier caching\n    const cacheConfig = {\n      tiers: {\n        l1: { type: 'memory', maxSize: 100, ttl: 300000 },\n        l2: { type: 'redis', ttl: 3600000 },\n        l3: { type: 'database', ttl: 86400000 }\n      },\n      strategies: {\n        writePolicy: 'write-through',\n        readPolicy: 'read-through',\n        evictionPolicy: 'lru'\n      }\n    };\n\n    return cacheConfig;\n  }\n}\n```\n\n### Database Optimization\n\n```typescript\nimport { DatabaseOptimizerService } from 'ahmedhegazee/nestjs-telescope';\n\n@Injectable()\nexport class DatabaseService {\n  constructor(private dbOptimizer: DatabaseOptimizerService) {}\n\n  async optimizeQuery(query: string) {\n    // Query optimization\n    const optimization = await this.dbOptimizer.optimizeQuery(query);\n    return optimization;\n  }\n\n  async getIndexSuggestions() {\n    // Index suggestions\n    const suggestions = await this.dbOptimizer.getIndexSuggestions();\n    return suggestions;\n  }\n}\n```\n\n## 🧪 Testing\n\n### Unit Tests\n```bash\nnpm test\n```\n\n### Integration Tests\n```bash\nnpm run test:e2e\n```\n\n### Performance Tests\n```bash\nnpm run test:performance\n```\n\n### Load Testing\n```bash\nnpm run benchmark\n```\n\n## 🚀 Deployment\n\n### Docker\n\n```dockerfile\nFROM node:18-alpine\n\nWORKDIR /app\n\nCOPY package*.json ./\nRUN npm ci --only=production\n\nCOPY dist ./dist\nCOPY node_modules ./node_modules\n\nEXPOSE 3000\n\nCMD [\"node\", \"dist/main.js\"]\n```\n\n```bash\n# Build and run\ndocker build -t nestjs-telescope .\ndocker run -p 3000:3000 nestjs-telescope\n```\n\n### Docker Compose\n\n```yaml\nversion: '3.8'\n\nservices:\n  telescope:\n    build: .\n    ports:\n      - \"3000:3000\"\n    environment:\n      - NODE_ENV=production\n      - DATABASE_URL=postgresql://user:pass@postgres:5432/telescope\n      - REDIS_URL=redis://redis:6379\n    depends_on:\n      - postgres\n      - redis\n\n  postgres:\n    image: postgres:15\n    environment:\n      POSTGRES_DB: telescope\n      POSTGRES_USER: user\n      POSTGRES_PASSWORD: pass\n    volumes:\n      - postgres_data:/var/lib/postgresql/data\n\n  redis:\n    image: redis:7-alpine\n    volumes:\n      - redis_data:/data\n\nvolumes:\n  postgres_data:\n  redis_data:\n```\n\n### Kubernetes\n\n```yaml\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: telescope\nspec:\n  replicas: 3\n  selector:\n    matchLabels:\n      app: telescope\n  template:\n    metadata:\n      labels:\n        app: telescope\n    spec:\n      containers:\n      - name: telescope\n        image: nestjs/telescope:latest\n        ports:\n        - containerPort: 3000\n        env:\n        - name: NODE_ENV\n          value: \"production\"\n        - name: DATABASE_URL\n          valueFrom:\n            secretKeyRef:\n              name: telescope-secrets\n              key: database-url\n        resources:\n          requests:\n            memory: \"256Mi\"\n            cpu: \"250m\"\n          limits:\n            memory: \"512Mi\"\n            cpu: \"500m\"\n```\n\n## 📈 Monitoring & Observability\n\n### Metrics\n\nTelescope exposes Prometheus metrics at `/telescope/metrics`:\n\n```typescript\n// Custom metrics\nconst metrics = {\n  requests_total: 1000,\n  requests_duration_seconds: 0.5,\n  errors_total: 10,\n  cache_hit_ratio: 0.85,\n  database_connections: 5\n};\n```\n\n### Health Checks\n\n```typescript\n// Health check endpoints\nGET /telescope/health\nGET /telescope/health/ready\nGET /telescope/health/live\n```\n\n### Logging\n\n```typescript\n// Structured logging\nthis.logger.log('Request processed', {\n  userId: '123',\n  duration: 150,\n  status: 'success',\n  metadata: { endpoint: '/api/users' }\n});\n```\n\n## 🔒 Security\n\n### Authentication\n\n```typescript\n// JWT Authentication\nconst token = jwt.sign(\n  { userId: '123', roles: ['admin'] },\n  process.env.JWT_SECRET,\n  { expiresIn: '1h' }\n);\n\n// OAuth2 Integration\nconst oauthConfig = {\n  providers: {\n    google: {\n      clientId: process.env.GOOGLE_CLIENT_ID,\n      clientSecret: process.env.GOOGLE_CLIENT_SECRET\n    }\n  }\n};\n```\n\n### Authorization\n\n```typescript\n// Role-based access control\n@Roles('admin')\n@Permissions('telescope:read', 'telescope:write')\nexport class TelescopeController {\n  // Controller methods\n}\n\n// Policy-based authorization\nconst policy = {\n  id: 'admin-access',\n  type: 'allow',\n  resources: ['telescope:*'],\n  actions: ['*'],\n  conditions: [\n    { field: 'roles', operator: 'contains', value: 'admin' }\n  ]\n};\n```\n\n### Data Protection\n\n```typescript\n// Data encryption\nconst encrypted = await securityService.encrypt(sensitiveData);\nconst decrypted = await securityService.decrypt(encrypted);\n\n// Data masking\nconst maskedData = {\n  email: 'u***@e***.com',\n  phone: '+1-***-***-1234',\n  ssn: '***-**-1234'\n};\n```\n\n## 📚 Examples\n\n### Basic Monitoring\n\n```typescript\nimport { Controller, Get } from '@nestjs/common';\nimport { TelescopeService } from 'ahmedhegazee/nestjs-telescope';\n\n@Controller('users')\nexport class UsersController {\n  constructor(private telescopeService: TelescopeService) {}\n\n  @Get()\n  async getUsers() {\n    // Telescope automatically monitors this request\n    return await this.userService.findAll();\n  }\n}\n```\n\n### Custom Watcher\n\n```typescript\nimport { Injectable } from '@nestjs/common';\nimport { Watcher, TelescopeEntry } from 'ahmedhegazee/nestjs-telescope';\n\n@Injectable()\nexport class CustomWatcher implements Watcher {\n  async process(entry: TelescopeEntry): Promise<void> {\n    // Custom processing logic\n    console.log('Custom watcher processed:', entry);\n  }\n}\n```\n\n### ML Analytics Integration\n\n```typescript\nimport { Injectable } from '@nestjs/common';\nimport { MLAnalyticsService } from 'ahmedhegazee/nestjs-telescope';\n\n@Injectable()\nexport class AnalyticsService {\n  constructor(private mlAnalytics: MLAnalyticsService) {}\n\n  async analyzePerformance() {\n    const anomalies = await this.mlAnalytics.getAnomalies();\n    const predictions = await this.mlAnalytics.getPredictiveInsights();\n    \n    return { anomalies, predictions };\n  }\n}\n```\n\n### Alerting\n\n```typescript\nimport { Injectable } from '@nestjs/common';\nimport { AutomatedAlertingService } from 'ahmedhegazee/nestjs-telescope';\n\n@Injectable()\nexport class AlertService {\n  constructor(private alerting: AutomatedAlertingService) {}\n\n  async setupAlerts() {\n    await this.alerting.createAlert({\n      name: 'High Error Rate',\n      condition: 'error_rate > 0.05',\n      channels: ['email', 'slack'],\n      severity: 'high'\n    });\n  }\n}\n```\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n### Development Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/ahmedhegazee/nestjs-telescope.git\ncd nestjs-telescope\n\n# Install dependencies\nnpm install\n\n# Run tests\nnpm test\n\n# Start development server\nnpm run start:dev\n```\n\n### Code Style\n\nWe use ESLint and Prettier for code formatting:\n\n```bash\nnpm run lint\nnpm run format\n```\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- [NestJS](https://nestjs.com/) - The amazing framework that makes this possible\n- [TypeORM](https://typeorm.io/) - Database ORM\n- [Bull](https://github.com/OptimalBits/bull) - Job queue\n- [Redis](https://redis.io/) - In-memory data store\n- [Prometheus](https://prometheus.io/) - Metrics collection\n- [Grafana](https://grafana.com/) - Visualization\n\n## 📞 Support\n\n- 📧 Email: ahmedhegazy@example.com\n- 💬 Discord: [NestJS Community](https://discord.gg/nestjs)\n- 🐛 Issues: [GitHub Issues](https://github.com/ahmedhegazee/nestjs-telescope/issues)\n- 📖 Documentation: [https://github.com/ahmedhegazee/nestjs-telescope](https://github.com/ahmedhegazee/nestjs-telescope)\n\n---\n\n**Made with ❤️ by Ahmed Hegazy**\n\n[npm-image]: https://img.shields.io/npm/v/ahmedhegazee/nestjs-telescope.svg\n[npm-url]: https://npmjs.org/package/ahmedhegazee/nestjs-telescope\n[downloads-image]: https://img.shields.io/npm/dm/ahmedhegazee/nestjs-telescope.svg\n[downloads-url]: https://npmjs.org/package/ahmedhegazee/nestjs-telescope\n[build-image]: https://img.shields.io/github/actions/workflow/status/ahmedhegazee/nestjs-telescope/ci.yml\n[build-url]: https://github.com/ahmedhegazee/nestjs-telescope/actions\n[coverage-image]: https://img.shields.io/codecov/c/github/ahmedhegazee/nestjs-telescope\n[coverage-url]: https://codecov.io/gh/ahmedhegazee/nestjs-telescope\n[license-image]: https://img.shields.io/npm/l/ahmedhegazee/nestjs-telescope.svg\n[license-url]: https://github.com/ahmedhegazee/nestjs-telescope/blob/main/LICENSE","readmeFilename":"README.md","_rev":"1-df576259a5bd59f180539081b2a499d4"}