@sentienguard/apm 1.0.21 → 1.0.22-debug.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +141 -141
- package/package.json +1 -1
- package/src/config.js +179 -179
- package/src/dependencies.js +374 -374
- package/src/errors.js +132 -132
- package/src/index.d.ts +120 -120
- package/src/index.js +251 -242
- package/src/mongodb.js +73 -10
- package/src/openai.js +520 -520
- package/src/spanExporter.js +6 -0
- package/src/traceSpanExporter.js +165 -186
- package/src/tracing.js +5 -0
- package/src/transport.js +8 -0
package/src/errors.js
CHANGED
|
@@ -1,132 +1,132 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error Capture
|
|
3
|
-
* Captures unhandled exceptions and associates them with error counters.
|
|
4
|
-
*
|
|
5
|
-
* Stack traces are captured locally but NOT sent to backend in v1.
|
|
6
|
-
* Only error counters are aggregated and sent.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { getAggregator } from './aggregator.js';
|
|
10
|
-
import { debug, warn } from './config.js';
|
|
11
|
-
|
|
12
|
-
let isCapturing = false;
|
|
13
|
-
let originalUncaughtException = null;
|
|
14
|
-
let originalUnhandledRejection = null;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Handle uncaught exception
|
|
18
|
-
*/
|
|
19
|
-
function handleUncaughtException(error) {
|
|
20
|
-
debug('Captured uncaught exception:', error.message);
|
|
21
|
-
|
|
22
|
-
const aggregator = getAggregator();
|
|
23
|
-
aggregator.recordError();
|
|
24
|
-
|
|
25
|
-
// Log locally but don't crash (let the original handler decide)
|
|
26
|
-
if (originalUncaughtException) {
|
|
27
|
-
// If there was a previous handler, call it
|
|
28
|
-
originalUncaughtException(error);
|
|
29
|
-
} else {
|
|
30
|
-
// Default behavior: log and continue
|
|
31
|
-
// We don't re-throw to avoid double handling
|
|
32
|
-
warn('Uncaught exception:', error.message);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Handle unhandled promise rejection
|
|
38
|
-
*/
|
|
39
|
-
function handleUnhandledRejection(reason, promise) {
|
|
40
|
-
const message = reason instanceof Error ? reason.message : String(reason);
|
|
41
|
-
debug('Captured unhandled rejection:', message);
|
|
42
|
-
|
|
43
|
-
const aggregator = getAggregator();
|
|
44
|
-
aggregator.recordError();
|
|
45
|
-
|
|
46
|
-
// Call previous handler if exists
|
|
47
|
-
if (originalUnhandledRejection) {
|
|
48
|
-
originalUnhandledRejection(reason, promise);
|
|
49
|
-
} else {
|
|
50
|
-
warn('Unhandled rejection:', message);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Start capturing unhandled errors
|
|
56
|
-
*/
|
|
57
|
-
export function startErrorCapture() {
|
|
58
|
-
if (isCapturing) {
|
|
59
|
-
debug('Error capture already active, skipping');
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Store any existing handlers
|
|
64
|
-
const existingUncaught = process.listeners('uncaughtException');
|
|
65
|
-
const existingRejection = process.listeners('unhandledRejection');
|
|
66
|
-
|
|
67
|
-
if (existingUncaught.length > 0) {
|
|
68
|
-
originalUncaughtException = existingUncaught[existingUncaught.length - 1];
|
|
69
|
-
}
|
|
70
|
-
if (existingRejection.length > 0) {
|
|
71
|
-
originalUnhandledRejection = existingRejection[existingRejection.length - 1];
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// Add our handlers
|
|
75
|
-
process.on('uncaughtException', handleUncaughtException);
|
|
76
|
-
process.on('unhandledRejection', handleUnhandledRejection);
|
|
77
|
-
|
|
78
|
-
isCapturing = true;
|
|
79
|
-
debug('Error capture enabled');
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Stop capturing errors (for cleanup/testing)
|
|
84
|
-
*/
|
|
85
|
-
export function stopErrorCapture() {
|
|
86
|
-
if (!isCapturing) return;
|
|
87
|
-
|
|
88
|
-
process.removeListener('uncaughtException', handleUncaughtException);
|
|
89
|
-
process.removeListener('unhandledRejection', handleUnhandledRejection);
|
|
90
|
-
|
|
91
|
-
originalUncaughtException = null;
|
|
92
|
-
originalUnhandledRejection = null;
|
|
93
|
-
|
|
94
|
-
isCapturing = false;
|
|
95
|
-
debug('Error capture disabled');
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Create Express error middleware
|
|
100
|
-
* Use this as the last middleware to capture Express errors
|
|
101
|
-
*/
|
|
102
|
-
export function expressErrorMiddleware() {
|
|
103
|
-
return function sentienguardErrorMiddleware(err, req, res, next) {
|
|
104
|
-
debug('Captured Express error:', err.message);
|
|
105
|
-
|
|
106
|
-
const aggregator = getAggregator();
|
|
107
|
-
aggregator.recordError();
|
|
108
|
-
|
|
109
|
-
// Pass to next error handler
|
|
110
|
-
next(err);
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Create Fastify error handler hook
|
|
116
|
-
*/
|
|
117
|
-
export function fastifyErrorHandler(error, request, reply) {
|
|
118
|
-
debug('Captured Fastify error:', error.message);
|
|
119
|
-
|
|
120
|
-
const aggregator = getAggregator();
|
|
121
|
-
aggregator.recordError();
|
|
122
|
-
|
|
123
|
-
// Re-throw to let Fastify handle it
|
|
124
|
-
throw error;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export default {
|
|
128
|
-
startErrorCapture,
|
|
129
|
-
stopErrorCapture,
|
|
130
|
-
expressErrorMiddleware,
|
|
131
|
-
fastifyErrorHandler
|
|
132
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Error Capture
|
|
3
|
+
* Captures unhandled exceptions and associates them with error counters.
|
|
4
|
+
*
|
|
5
|
+
* Stack traces are captured locally but NOT sent to backend in v1.
|
|
6
|
+
* Only error counters are aggregated and sent.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { getAggregator } from './aggregator.js';
|
|
10
|
+
import { debug, warn } from './config.js';
|
|
11
|
+
|
|
12
|
+
let isCapturing = false;
|
|
13
|
+
let originalUncaughtException = null;
|
|
14
|
+
let originalUnhandledRejection = null;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Handle uncaught exception
|
|
18
|
+
*/
|
|
19
|
+
function handleUncaughtException(error) {
|
|
20
|
+
debug('Captured uncaught exception:', error.message);
|
|
21
|
+
|
|
22
|
+
const aggregator = getAggregator();
|
|
23
|
+
aggregator.recordError();
|
|
24
|
+
|
|
25
|
+
// Log locally but don't crash (let the original handler decide)
|
|
26
|
+
if (originalUncaughtException) {
|
|
27
|
+
// If there was a previous handler, call it
|
|
28
|
+
originalUncaughtException(error);
|
|
29
|
+
} else {
|
|
30
|
+
// Default behavior: log and continue
|
|
31
|
+
// We don't re-throw to avoid double handling
|
|
32
|
+
warn('Uncaught exception:', error.message);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Handle unhandled promise rejection
|
|
38
|
+
*/
|
|
39
|
+
function handleUnhandledRejection(reason, promise) {
|
|
40
|
+
const message = reason instanceof Error ? reason.message : String(reason);
|
|
41
|
+
debug('Captured unhandled rejection:', message);
|
|
42
|
+
|
|
43
|
+
const aggregator = getAggregator();
|
|
44
|
+
aggregator.recordError();
|
|
45
|
+
|
|
46
|
+
// Call previous handler if exists
|
|
47
|
+
if (originalUnhandledRejection) {
|
|
48
|
+
originalUnhandledRejection(reason, promise);
|
|
49
|
+
} else {
|
|
50
|
+
warn('Unhandled rejection:', message);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Start capturing unhandled errors
|
|
56
|
+
*/
|
|
57
|
+
export function startErrorCapture() {
|
|
58
|
+
if (isCapturing) {
|
|
59
|
+
debug('Error capture already active, skipping');
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Store any existing handlers
|
|
64
|
+
const existingUncaught = process.listeners('uncaughtException');
|
|
65
|
+
const existingRejection = process.listeners('unhandledRejection');
|
|
66
|
+
|
|
67
|
+
if (existingUncaught.length > 0) {
|
|
68
|
+
originalUncaughtException = existingUncaught[existingUncaught.length - 1];
|
|
69
|
+
}
|
|
70
|
+
if (existingRejection.length > 0) {
|
|
71
|
+
originalUnhandledRejection = existingRejection[existingRejection.length - 1];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Add our handlers
|
|
75
|
+
process.on('uncaughtException', handleUncaughtException);
|
|
76
|
+
process.on('unhandledRejection', handleUnhandledRejection);
|
|
77
|
+
|
|
78
|
+
isCapturing = true;
|
|
79
|
+
debug('Error capture enabled');
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Stop capturing errors (for cleanup/testing)
|
|
84
|
+
*/
|
|
85
|
+
export function stopErrorCapture() {
|
|
86
|
+
if (!isCapturing) return;
|
|
87
|
+
|
|
88
|
+
process.removeListener('uncaughtException', handleUncaughtException);
|
|
89
|
+
process.removeListener('unhandledRejection', handleUnhandledRejection);
|
|
90
|
+
|
|
91
|
+
originalUncaughtException = null;
|
|
92
|
+
originalUnhandledRejection = null;
|
|
93
|
+
|
|
94
|
+
isCapturing = false;
|
|
95
|
+
debug('Error capture disabled');
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Create Express error middleware
|
|
100
|
+
* Use this as the last middleware to capture Express errors
|
|
101
|
+
*/
|
|
102
|
+
export function expressErrorMiddleware() {
|
|
103
|
+
return function sentienguardErrorMiddleware(err, req, res, next) {
|
|
104
|
+
debug('Captured Express error:', err.message);
|
|
105
|
+
|
|
106
|
+
const aggregator = getAggregator();
|
|
107
|
+
aggregator.recordError();
|
|
108
|
+
|
|
109
|
+
// Pass to next error handler
|
|
110
|
+
next(err);
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Create Fastify error handler hook
|
|
116
|
+
*/
|
|
117
|
+
export function fastifyErrorHandler(error, request, reply) {
|
|
118
|
+
debug('Captured Fastify error:', error.message);
|
|
119
|
+
|
|
120
|
+
const aggregator = getAggregator();
|
|
121
|
+
aggregator.recordError();
|
|
122
|
+
|
|
123
|
+
// Re-throw to let Fastify handle it
|
|
124
|
+
throw error;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export default {
|
|
128
|
+
startErrorCapture,
|
|
129
|
+
stopErrorCapture,
|
|
130
|
+
expressErrorMiddleware,
|
|
131
|
+
fastifyErrorHandler
|
|
132
|
+
};
|
package/src/index.d.ts
CHANGED
|
@@ -1,120 +1,120 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SentienGuard APM SDK TypeScript Declarations
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
// Configuration types
|
|
6
|
-
export interface ApmConfig {
|
|
7
|
-
apiKey?: string;
|
|
8
|
-
service?: string;
|
|
9
|
-
environment?: string;
|
|
10
|
-
endpoint?: string;
|
|
11
|
-
tracesEndpoint?: string;
|
|
12
|
-
flushInterval?: number;
|
|
13
|
-
maxRoutes?: number;
|
|
14
|
-
maxPayloadSize?: number;
|
|
15
|
-
enabled?: boolean;
|
|
16
|
-
debug?: boolean;
|
|
17
|
-
tracing?: {
|
|
18
|
-
enabled?: boolean;
|
|
19
|
-
traceLocalHttp?: boolean;
|
|
20
|
-
peerServiceMap?: Record<string, string>;
|
|
21
|
-
/** Export sampling for raw traces only (0..1). Metrics are not sampled. */
|
|
22
|
-
sampleRate?: number;
|
|
23
|
-
/** Drop-on-pressure queue size for raw span export */
|
|
24
|
-
maxQueueSize?: number;
|
|
25
|
-
/** Batch size for raw span export */
|
|
26
|
-
maxBatchSize?: number;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface BrowserApmConfig {
|
|
31
|
-
apiKey: string;
|
|
32
|
-
service: string;
|
|
33
|
-
endpoint?: string;
|
|
34
|
-
environment?: string;
|
|
35
|
-
flushInterval?: number;
|
|
36
|
-
debug?: boolean;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface ApmStatus {
|
|
40
|
-
enabled: boolean;
|
|
41
|
-
initialized: boolean;
|
|
42
|
-
/** True when OpenTelemetry tracing is active (W3C trace context) */
|
|
43
|
-
tracing?: boolean;
|
|
44
|
-
config: {
|
|
45
|
-
service: string;
|
|
46
|
-
environment: string;
|
|
47
|
-
flushInterval: number;
|
|
48
|
-
};
|
|
49
|
-
stats: {
|
|
50
|
-
requestMetrics?: number;
|
|
51
|
-
dependencyMetrics?: number;
|
|
52
|
-
webVitals?: number;
|
|
53
|
-
jsErrors?: number;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Core functions
|
|
58
|
-
export function initialize(options?: BrowserApmConfig): void;
|
|
59
|
-
export function init(options?: BrowserApmConfig): void;
|
|
60
|
-
export function shutdown(): Promise<void>;
|
|
61
|
-
export function getStatus(): ApmStatus;
|
|
62
|
-
export function flush(): Promise<void>;
|
|
63
|
-
export function getConfig(): ApmConfig;
|
|
64
|
-
export function isEnabled(): boolean;
|
|
65
|
-
|
|
66
|
-
/** Active OpenTelemetry trace id (hex) for log correlation; undefined if none */
|
|
67
|
-
export function getActiveTraceId(): string | undefined;
|
|
68
|
-
|
|
69
|
-
// Express middleware (no-ops in browser)
|
|
70
|
-
export function expressMiddleware(): (req: any, res: any, next: any) => void;
|
|
71
|
-
export function expressErrorMiddleware(): (err: any, req: any, res: any, next: any) => void;
|
|
72
|
-
|
|
73
|
-
// Fastify plugin (no-ops in browser)
|
|
74
|
-
export function fastifyPlugin(): any;
|
|
75
|
-
export function fastifyErrorHandler(): any;
|
|
76
|
-
|
|
77
|
-
// Route utilities (no-ops in browser)
|
|
78
|
-
export function normalizeRoute(route: string): string;
|
|
79
|
-
export function extractRoute(req: any): string;
|
|
80
|
-
export const RouteRegistry: any;
|
|
81
|
-
|
|
82
|
-
// Aggregator
|
|
83
|
-
export function getAggregator(): any;
|
|
84
|
-
|
|
85
|
-
// MongoDB instrumentation (no-ops in browser)
|
|
86
|
-
export function instrumentMongoDB(): void;
|
|
87
|
-
|
|
88
|
-
// OpenAI instrumentation (no-ops in browser)
|
|
89
|
-
export function instrumentOpenAI(): void;
|
|
90
|
-
|
|
91
|
-
// Circuit breaker (no-ops in browser)
|
|
92
|
-
export function createBreaker(fn: any): any;
|
|
93
|
-
export function wrapMongoOperation(fn: any): any;
|
|
94
|
-
export function getBreakerStats(): any;
|
|
95
|
-
|
|
96
|
-
// Default export
|
|
97
|
-
declare const SentienGuard: {
|
|
98
|
-
init: typeof init;
|
|
99
|
-
initialize: typeof initialize;
|
|
100
|
-
shutdown: typeof shutdown;
|
|
101
|
-
getStatus: typeof getStatus;
|
|
102
|
-
flush: typeof flush;
|
|
103
|
-
getConfig: typeof getConfig;
|
|
104
|
-
isEnabled: typeof isEnabled;
|
|
105
|
-
getAggregator: typeof getAggregator;
|
|
106
|
-
expressMiddleware: typeof expressMiddleware;
|
|
107
|
-
expressErrorMiddleware: typeof expressErrorMiddleware;
|
|
108
|
-
fastifyPlugin: typeof fastifyPlugin;
|
|
109
|
-
fastifyErrorHandler: typeof fastifyErrorHandler;
|
|
110
|
-
normalizeRoute: typeof normalizeRoute;
|
|
111
|
-
extractRoute: typeof extractRoute;
|
|
112
|
-
instrumentMongoDB: typeof instrumentMongoDB;
|
|
113
|
-
instrumentOpenAI: typeof instrumentOpenAI;
|
|
114
|
-
createBreaker: typeof createBreaker;
|
|
115
|
-
wrapMongoOperation: typeof wrapMongoOperation;
|
|
116
|
-
getBreakerStats: typeof getBreakerStats;
|
|
117
|
-
getActiveTraceId: typeof getActiveTraceId;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
export default SentienGuard;
|
|
1
|
+
/**
|
|
2
|
+
* SentienGuard APM SDK TypeScript Declarations
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// Configuration types
|
|
6
|
+
export interface ApmConfig {
|
|
7
|
+
apiKey?: string;
|
|
8
|
+
service?: string;
|
|
9
|
+
environment?: string;
|
|
10
|
+
endpoint?: string;
|
|
11
|
+
tracesEndpoint?: string;
|
|
12
|
+
flushInterval?: number;
|
|
13
|
+
maxRoutes?: number;
|
|
14
|
+
maxPayloadSize?: number;
|
|
15
|
+
enabled?: boolean;
|
|
16
|
+
debug?: boolean;
|
|
17
|
+
tracing?: {
|
|
18
|
+
enabled?: boolean;
|
|
19
|
+
traceLocalHttp?: boolean;
|
|
20
|
+
peerServiceMap?: Record<string, string>;
|
|
21
|
+
/** Export sampling for raw traces only (0..1). Metrics are not sampled. */
|
|
22
|
+
sampleRate?: number;
|
|
23
|
+
/** Drop-on-pressure queue size for raw span export */
|
|
24
|
+
maxQueueSize?: number;
|
|
25
|
+
/** Batch size for raw span export */
|
|
26
|
+
maxBatchSize?: number;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface BrowserApmConfig {
|
|
31
|
+
apiKey: string;
|
|
32
|
+
service: string;
|
|
33
|
+
endpoint?: string;
|
|
34
|
+
environment?: string;
|
|
35
|
+
flushInterval?: number;
|
|
36
|
+
debug?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface ApmStatus {
|
|
40
|
+
enabled: boolean;
|
|
41
|
+
initialized: boolean;
|
|
42
|
+
/** True when OpenTelemetry tracing is active (W3C trace context) */
|
|
43
|
+
tracing?: boolean;
|
|
44
|
+
config: {
|
|
45
|
+
service: string;
|
|
46
|
+
environment: string;
|
|
47
|
+
flushInterval: number;
|
|
48
|
+
};
|
|
49
|
+
stats: {
|
|
50
|
+
requestMetrics?: number;
|
|
51
|
+
dependencyMetrics?: number;
|
|
52
|
+
webVitals?: number;
|
|
53
|
+
jsErrors?: number;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Core functions
|
|
58
|
+
export function initialize(options?: BrowserApmConfig): void;
|
|
59
|
+
export function init(options?: BrowserApmConfig): void;
|
|
60
|
+
export function shutdown(): Promise<void>;
|
|
61
|
+
export function getStatus(): ApmStatus;
|
|
62
|
+
export function flush(): Promise<void>;
|
|
63
|
+
export function getConfig(): ApmConfig;
|
|
64
|
+
export function isEnabled(): boolean;
|
|
65
|
+
|
|
66
|
+
/** Active OpenTelemetry trace id (hex) for log correlation; undefined if none */
|
|
67
|
+
export function getActiveTraceId(): string | undefined;
|
|
68
|
+
|
|
69
|
+
// Express middleware (no-ops in browser)
|
|
70
|
+
export function expressMiddleware(): (req: any, res: any, next: any) => void;
|
|
71
|
+
export function expressErrorMiddleware(): (err: any, req: any, res: any, next: any) => void;
|
|
72
|
+
|
|
73
|
+
// Fastify plugin (no-ops in browser)
|
|
74
|
+
export function fastifyPlugin(): any;
|
|
75
|
+
export function fastifyErrorHandler(): any;
|
|
76
|
+
|
|
77
|
+
// Route utilities (no-ops in browser)
|
|
78
|
+
export function normalizeRoute(route: string): string;
|
|
79
|
+
export function extractRoute(req: any): string;
|
|
80
|
+
export const RouteRegistry: any;
|
|
81
|
+
|
|
82
|
+
// Aggregator
|
|
83
|
+
export function getAggregator(): any;
|
|
84
|
+
|
|
85
|
+
// MongoDB instrumentation (no-ops in browser)
|
|
86
|
+
export function instrumentMongoDB(): void;
|
|
87
|
+
|
|
88
|
+
// OpenAI instrumentation (no-ops in browser)
|
|
89
|
+
export function instrumentOpenAI(): void;
|
|
90
|
+
|
|
91
|
+
// Circuit breaker (no-ops in browser)
|
|
92
|
+
export function createBreaker(fn: any): any;
|
|
93
|
+
export function wrapMongoOperation(fn: any): any;
|
|
94
|
+
export function getBreakerStats(): any;
|
|
95
|
+
|
|
96
|
+
// Default export
|
|
97
|
+
declare const SentienGuard: {
|
|
98
|
+
init: typeof init;
|
|
99
|
+
initialize: typeof initialize;
|
|
100
|
+
shutdown: typeof shutdown;
|
|
101
|
+
getStatus: typeof getStatus;
|
|
102
|
+
flush: typeof flush;
|
|
103
|
+
getConfig: typeof getConfig;
|
|
104
|
+
isEnabled: typeof isEnabled;
|
|
105
|
+
getAggregator: typeof getAggregator;
|
|
106
|
+
expressMiddleware: typeof expressMiddleware;
|
|
107
|
+
expressErrorMiddleware: typeof expressErrorMiddleware;
|
|
108
|
+
fastifyPlugin: typeof fastifyPlugin;
|
|
109
|
+
fastifyErrorHandler: typeof fastifyErrorHandler;
|
|
110
|
+
normalizeRoute: typeof normalizeRoute;
|
|
111
|
+
extractRoute: typeof extractRoute;
|
|
112
|
+
instrumentMongoDB: typeof instrumentMongoDB;
|
|
113
|
+
instrumentOpenAI: typeof instrumentOpenAI;
|
|
114
|
+
createBreaker: typeof createBreaker;
|
|
115
|
+
wrapMongoOperation: typeof wrapMongoOperation;
|
|
116
|
+
getBreakerStats: typeof getBreakerStats;
|
|
117
|
+
getActiveTraceId: typeof getActiveTraceId;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export default SentienGuard;
|