@ahmedhegazee/nestjs-telescope
Version:
Advanced observability and monitoring solution for NestJS applications with ML-powered analytics, enterprise features, and production-ready scaling
58 lines (57 loc) • 2.11 kB
TypeScript
import { OnModuleInit, OnModuleDestroy } from '@nestjs/common';
import { StreamProcessingBridgeService } from './stream-processing-bridge.service';
import { TelescopeConfig } from '../../core/interfaces/telescope-config.interface';
export interface ResilientBridgeConfig {
circuitBreakerEnabled: boolean;
fallbackEnabled: boolean;
maxRetries: number;
retryDelayMs: number;
healthCheckIntervalMs: number;
}
export interface BridgeHealthStatus {
isHealthy: boolean;
issues: string[];
circuitBreakers: Record<string, any>;
streamMetrics: any;
lastHealthCheckAt: Date;
}
export declare class ResilientBridgeService implements OnModuleInit, OnModuleDestroy {
private readonly streamBridge;
private readonly telescopeConfig;
private readonly logger;
private readonly circuitBreakerRegistry;
private healthCheckInterval?;
private lastHealthStatus?;
private readonly config;
constructor(streamBridge: StreamProcessingBridgeService, telescopeConfig: TelescopeConfig);
onModuleInit(): Promise<void>;
onModuleDestroy(): Promise<void>;
private updateConfig;
private setupCircuitBreakers;
private handleStreamProcessingFailure;
private startHealthChecks;
private performHealthCheck;
processDevToolsEntryWithResilience(entry: any, type: string): Promise<void>;
private processWithRetry;
private fallbackProcessing;
private delay;
getHealthStatus(): BridgeHealthStatus;
getCircuitBreakerStatus(): Record<string, any>;
getStreamMetrics(): any;
getStreamConfiguration(): any;
openCircuitBreaker(name: string): void;
closeCircuitBreaker(name: string): void;
resetCircuitBreaker(name: string): void;
resetAllCircuitBreakers(): void;
flushStreamBuffer(): Promise<void>;
updateStreamConfiguration(config: any): void;
getComprehensiveStatus(): {
bridge: BridgeHealthStatus;
circuitBreakers: Record<string, any>;
streamMetrics: any;
configuration: {
resilience: ResilientBridgeConfig;
stream: any;
};
};
}