@oas-tools/oas-telemetry 0.7.0-alpha.2 → 0.7.0-alpha.4
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/.env.example +50 -17
- package/README.md +244 -239
- package/dist/cjs/config/bootConfig.cjs +18 -0
- package/dist/cjs/config/config.cjs +145 -0
- package/dist/cjs/config/config.types.cjs +5 -0
- package/dist/cjs/index.cjs +19 -25
- package/dist/cjs/{tlmRoutes.cjs → routesManager.cjs} +28 -21
- package/dist/cjs/{exporters/InMemoryLogRecordExporter.cjs → telemetry/custom-implementations/exporters/InMemoryDbLogExporter.cjs} +42 -19
- package/dist/cjs/telemetry/custom-implementations/exporters/InMemoryDbMetricExporter.cjs +97 -0
- package/dist/cjs/telemetry/custom-implementations/exporters/InMemoryDbSpanExporter.cjs +118 -0
- package/dist/cjs/telemetry/custom-implementations/exporters/PluginLogExporter.cjs +45 -0
- package/dist/cjs/telemetry/custom-implementations/exporters/PluginMetricExporter.cjs +46 -0
- package/dist/cjs/telemetry/custom-implementations/exporters/PluginSpanExporter.cjs +61 -0
- package/dist/cjs/telemetry/custom-implementations/processors/dynamicMultiLogProcessor.cjs +70 -0
- package/dist/cjs/telemetry/custom-implementations/processors/dynamicMultiSpanProcessor.cjs +70 -0
- package/dist/cjs/{utils → telemetry/custom-implementations/utils}/circular.cjs +39 -49
- package/dist/cjs/telemetry/custom-implementations/wrappers.cjs +175 -0
- package/dist/cjs/telemetry/initializeTelemetry.cjs +74 -0
- package/dist/cjs/telemetry/telemetryConfigurator.cjs +84 -0
- package/dist/cjs/telemetry/telemetryRegistry.cjs +40 -0
- package/dist/cjs/tlm-ai/agent.cjs +82 -63
- package/dist/cjs/tlm-ai/aiController.cjs +5 -4
- package/dist/cjs/tlm-ai/aiRoutes.cjs +9 -6
- package/dist/cjs/tlm-ai/tools.cjs +16 -9
- package/dist/cjs/tlm-auth/authController.cjs +14 -15
- package/dist/cjs/tlm-auth/authMiddleware.cjs +11 -10
- package/dist/cjs/tlm-auth/authRoutes.cjs +9 -7
- package/dist/cjs/tlm-log/logController.cjs +45 -18
- package/dist/cjs/tlm-log/logRoutes.cjs +16 -11
- package/dist/cjs/tlm-metric/metricsController.cjs +37 -12
- package/dist/cjs/tlm-metric/metricsRoutes.cjs +16 -11
- package/dist/cjs/tlm-plugin/pluginController.cjs +114 -75
- package/dist/cjs/tlm-plugin/pluginProcess.cjs +108 -0
- package/dist/cjs/tlm-plugin/pluginRoutes.cjs +11 -6
- package/dist/cjs/tlm-plugin/pluginService.cjs +79 -0
- package/dist/cjs/tlm-trace/traceController.cjs +54 -45
- package/dist/cjs/tlm-trace/traceRoutes.cjs +16 -11
- package/dist/cjs/tlm-ui/uiRoutes.cjs +26 -20
- package/dist/cjs/tlm-util/utilController.cjs +8 -9
- package/dist/cjs/tlm-util/utilRoutes.cjs +22 -19
- package/dist/cjs/types/index.cjs +0 -1
- package/dist/cjs/utils/logger.cjs +3 -5
- package/dist/cjs/utils/regexUtils.cjs +27 -0
- package/dist/esm/config/bootConfig.js +11 -0
- package/dist/esm/config/config.js +126 -0
- package/dist/esm/index.js +18 -29
- package/dist/esm/{tlmRoutes.js → routesManager.js} +27 -22
- package/dist/esm/{exporters/InMemoryLogRecordExporter.js → telemetry/custom-implementations/exporters/InMemoryDbLogExporter.js} +31 -17
- package/dist/esm/{exporters/InMemoryDBMetricsExporter.js → telemetry/custom-implementations/exporters/InMemoryDbMetricExporter.js} +31 -17
- package/dist/esm/telemetry/custom-implementations/exporters/InMemoryDbSpanExporter.js +105 -0
- package/dist/esm/telemetry/custom-implementations/exporters/PluginLogExporter.js +36 -0
- package/dist/esm/telemetry/custom-implementations/exporters/PluginMetricExporter.js +35 -0
- package/dist/esm/telemetry/custom-implementations/exporters/PluginSpanExporter.js +52 -0
- package/dist/esm/telemetry/custom-implementations/processors/dynamicMultiLogProcessor.js +64 -0
- package/dist/esm/telemetry/custom-implementations/processors/dynamicMultiSpanProcessor.js +64 -0
- package/dist/esm/telemetry/custom-implementations/utils/circular.js +76 -0
- package/dist/esm/telemetry/custom-implementations/wrappers.js +163 -0
- package/dist/esm/telemetry/initializeTelemetry.js +71 -0
- package/dist/esm/telemetry/telemetryConfigurator.js +74 -0
- package/dist/esm/telemetry/telemetryRegistry.js +34 -0
- package/dist/esm/tlm-ai/agent.js +77 -59
- package/dist/esm/tlm-ai/aiController.js +5 -4
- package/dist/esm/tlm-ai/aiRoutes.js +7 -5
- package/dist/esm/tlm-ai/tools.js +18 -9
- package/dist/esm/tlm-auth/authController.js +9 -10
- package/dist/esm/tlm-auth/authMiddleware.js +10 -9
- package/dist/esm/tlm-auth/authRoutes.js +8 -6
- package/dist/esm/tlm-log/logController.js +36 -16
- package/dist/esm/tlm-log/logRoutes.js +15 -11
- package/dist/esm/tlm-metric/metricsController.js +29 -10
- package/dist/esm/tlm-metric/metricsRoutes.js +15 -11
- package/dist/esm/tlm-plugin/pluginController.js +112 -77
- package/dist/esm/tlm-plugin/pluginProcess.js +101 -0
- package/dist/esm/tlm-plugin/pluginRoutes.js +10 -6
- package/dist/esm/tlm-plugin/pluginService.js +73 -0
- package/dist/esm/tlm-trace/traceController.js +40 -35
- package/dist/esm/tlm-trace/traceRoutes.js +15 -11
- package/dist/esm/tlm-ui/uiRoutes.js +24 -19
- package/dist/esm/tlm-util/utilController.js +8 -9
- package/dist/esm/tlm-util/utilRoutes.js +17 -15
- package/dist/esm/types/index.js +0 -1
- package/dist/esm/utils/logger.js +3 -4
- package/dist/esm/utils/regexUtils.js +23 -0
- package/dist/types/config/bootConfig.d.ts +5 -0
- package/dist/types/config/config.d.ts +858 -0
- package/dist/types/config/config.types.d.ts +34 -0
- package/dist/types/index.d.ts +5 -4
- package/dist/types/routesManager.d.ts +3 -0
- package/dist/types/{exporters/InMemoryLogRecordExporter.d.ts → telemetry/custom-implementations/exporters/InMemoryDbLogExporter.d.ts} +6 -6
- package/dist/types/{exporters/InMemoryDBMetricsExporter.d.ts → telemetry/custom-implementations/exporters/InMemoryDbMetricExporter.d.ts} +7 -7
- package/dist/types/{exporters/InMemoryDbExporter.d.ts → telemetry/custom-implementations/exporters/InMemoryDbSpanExporter.d.ts} +9 -9
- package/dist/types/telemetry/custom-implementations/exporters/PluginLogExporter.d.ts +8 -0
- package/dist/types/telemetry/custom-implementations/exporters/PluginMetricExporter.d.ts +12 -0
- package/dist/types/telemetry/custom-implementations/exporters/PluginSpanExporter.d.ts +14 -0
- package/dist/types/telemetry/custom-implementations/processors/dynamicMultiLogProcessor.d.ts +32 -0
- package/dist/types/telemetry/custom-implementations/processors/dynamicMultiSpanProcessor.d.ts +34 -0
- package/dist/types/telemetry/custom-implementations/utils/circular.d.ts +27 -0
- package/dist/types/telemetry/custom-implementations/wrappers.d.ts +52 -0
- package/dist/types/telemetry/initializeTelemetry.d.ts +1 -0
- package/dist/types/telemetry/telemetryConfigurator.d.ts +2 -0
- package/dist/types/telemetry/telemetryRegistry.d.ts +20 -0
- package/dist/types/tlm-ai/agent.d.ts +2 -1
- package/dist/types/tlm-ai/aiController.d.ts +4 -3
- package/dist/types/tlm-ai/aiRoutes.d.ts +2 -2
- package/dist/types/tlm-ai/tools.d.ts +3 -1
- package/dist/types/tlm-auth/authController.d.ts +4 -3
- package/dist/types/tlm-auth/authMiddleware.d.ts +2 -1
- package/dist/types/tlm-auth/authRoutes.d.ts +2 -2
- package/dist/types/tlm-log/logController.d.ts +1 -0
- package/dist/types/tlm-log/logRoutes.d.ts +2 -2
- package/dist/types/tlm-metric/metricsController.d.ts +1 -0
- package/dist/types/tlm-metric/metricsRoutes.d.ts +2 -2
- package/dist/types/tlm-plugin/pluginController.d.ts +4 -1
- package/dist/types/tlm-plugin/pluginProcess.d.ts +1 -0
- package/dist/types/tlm-plugin/pluginRoutes.d.ts +1 -2
- package/dist/types/tlm-plugin/pluginService.d.ts +24 -0
- package/dist/types/tlm-trace/traceController.d.ts +7 -6
- package/dist/types/tlm-trace/traceRoutes.d.ts +2 -2
- package/dist/types/tlm-ui/uiRoutes.d.ts +1 -2
- package/dist/types/tlm-util/utilController.d.ts +2 -1
- package/dist/types/tlm-util/utilRoutes.d.ts +2 -2
- package/dist/types/types/index.d.ts +17 -47
- package/dist/types/utils/regexUtils.d.ts +1 -0
- package/dist/ui/assets/index-BzIdRox6.js +1733 -0
- package/dist/ui/assets/index-CkoHzrrt.css +1 -0
- package/dist/ui/index.html +3 -3
- package/dist/ui/oas-tlm.svg +185 -0
- package/package.json +12 -7
- package/dist/cjs/config.cjs +0 -31
- package/dist/cjs/exporters/InMemoryDBMetricsExporter.cjs +0 -74
- package/dist/cjs/exporters/InMemoryDbExporter.cjs +0 -102
- package/dist/cjs/exporters/consoleExporter.cjs +0 -47
- package/dist/cjs/exporters/dynamicExporter.cjs +0 -57
- package/dist/cjs/instrumentation/index.cjs +0 -28
- package/dist/cjs/instrumentation/logs.cjs +0 -46
- package/dist/cjs/instrumentation/metrics.cjs +0 -27
- package/dist/cjs/instrumentation/traces.cjs +0 -19
- package/dist/esm/config.js +0 -20
- package/dist/esm/exporters/InMemoryDbExporter.js +0 -102
- package/dist/esm/exporters/consoleExporter.js +0 -38
- package/dist/esm/exporters/dynamicExporter.js +0 -50
- package/dist/esm/instrumentation/index.js +0 -26
- package/dist/esm/instrumentation/logs.js +0 -34
- package/dist/esm/instrumentation/metrics.js +0 -18
- package/dist/esm/instrumentation/traces.js +0 -12
- package/dist/esm/utils/circular.js +0 -84
- package/dist/types/config.d.ts +0 -6
- package/dist/types/exporters/consoleExporter.d.ts +0 -13
- package/dist/types/exporters/dynamicExporter.d.ts +0 -25
- package/dist/types/instrumentation/logs.d.ts +0 -1
- package/dist/types/instrumentation/metrics.d.ts +0 -1
- package/dist/types/instrumentation/traces.d.ts +0 -1
- package/dist/types/tlmRoutes.d.ts +0 -2
- package/dist/types/utils/circular.d.ts +0 -31
- package/dist/ui/assets/index-BNhZBPi2.css +0 -1
- package/dist/ui/assets/index-DxGAMrAl.js +0 -401
- package/dist/ui/vite.svg +0 -1
- /package/dist/{types/instrumentation/index.d.ts → esm/config/config.types.js} +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { LogRecordExporter, LogRecordProcessor } from "@opentelemetry/sdk-logs";
|
|
2
|
+
import { IMetricReader } from "@opentelemetry/sdk-metrics";
|
|
3
|
+
import { SpanExporter, SpanProcessor } from "@opentelemetry/sdk-trace-node";
|
|
4
|
+
import { defaultConfig } from "./config.js";
|
|
5
|
+
import { ViewOptions } from "@opentelemetry/sdk-metrics/build/src/view/View.js";
|
|
6
|
+
export type DeepPartial<T> = T extends object ? {
|
|
7
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
8
|
+
} : T;
|
|
9
|
+
export type OasTlmConfig = typeof defaultConfig;
|
|
10
|
+
export type UserConfig = {
|
|
11
|
+
general?: Partial<OasTlmConfig["general"]>;
|
|
12
|
+
auth?: Partial<OasTlmConfig["auth"]>;
|
|
13
|
+
ai?: {
|
|
14
|
+
extraContextPrompts?: string[];
|
|
15
|
+
openAIModel?: string;
|
|
16
|
+
};
|
|
17
|
+
traces?: {
|
|
18
|
+
extraExporters?: SpanExporter[];
|
|
19
|
+
extraProcessors?: SpanProcessor[];
|
|
20
|
+
memoryExporter?: Partial<OasTlmConfig["traces"]["memoryExporter"]>;
|
|
21
|
+
};
|
|
22
|
+
metrics?: {
|
|
23
|
+
mainMetricReaderOptions?: Partial<OasTlmConfig["metrics"]["mainMetricReaderOptions"]>;
|
|
24
|
+
extraReaders?: IMetricReader[];
|
|
25
|
+
extraViews?: ViewOptions[];
|
|
26
|
+
memoryExporter?: Partial<OasTlmConfig["metrics"]["memoryExporter"]>;
|
|
27
|
+
};
|
|
28
|
+
logs?: {
|
|
29
|
+
extraExporters?: LogRecordExporter[];
|
|
30
|
+
extraProcessors?: LogRecordProcessor[];
|
|
31
|
+
memoryExporter?: Partial<OasTlmConfig["logs"]["memoryExporter"]>;
|
|
32
|
+
};
|
|
33
|
+
plugins?: Partial<OasTlmConfig["plugins"]>;
|
|
34
|
+
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./config/bootConfig.js";
|
|
2
|
+
import './telemetry/initializeTelemetry.js';
|
|
2
3
|
import { Router } from 'express';
|
|
3
|
-
import {
|
|
4
|
+
import { UserConfig } from './config/config.types.js';
|
|
4
5
|
/**
|
|
5
|
-
* Returns the
|
|
6
|
+
* Returns the OAS-Telemetry middleware.
|
|
6
7
|
* All parameters are optional. However, either `spec` or `specFileName` must be provided to enable endpoint filtering.
|
|
7
8
|
*/
|
|
8
|
-
export default function oasTelemetry(oasTlmInputConfig
|
|
9
|
+
export default function oasTelemetry(oasTlmInputConfig?: UserConfig): Router;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ExportResult } from '@opentelemetry/core';
|
|
2
2
|
import { ReadableLogRecord, LogRecordExporter } from '@opentelemetry/sdk-logs';
|
|
3
|
-
|
|
3
|
+
import { Enabler } from '../wrappers.js';
|
|
4
|
+
export declare class InMemoryDbLogExporter extends Enabler implements LogRecordExporter {
|
|
4
5
|
private _db;
|
|
5
6
|
private _miniSearch;
|
|
6
|
-
private
|
|
7
|
-
constructor();
|
|
7
|
+
private _retentionTimeInSeconds;
|
|
8
|
+
constructor(retentionTimeInSeconds?: number);
|
|
8
9
|
/**
|
|
9
10
|
* Export logs.
|
|
10
11
|
* @param logs
|
|
@@ -18,9 +19,6 @@ export declare class InMemoryLogRecordExporter implements LogRecordExporter {
|
|
|
18
19
|
shutdown(): Promise<void>;
|
|
19
20
|
find(query: any, messageSearch: string | null, callback: (err: any, docs: any) => void): void;
|
|
20
21
|
insert(data: any[], callback: (err: any, newDocs: any[]) => void): void;
|
|
21
|
-
start(): void;
|
|
22
|
-
stop(): void;
|
|
23
|
-
isRunning(): boolean;
|
|
24
22
|
getFinishedLogs(): any[];
|
|
25
23
|
/**
|
|
26
24
|
* @copyright The OpenTelemetry Authors
|
|
@@ -29,5 +27,7 @@ export declare class InMemoryLogRecordExporter implements LogRecordExporter {
|
|
|
29
27
|
* @param logRecord
|
|
30
28
|
*/
|
|
31
29
|
private _formatLogRecord;
|
|
30
|
+
set retentionTimeInSeconds(retentionTimeInSeconds: number);
|
|
32
31
|
private _insertLogs;
|
|
32
|
+
private _startCleanupJob;
|
|
33
33
|
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { ResourceMetrics } from '@opentelemetry/sdk-metrics';
|
|
2
|
-
|
|
1
|
+
import { PushMetricExporter, ResourceMetrics } from '@opentelemetry/sdk-metrics';
|
|
2
|
+
import { Enabler } from '../wrappers.js';
|
|
3
|
+
export declare class InMemoryDbMetricExporter extends Enabler implements PushMetricExporter {
|
|
3
4
|
private _metrics;
|
|
4
|
-
private
|
|
5
|
-
constructor();
|
|
5
|
+
private _retentionTimeInSeconds;
|
|
6
|
+
constructor(retentionTimeInSeconds?: number);
|
|
6
7
|
export(metrics: ResourceMetrics, resultCallback: any): any;
|
|
7
|
-
start(): void;
|
|
8
|
-
stop(): void;
|
|
9
|
-
isRunning(): boolean;
|
|
10
8
|
shutdown(): Promise<void>;
|
|
11
9
|
forceFlush(): Promise<void>;
|
|
12
10
|
find(search: any, callback: any): void;
|
|
@@ -18,4 +16,6 @@ export declare class InMemoryDBMetricsExporter {
|
|
|
18
16
|
* @param callback - The callback to execute after insertion.
|
|
19
17
|
*/
|
|
20
18
|
insert(metrics: any[], callback: (err: any, newDocs: any[]) => void): void;
|
|
19
|
+
set retentionTimeInSeconds(retentionTimeInSeconds: number);
|
|
20
|
+
private _startCleanupJob;
|
|
21
21
|
}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { ExportResultCode } from '@opentelemetry/core';
|
|
2
|
-
import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
3
|
-
import {
|
|
4
|
-
export declare class
|
|
2
|
+
import { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
|
|
3
|
+
import { Enabler } from '../wrappers.js';
|
|
4
|
+
export declare class InMemoryDbSpanExporter extends Enabler implements SpanExporter {
|
|
5
5
|
private _spans;
|
|
6
|
-
private
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
private _baseUrl;
|
|
7
|
+
private _retentionTimeInSeconds;
|
|
8
|
+
constructor(retentionTimeInSeconds?: number);
|
|
9
|
+
set baseUrl(baseUrl: string);
|
|
10
|
+
set retentionTimeInSeconds(retentionTimeInSeconds: number);
|
|
9
11
|
export(readableSpans: ReadableSpan[], resultCallback: (arg0: {
|
|
10
12
|
code: ExportResultCode;
|
|
11
13
|
error?: Error;
|
|
12
14
|
}) => void): void;
|
|
13
|
-
start(): void;
|
|
14
|
-
stop(): void;
|
|
15
|
-
isRunning(): boolean;
|
|
16
15
|
shutdown(): Promise<void>;
|
|
17
16
|
/**
|
|
18
17
|
* Exports any pending spans in the exporter
|
|
@@ -27,4 +26,5 @@ export declare class InMemoryExporter implements OasTlmExporter {
|
|
|
27
26
|
* @param callback - The callback to execute after insertion.
|
|
28
27
|
*/
|
|
29
28
|
insert(spans: any[], callback: (err: any, newDocs: any[]) => void): void;
|
|
29
|
+
_startCleanupJob(): void;
|
|
30
30
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ExportResult } from '@opentelemetry/core';
|
|
2
|
+
import { ReadableLogRecord, LogRecordExporter } from '@opentelemetry/sdk-logs';
|
|
3
|
+
import { Enabler } from '../wrappers.js';
|
|
4
|
+
export declare class PluginLogExporter extends Enabler implements LogRecordExporter {
|
|
5
|
+
constructor();
|
|
6
|
+
export(logs: ReadableLogRecord[], resultCallback: (result: ExportResult) => void): void;
|
|
7
|
+
shutdown(): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ExportResultCode } from '@opentelemetry/core';
|
|
2
|
+
import { ResourceMetrics, PushMetricExporter } from '@opentelemetry/sdk-metrics';
|
|
3
|
+
import { Enabler } from '../wrappers.js';
|
|
4
|
+
export declare class PluginMetricExporter extends Enabler implements PushMetricExporter {
|
|
5
|
+
constructor();
|
|
6
|
+
export(metrics: ResourceMetrics, resultCallback: (result: {
|
|
7
|
+
code: ExportResultCode;
|
|
8
|
+
error?: Error;
|
|
9
|
+
}) => void): void;
|
|
10
|
+
shutdown(): Promise<void>;
|
|
11
|
+
forceFlush(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ExportResultCode } from '@opentelemetry/core';
|
|
2
|
+
import { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
|
|
3
|
+
import { Enabler } from '../wrappers.js';
|
|
4
|
+
export declare class PluginSpanExporter extends Enabler implements SpanExporter {
|
|
5
|
+
private _baseUrl;
|
|
6
|
+
constructor();
|
|
7
|
+
set baseUrl(baseUrl: string);
|
|
8
|
+
export(readableSpans: ReadableSpan[], resultCallback: (result: {
|
|
9
|
+
code: ExportResultCode;
|
|
10
|
+
error?: Error;
|
|
11
|
+
}) => void): void;
|
|
12
|
+
shutdown(): Promise<void>;
|
|
13
|
+
forceFlush(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Context } from '@opentelemetry/api';
|
|
2
|
+
import type { LogRecordProcessor } from '@opentelemetry/sdk-logs';
|
|
3
|
+
import type { LogRecord } from '@opentelemetry/sdk-logs';
|
|
4
|
+
export declare class DynamicMultiLogRecordProcessor implements LogRecordProcessor {
|
|
5
|
+
private _processors;
|
|
6
|
+
private _forceFlushTimeoutMillis;
|
|
7
|
+
constructor(initialProcessors?: LogRecordProcessor[], forceFlushTimeoutMillis?: number);
|
|
8
|
+
/**
|
|
9
|
+
* Add a new LogRecordProcessor or an array of LogRecordProcessors at runtime.
|
|
10
|
+
*/
|
|
11
|
+
addProcessors(processor: LogRecordProcessor | LogRecordProcessor[]): void;
|
|
12
|
+
/**
|
|
13
|
+
* Remove a specific LogRecordProcessor.
|
|
14
|
+
*/
|
|
15
|
+
removeProcessor(processor: LogRecordProcessor): void;
|
|
16
|
+
/**
|
|
17
|
+
* Clear all LogRecordProcessors.
|
|
18
|
+
*/
|
|
19
|
+
clearProcessors(): void;
|
|
20
|
+
/**
|
|
21
|
+
* Called when a log record is emitted.
|
|
22
|
+
*/
|
|
23
|
+
onEmit(logRecord: LogRecord, context?: Context): void;
|
|
24
|
+
/**
|
|
25
|
+
* Force flush all processors with timeout.
|
|
26
|
+
*/
|
|
27
|
+
forceFlush(): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Shutdown all processors.
|
|
30
|
+
*/
|
|
31
|
+
shutdown(): Promise<void>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { SpanProcessor, ReadableSpan, Span } from '@opentelemetry/sdk-trace-base';
|
|
2
|
+
import { Context } from '@opentelemetry/api';
|
|
3
|
+
export declare class DynamicMultiSpanProcessor implements SpanProcessor {
|
|
4
|
+
private _spanProcessors;
|
|
5
|
+
constructor(initialProcessors?: SpanProcessor[]);
|
|
6
|
+
/**
|
|
7
|
+
* Add a new SpanProcessor or an array of SpanProcessors at runtime.
|
|
8
|
+
*/
|
|
9
|
+
addProcessors(processor: SpanProcessor | SpanProcessor[]): void;
|
|
10
|
+
/**
|
|
11
|
+
* Remove a specific SpanProcessor if needed.
|
|
12
|
+
*/
|
|
13
|
+
removeProcessor(processor: SpanProcessor): void;
|
|
14
|
+
/**
|
|
15
|
+
* Clear all processors.
|
|
16
|
+
*/
|
|
17
|
+
clearProcessors(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Called when a span is started.
|
|
20
|
+
*/
|
|
21
|
+
onStart(span: Span, context: Context): void;
|
|
22
|
+
/**
|
|
23
|
+
* Called when a span ends.
|
|
24
|
+
*/
|
|
25
|
+
onEnd(span: ReadableSpan): void;
|
|
26
|
+
/**
|
|
27
|
+
* Force flush all processors.
|
|
28
|
+
*/
|
|
29
|
+
forceFlush(): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Shutdown all processors.
|
|
32
|
+
*/
|
|
33
|
+
shutdown(): Promise<void>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare function removeCircularRefs(obj: any): any;
|
|
2
|
+
/**
|
|
3
|
+
* Recursively converts dot-separated keys in an object to nested objects.
|
|
4
|
+
*
|
|
5
|
+
* @param {any} obj - The object to process.
|
|
6
|
+
* @returns {any} - The object with all dot-separated keys converted to nested objects.
|
|
7
|
+
* @example
|
|
8
|
+
* Input:
|
|
9
|
+
* {
|
|
10
|
+
* "http.method": "GET",
|
|
11
|
+
* "http.url": "http://example.com",
|
|
12
|
+
* "nested.obj.key": "value"
|
|
13
|
+
* }
|
|
14
|
+
* Output:
|
|
15
|
+
* {
|
|
16
|
+
* "http": {
|
|
17
|
+
* "method": "GET",
|
|
18
|
+
* "url": "http://example.com"
|
|
19
|
+
* },
|
|
20
|
+
* "nested": {
|
|
21
|
+
* "obj": {
|
|
22
|
+
* "key": "value"
|
|
23
|
+
* }
|
|
24
|
+
* }
|
|
25
|
+
* }
|
|
26
|
+
*/
|
|
27
|
+
export declare function applyNesting(obj: any): any;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ExportResult } from "@opentelemetry/core";
|
|
2
|
+
import { LogRecordExporter, ReadableLogRecord } from "@opentelemetry/sdk-logs";
|
|
3
|
+
import { AggregationOption, AggregationTemporality, CollectionResult, IMetricReader, InstrumentType, MetricProducer } from "@opentelemetry/sdk-metrics";
|
|
4
|
+
import { CollectionOptions, ForceFlushOptions, ShutdownOptions } from "@opentelemetry/sdk-metrics/build/src/types";
|
|
5
|
+
import { ReadableSpan, SpanExporter } from "@opentelemetry/sdk-trace-node";
|
|
6
|
+
export declare abstract class Enabler {
|
|
7
|
+
protected _enabled: boolean;
|
|
8
|
+
constructor(enabled?: boolean);
|
|
9
|
+
setEnabledValue(value: boolean): void;
|
|
10
|
+
enable(): void;
|
|
11
|
+
disable(): void;
|
|
12
|
+
isEnabled(): boolean;
|
|
13
|
+
toggle(): void;
|
|
14
|
+
}
|
|
15
|
+
export declare class EnablerSpanExporter extends Enabler implements SpanExporter, Enabler {
|
|
16
|
+
protected readonly exporter: SpanExporter;
|
|
17
|
+
constructor(exporter: SpanExporter);
|
|
18
|
+
export(spans: ReadableSpan[], resultCallback: (result: ExportResult) => void): void;
|
|
19
|
+
shutdown(): Promise<void>;
|
|
20
|
+
forceFlush?(): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export declare class EnablerLogExporter extends Enabler implements LogRecordExporter, Enabler {
|
|
23
|
+
protected readonly exporter: LogRecordExporter;
|
|
24
|
+
constructor(exporter: LogRecordExporter);
|
|
25
|
+
export(logs: ReadableLogRecord[], resultCallback: (result: ExportResult) => void): void;
|
|
26
|
+
shutdown(): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
declare abstract class EnablerMultiExporter<T> extends Enabler {
|
|
29
|
+
protected _exporters: T[];
|
|
30
|
+
constructor(exporters?: T[]);
|
|
31
|
+
addExporters(exporter: T | T[]): void;
|
|
32
|
+
}
|
|
33
|
+
export declare class EnablerMultiSpanExporter extends EnablerMultiExporter<SpanExporter> {
|
|
34
|
+
export(spans: ReadableSpan[], resultCallback: (result: ExportResult) => void): void;
|
|
35
|
+
shutdown(): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
export declare class EnablerMultiLogExporter extends EnablerMultiExporter<LogRecordExporter> {
|
|
38
|
+
export(logs: ReadableLogRecord[], resultCallback: (result: ExportResult) => void): void;
|
|
39
|
+
shutdown(): Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
export declare class EnablerMetricReader extends Enabler implements IMetricReader {
|
|
42
|
+
private readonly reader;
|
|
43
|
+
constructor(reader: IMetricReader);
|
|
44
|
+
forceFlush(options?: ForceFlushOptions): Promise<void>;
|
|
45
|
+
setMetricProducer(metricProducer: MetricProducer): void;
|
|
46
|
+
selectAggregation(instrumentType: InstrumentType): AggregationOption;
|
|
47
|
+
selectAggregationTemporality(instrumentType: InstrumentType): AggregationTemporality;
|
|
48
|
+
selectCardinalityLimit(instrumentType: InstrumentType): number;
|
|
49
|
+
collect(options?: CollectionOptions): Promise<CollectionResult>;
|
|
50
|
+
shutdown(options?: ShutdownOptions): Promise<void>;
|
|
51
|
+
}
|
|
52
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { InMemoryDbSpanExporter } from "./custom-implementations/exporters/InMemoryDbSpanExporter.js";
|
|
2
|
+
import { EnablerMultiLogExporter, EnablerMultiSpanExporter } from "./custom-implementations/wrappers.js";
|
|
3
|
+
import { InMemoryDbLogExporter } from "./custom-implementations/exporters/InMemoryDbLogExporter.js";
|
|
4
|
+
import { InMemoryDbMetricExporter } from "./custom-implementations/exporters/InMemoryDbMetricExporter.js";
|
|
5
|
+
import { DynamicMultiSpanProcessor } from "./custom-implementations/processors/dynamicMultiSpanProcessor.js";
|
|
6
|
+
import { DynamicMultiLogRecordProcessor } from "./custom-implementations/processors/dynamicMultiLogProcessor.js";
|
|
7
|
+
import { PluginSpanExporter } from "./custom-implementations/exporters/PluginSpanExporter.js";
|
|
8
|
+
import { PluginLogExporter } from "./custom-implementations/exporters/PluginLogExporter.js";
|
|
9
|
+
import { PluginMetricExporter } from "./custom-implementations/exporters/PluginMetricExporter.js";
|
|
10
|
+
export declare const oasTelemetryResource: import("@opentelemetry/resources").Resource;
|
|
11
|
+
export declare const inMemoryDbSpanExporter: InMemoryDbSpanExporter;
|
|
12
|
+
export declare const multiSpanExporter: EnablerMultiSpanExporter;
|
|
13
|
+
export declare const dynamicMultiSpanProcessor: DynamicMultiSpanProcessor;
|
|
14
|
+
export declare const pluginSpanExporter: PluginSpanExporter;
|
|
15
|
+
export declare const inMemoryDbLogExporter: InMemoryDbLogExporter;
|
|
16
|
+
export declare const multiLogExporter: EnablerMultiLogExporter;
|
|
17
|
+
export declare const dynamicMultiLogProcessor: DynamicMultiLogRecordProcessor;
|
|
18
|
+
export declare const pluginLogExporter: PluginLogExporter;
|
|
19
|
+
export declare const inMemoryDbMetricExporter: InMemoryDbMetricExporter;
|
|
20
|
+
export declare const pluginMetricExporter: PluginMetricExporter;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { OasTlmConfig } from "../config/config.types.js";
|
|
2
|
+
export declare function getAgent(oasTlmConfig: OasTlmConfig): (question: string) => Promise<any>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Request, Response } from 'express';
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
2
|
+
import { OasTlmConfig } from "../config/config.types.js";
|
|
3
|
+
export declare const answerQuestion: (oasTlmConfig: OasTlmConfig) => (req: Request, res: Response) => Promise<void>;
|
|
4
|
+
export declare const setKnownMicroservicesHandler: () => (req: Request, res: Response) => void;
|
|
5
|
+
export declare const getKnownMicroservicesHandler: () => (req: Request, res: Response) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import { OasTlmConfig } from "../config/config.types.js";
|
|
2
|
+
export declare const getAIRoutes: (oasTlmConfig: OasTlmConfig) => import("express-serve-static-core").Router;
|
|
@@ -30,7 +30,9 @@ declare const availableTools: {
|
|
|
30
30
|
stopTelemetry: () => void;
|
|
31
31
|
resetTelemetry: () => void;
|
|
32
32
|
getTelemetryStatus: () => {
|
|
33
|
-
|
|
33
|
+
spansEnabled: boolean;
|
|
34
|
+
logsEnabled: boolean;
|
|
35
|
+
metricsEnabled: boolean;
|
|
34
36
|
};
|
|
35
37
|
getCurrentTimestampInEpoch: () => {
|
|
36
38
|
currentTimestampInEpoch: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Request, Response } from 'express';
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
2
|
+
import { OasTlmConfig } from "../config/config.types.js";
|
|
3
|
+
export declare const getLogin: (oasTlmConfig: OasTlmConfig) => (req: Request, res: Response) => void;
|
|
4
|
+
export declare const getLogout: (oasTlmConfig: OasTlmConfig) => (req: Request, res: Response) => void;
|
|
5
|
+
export declare const getCheck: (oasTlmConfig: OasTlmConfig) => (req: Request, res: Response) => void;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { NextFunction, Request, Response } from "express";
|
|
2
|
-
|
|
2
|
+
import { OasTlmConfig } from "../config/config.types.js";
|
|
3
|
+
export declare function getAuthMiddleware(oasTlmConfig: OasTlmConfig): (req: Request, res: Response, next: NextFunction) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import { OasTlmConfig } from "../config/config.types.js";
|
|
2
|
+
export declare const getAuthRoutes: (oasTlmConfig: OasTlmConfig) => import("express-serve-static-core").Router;
|
|
@@ -6,3 +6,4 @@ export declare const insertLogsToDb: (req: Request, res: Response) => Promise<vo
|
|
|
6
6
|
export declare const startLogs: (req: Request, res: Response) => void;
|
|
7
7
|
export declare const stopLogs: (req: Request, res: Response) => void;
|
|
8
8
|
export declare const statusLogs: (req: Request, res: Response) => void;
|
|
9
|
+
export declare const setRetentionTimeLogs: (req: Request, res: Response) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export default
|
|
1
|
+
export declare const getLogRoutes: () => import("express-serve-static-core").Router;
|
|
2
|
+
export default getLogRoutes;
|
|
@@ -6,3 +6,4 @@ export declare const insertMetricsToDb: (req: Request, res: Response) => Promise
|
|
|
6
6
|
export declare const startMetrics: (req: Request, res: Response) => void;
|
|
7
7
|
export declare const stopMetrics: (req: Request, res: Response) => void;
|
|
8
8
|
export declare const statusMetrics: (req: Request, res: Response) => void;
|
|
9
|
+
export declare const setRetentionTimeMetrics: (req: Request, res: Response) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export default
|
|
1
|
+
export declare const getMetricsRoutes: () => import("express-serve-static-core").Router;
|
|
2
|
+
export default getMetricsRoutes;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import { Request, Response } from
|
|
1
|
+
import { Request, Response } from "express";
|
|
2
2
|
export declare const listPlugins: (req: Request, res: Response) => void;
|
|
3
3
|
export declare const registerPlugin: (req: Request, res: Response) => Promise<void>;
|
|
4
|
+
export declare const activatePlugin: (req: Request, res: Response) => void;
|
|
5
|
+
export declare const deactivatePlugin: (req: Request, res: Response) => void;
|
|
6
|
+
export declare const deletePlugin: (req: Request, res: Response) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export default pluginRoutes;
|
|
1
|
+
export declare const getPluginRoutes: () => import("express-serve-static-core").Router;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PluginResource } from "../types/index.js";
|
|
2
|
+
declare class PluginService {
|
|
3
|
+
private plugins;
|
|
4
|
+
getPlugins(): PluginResource[];
|
|
5
|
+
pushPlugin(plugin: PluginResource): void;
|
|
6
|
+
activatePlugin(pluginId: string): void;
|
|
7
|
+
deactivatePlugin(pluginId: string): void;
|
|
8
|
+
deletePlugin(pluginId: string): void;
|
|
9
|
+
private broadcastToPlugins;
|
|
10
|
+
/**
|
|
11
|
+
* Broadcast a new metric to all active plugins
|
|
12
|
+
*/
|
|
13
|
+
broadcastMetric(metric: any): void;
|
|
14
|
+
/**
|
|
15
|
+
* Broadcast a new log to all active plugins
|
|
16
|
+
*/
|
|
17
|
+
broadcastLog(log: any): void;
|
|
18
|
+
/**
|
|
19
|
+
* Broadcast a new trace to all active plugins
|
|
20
|
+
*/
|
|
21
|
+
broadcastTrace(trace: any): void;
|
|
22
|
+
}
|
|
23
|
+
export declare const pluginService: PluginService;
|
|
24
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Request, Response } from 'express';
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
2
|
+
export declare const startTraces: (req: Request, res: Response) => void;
|
|
3
|
+
export declare const stopTraces: (req: Request, res: Response) => void;
|
|
4
|
+
export declare const statusTraces: (req: Request, res: Response) => void;
|
|
5
|
+
export declare const resetTraces: (req: Request, res: Response) => void;
|
|
6
|
+
export declare const listTraces: (req: Request, res: Response) => Promise<void>;
|
|
7
|
+
export declare const findTraces: (req: Request, res: Response) => void;
|
|
8
8
|
export declare const insertTracesToDb: (req: Request, res: Response) => Promise<void>;
|
|
9
|
+
export declare const setRetentionTimeTraces: (req: Request, res: Response) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export default
|
|
1
|
+
export declare const getTraceRoutes: () => import("express-serve-static-core").Router;
|
|
2
|
+
export default getTraceRoutes;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export default uiRoutes;
|
|
1
|
+
export declare const getUIRoutes: () => import("express-serve-static-core").Router;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Request, Response } from 'express';
|
|
2
|
-
|
|
2
|
+
import { OasTlmConfig } from '../config/config.types.js';
|
|
3
|
+
export declare const specLoader: (_req: Request, res: Response, oasTlmConfig: OasTlmConfig) => void;
|
|
3
4
|
export declare const heapStats: (req: Request, res: Response) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import { OasTlmConfig } from '../config/config.types.js';
|
|
2
|
+
export declare const getUtilsRoutes: (oasTlmConfig: OasTlmConfig) => import("express-serve-static-core").Router;
|
|
@@ -1,56 +1,26 @@
|
|
|
1
|
-
import { ReadableSpan
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export interface OasTlmExporter extends SpanExporter {
|
|
6
|
-
plugins: PluginResource[];
|
|
7
|
-
export: (readableSpans: ReadableSpan[], resultCallback: (result: {
|
|
8
|
-
code: number;
|
|
9
|
-
}) => void) => void;
|
|
10
|
-
shutdown: () => Promise<void>;
|
|
11
|
-
forceFlush: () => Promise<void>;
|
|
12
|
-
start: () => void;
|
|
13
|
-
stop: () => void;
|
|
14
|
-
isRunning: () => boolean;
|
|
15
|
-
find: (search: any, callback: any) => any;
|
|
16
|
-
reset: () => void;
|
|
17
|
-
getFinishedSpans: () => any[];
|
|
18
|
-
}
|
|
1
|
+
import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
2
|
+
import { ResourceMetrics } from '@opentelemetry/sdk-metrics';
|
|
3
|
+
import { LogRecord } from '@opentelemetry/sdk-logs';
|
|
4
|
+
import { ChildProcess } from 'child_process';
|
|
19
5
|
export interface PluginResource {
|
|
6
|
+
url?: string;
|
|
7
|
+
code?: any;
|
|
8
|
+
moduleFormat?: "cjs" | "esm";
|
|
9
|
+
install?: any;
|
|
10
|
+
config?: Record<string, any>;
|
|
20
11
|
id: string;
|
|
21
12
|
name: string;
|
|
22
13
|
active: boolean;
|
|
23
14
|
description?: string;
|
|
24
15
|
version?: string;
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
sourceCode?: string;
|
|
17
|
+
process?: ChildProcess;
|
|
27
18
|
}
|
|
28
19
|
export interface PluginImpl {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
autoActivate?: boolean;
|
|
36
|
-
authEnabled?: boolean;
|
|
37
|
-
apiKeyMaxAge?: number;
|
|
38
|
-
defaultApiKey?: string;
|
|
39
|
-
exporter?: OasTlmExporter;
|
|
40
|
-
[key: string]: any;
|
|
41
|
-
}
|
|
42
|
-
export interface GlobalOasTlmConfig {
|
|
43
|
-
dynamicSpanExporter: DynamicExporter;
|
|
44
|
-
metricsExporter: InMemoryDBMetricsExporter;
|
|
45
|
-
logExporter: InMemoryLogRecordExporter;
|
|
46
|
-
metricsExporterInterval: number;
|
|
47
|
-
baseURL: string;
|
|
48
|
-
spec: any | null;
|
|
49
|
-
specFileName: string;
|
|
50
|
-
autoActivate: boolean;
|
|
51
|
-
authEnabled: boolean;
|
|
52
|
-
apiKeyMaxAge: number;
|
|
53
|
-
password: string;
|
|
54
|
-
jwtSecret: string;
|
|
55
|
-
[key: string]: any;
|
|
20
|
+
load(config: (config: any) => unknown): unknown;
|
|
21
|
+
isConfigured(): boolean;
|
|
22
|
+
unload?(): (Promise<boolean> | boolean);
|
|
23
|
+
newTrace?: (span: ReadableSpan[]) => void;
|
|
24
|
+
newMetric?: (metric: ResourceMetrics) => void;
|
|
25
|
+
newLog?: (log: LogRecord) => void;
|
|
56
26
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const convertRegexRecursively: (obj: any) => any;
|