@daniel.stefan/metalink 1.3.9 → 1.3.12
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/package.json +11 -2
- package/packages/cli/dist/bin/cli.js +0 -0
- package/packages/cli/dist/commands/config/validate.js +1 -1
- package/packages/cli/dist/commands/secret/get.js +1 -1
- package/packages/cli/dist/commands/secret/set.js +1 -1
- package/packages/cli/dist/utils/get-configured-port.js +1 -1
- package/packages/cli/package.json +6 -4
- package/packages/core/dist/server/resources.js +1 -1
- package/packages/core/package.json +1 -1
- package/packages/dashboard/package.json +1 -1
- package/packages/shared/package.json +1 -1
- package/packages/core/dist/server/metrics.d.ts +0 -134
- package/packages/core/dist/server/metrics.d.ts.map +0 -1
- package/packages/core/dist/server/metrics.js +0 -273
- package/packages/core/dist/server/metrics.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@daniel.stefan/metalink",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.12",
|
|
4
4
|
"description": "MetaLink MCP Management Platform - Universal MCP server orchestrator",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -26,22 +26,29 @@
|
|
|
26
26
|
],
|
|
27
27
|
"scripts": {
|
|
28
28
|
"build": "turbo build",
|
|
29
|
+
"build:verified": "node scripts/build-with-verification.js",
|
|
29
30
|
"test": "npm --workspaces run test",
|
|
31
|
+
"test:packaged": "node scripts/test-published-package.js",
|
|
30
32
|
"dev": "npm --workspaces run dev",
|
|
31
33
|
"lint": "npm --workspaces run lint",
|
|
32
34
|
"format": "prettier --write \"packages/**/*.{ts,tsx,json,md}\"",
|
|
33
35
|
"changeset": "changeset",
|
|
34
|
-
"version": "changeset version"
|
|
36
|
+
"version": "changeset version",
|
|
37
|
+
"prepack": "npm run build:verified"
|
|
35
38
|
},
|
|
36
39
|
"dependencies": {
|
|
37
40
|
"@modelcontextprotocol/sdk": "^1.21.1",
|
|
38
41
|
"@oclif/core": "^3.0.0",
|
|
39
42
|
"chalk": "^5.3.0",
|
|
40
43
|
"cli-table3": "^0.6.0",
|
|
44
|
+
"dotenv": "^17.2.3",
|
|
41
45
|
"express": "^4.18.2",
|
|
42
46
|
"express-rate-limit": "^6.7.0",
|
|
43
47
|
"js-yaml": "^4.1.0",
|
|
44
48
|
"keytar": "^7.9.0",
|
|
49
|
+
"lru-cache": "^10.0.0",
|
|
50
|
+
"undici": "^6.0.0",
|
|
51
|
+
"uuid": "^9.0.0",
|
|
45
52
|
"ws": "^8.18.3",
|
|
46
53
|
"xml2js": "^0.6.2",
|
|
47
54
|
"yaml": "^2.3.4",
|
|
@@ -50,6 +57,8 @@
|
|
|
50
57
|
"devDependencies": {
|
|
51
58
|
"@changesets/cli": "^2.29.8",
|
|
52
59
|
"@types/node": "^20.0.0",
|
|
60
|
+
"esbuild": "^0.27.3",
|
|
61
|
+
"glob": "^13.0.6",
|
|
53
62
|
"prettier": "^3.0.0",
|
|
54
63
|
"turbo": "^1.10.0",
|
|
55
64
|
"typescript": "^5.0.0"
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command, Flags } from '@oclif/core';
|
|
2
|
-
import { ConfigLoader } from '
|
|
2
|
+
import { ConfigLoader } from '../../../../core/dist/index.js';
|
|
3
3
|
class ConfigValidate extends Command {
|
|
4
4
|
async run() {
|
|
5
5
|
const { flags } = await this.parse(ConfigValidate);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "metalink",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.12",
|
|
4
4
|
"description": "MetaLink CLI Tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -16,12 +16,14 @@
|
|
|
16
16
|
"@oclif/core": "^3.0.0",
|
|
17
17
|
"chalk": "^5.3.0",
|
|
18
18
|
"cli-table3": "^0.6.0",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
19
|
+
"js-yaml": "^4.1.0",
|
|
20
|
+
"keytar": "^7.9.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@types/node": "^20.0.0",
|
|
24
23
|
"@types/js-yaml": "^4.0.0",
|
|
24
|
+
"@types/node": "^20.0.0",
|
|
25
|
+
"esbuild": "^0.21.5",
|
|
26
|
+
"glob": "^13.0.6",
|
|
25
27
|
"ts-node": "^10.9.0",
|
|
26
28
|
"typescript": "^5.0.0",
|
|
27
29
|
"vitest": "^1.0.0"
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* - Built-in resources: metalink://servers, metalink://tools, metalink://version
|
|
6
6
|
* - Resource templates: metalink://server/{name}, metalink://server/{name}/tools
|
|
7
7
|
*/
|
|
8
|
-
import { VERSION } from '
|
|
8
|
+
import { VERSION } from '../../../shared/dist/version.js';
|
|
9
9
|
/**
|
|
10
10
|
* Get list of built-in resources
|
|
11
11
|
* Used for MCP resources/list method
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* v1.2.0: Metrics System
|
|
3
|
-
* Comprehensive telemetry tracking for tool calls, API requests, and server performance
|
|
4
|
-
*/
|
|
5
|
-
export interface ToolCallMetric {
|
|
6
|
-
timestamp: number;
|
|
7
|
-
serverName: string;
|
|
8
|
-
toolName: string;
|
|
9
|
-
durationMs: number;
|
|
10
|
-
isError: boolean;
|
|
11
|
-
clientType?: string;
|
|
12
|
-
sessionId?: string;
|
|
13
|
-
}
|
|
14
|
-
export interface ApiCallMetric {
|
|
15
|
-
timestamp: number;
|
|
16
|
-
method: string;
|
|
17
|
-
path: string;
|
|
18
|
-
durationMs: number;
|
|
19
|
-
statusCode: number;
|
|
20
|
-
clientType?: string;
|
|
21
|
-
}
|
|
22
|
-
export interface ServerStartMetric {
|
|
23
|
-
timestamp: number;
|
|
24
|
-
serverName: string;
|
|
25
|
-
durationMs: number;
|
|
26
|
-
success: boolean;
|
|
27
|
-
}
|
|
28
|
-
export interface InstantMetrics {
|
|
29
|
-
timestamp: number;
|
|
30
|
-
totalToolCalls: number;
|
|
31
|
-
totalApiCalls: number;
|
|
32
|
-
totalErrors: number;
|
|
33
|
-
avgToolDurationMs: number;
|
|
34
|
-
topTools: Array<{
|
|
35
|
-
name: string;
|
|
36
|
-
count: number;
|
|
37
|
-
}>;
|
|
38
|
-
topServers: Array<{
|
|
39
|
-
name: string;
|
|
40
|
-
count: number;
|
|
41
|
-
}>;
|
|
42
|
-
topClients: Array<{
|
|
43
|
-
type: string;
|
|
44
|
-
count: number;
|
|
45
|
-
}>;
|
|
46
|
-
}
|
|
47
|
-
export interface HourlyStats {
|
|
48
|
-
hour: string;
|
|
49
|
-
toolCallCount: number;
|
|
50
|
-
errorCount: number;
|
|
51
|
-
avgDurationMs: number;
|
|
52
|
-
topTools: Array<{
|
|
53
|
-
name: string;
|
|
54
|
-
count: number;
|
|
55
|
-
}>;
|
|
56
|
-
}
|
|
57
|
-
export interface DailyStats {
|
|
58
|
-
date: string;
|
|
59
|
-
toolCallCount: number;
|
|
60
|
-
errorCount: number;
|
|
61
|
-
avgDurationMs: number;
|
|
62
|
-
topTools: Array<{
|
|
63
|
-
name: string;
|
|
64
|
-
count: number;
|
|
65
|
-
}>;
|
|
66
|
-
topServers: Array<{
|
|
67
|
-
name: string;
|
|
68
|
-
count: number;
|
|
69
|
-
}>;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Global metrics collector with in-memory storage
|
|
73
|
-
* Async background writes to disk (non-blocking)
|
|
74
|
-
*/
|
|
75
|
-
export declare class GlobalMetrics {
|
|
76
|
-
private toolCalls;
|
|
77
|
-
private apiCalls;
|
|
78
|
-
private serverStarts;
|
|
79
|
-
private maxMemoryMetrics;
|
|
80
|
-
private writeQueue;
|
|
81
|
-
/**
|
|
82
|
-
* Record a tool call metric
|
|
83
|
-
*/
|
|
84
|
-
recordToolCall(serverName: string, toolName: string, durationMs: number, isError?: boolean, clientType?: string, sessionId?: string): void;
|
|
85
|
-
/**
|
|
86
|
-
* Record an API call metric
|
|
87
|
-
*/
|
|
88
|
-
recordApiCall(method: string, path: string, durationMs: number, statusCode: number, clientType?: string): void;
|
|
89
|
-
/**
|
|
90
|
-
* Record a server start metric
|
|
91
|
-
*/
|
|
92
|
-
recordServerStart(serverName: string, durationMs: number, success?: boolean): void;
|
|
93
|
-
/**
|
|
94
|
-
* Get instant metrics (current state)
|
|
95
|
-
*/
|
|
96
|
-
getInstantMetrics(): InstantMetrics;
|
|
97
|
-
/**
|
|
98
|
-
* Get hourly aggregated metrics
|
|
99
|
-
*/
|
|
100
|
-
getHourlyMetrics(hoursBack?: number): HourlyStats[];
|
|
101
|
-
/**
|
|
102
|
-
* Get daily aggregated metrics
|
|
103
|
-
*/
|
|
104
|
-
getDailyMetrics(daysBack?: number): DailyStats[];
|
|
105
|
-
/**
|
|
106
|
-
* Export metrics in Prometheus format
|
|
107
|
-
*/
|
|
108
|
-
exportPrometheus(): string;
|
|
109
|
-
/**
|
|
110
|
-
* Get metrics statistics for debugging
|
|
111
|
-
*/
|
|
112
|
-
getStats(): {
|
|
113
|
-
toolCallsInMemory: number;
|
|
114
|
-
apiCallsInMemory: number;
|
|
115
|
-
serverStartsInMemory: number;
|
|
116
|
-
};
|
|
117
|
-
/**
|
|
118
|
-
* Queue an async write to disk (non-blocking)
|
|
119
|
-
*/
|
|
120
|
-
private queueMetricsWrite;
|
|
121
|
-
/**
|
|
122
|
-
* Flush pending writes (call before shutdown)
|
|
123
|
-
*/
|
|
124
|
-
flush(): Promise<void>;
|
|
125
|
-
/**
|
|
126
|
-
* Clear all metrics
|
|
127
|
-
*/
|
|
128
|
-
clear(): void;
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Global metrics instance (singleton)
|
|
132
|
-
*/
|
|
133
|
-
export declare const globalMetrics: GlobalMetrics;
|
|
134
|
-
//# sourceMappingURL=metrics.d.ts.map
|
|
@@ -1 +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AE,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,OAAc,GAAG,IAAI;IAiBxF;;OAEG;IACH,iBAAiB,IAAI,cAAc;IA0CnC;;OAEG;IACH,gBAAgB,CAAC,SAAS,GAAE,MAAW,GAAG,WAAW,EAAE;IA+CvD;;OAEG;IACH,eAAe,CAAC,QAAQ,GAAE,MAAU,GAAG,UAAU,EAAE;IAqDnD;;OAEG;IACH,gBAAgB,IAAI,MAAM;IA2B1B;;OAEG;IACH,QAAQ,IAAI;QACV,iBAAiB,EAAE,MAAM,CAAC;QAC1B,gBAAgB,EAAE,MAAM,CAAC;QACzB,oBAAoB,EAAE,MAAM,CAAC;KAC9B;IAQD;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAUzB;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B;;OAEG;IACH,KAAK,IAAI,IAAI;CAKd;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,eAAsB,CAAC"}
|
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* v1.2.0: Metrics System
|
|
3
|
-
* Comprehensive telemetry tracking for tool calls, API requests, and server performance
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Global metrics collector with in-memory storage
|
|
7
|
-
* Async background writes to disk (non-blocking)
|
|
8
|
-
*/
|
|
9
|
-
export class GlobalMetrics {
|
|
10
|
-
constructor() {
|
|
11
|
-
this.toolCalls = [];
|
|
12
|
-
this.apiCalls = [];
|
|
13
|
-
this.serverStarts = [];
|
|
14
|
-
this.maxMemoryMetrics = 1000; // Keep last 1000 metrics in memory
|
|
15
|
-
this.writeQueue = Promise.resolve();
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Record a tool call metric
|
|
19
|
-
*/
|
|
20
|
-
recordToolCall(serverName, toolName, durationMs, isError = false, clientType, sessionId) {
|
|
21
|
-
const metric = {
|
|
22
|
-
timestamp: Date.now(),
|
|
23
|
-
serverName,
|
|
24
|
-
toolName,
|
|
25
|
-
durationMs,
|
|
26
|
-
isError,
|
|
27
|
-
clientType,
|
|
28
|
-
sessionId
|
|
29
|
-
};
|
|
30
|
-
this.toolCalls.push(metric);
|
|
31
|
-
// Keep memory bounded
|
|
32
|
-
if (this.toolCalls.length > this.maxMemoryMetrics) {
|
|
33
|
-
this.toolCalls = this.toolCalls.slice(-this.maxMemoryMetrics);
|
|
34
|
-
}
|
|
35
|
-
// Queue async write (don't wait)
|
|
36
|
-
this.queueMetricsWrite();
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Record an API call metric
|
|
40
|
-
*/
|
|
41
|
-
recordApiCall(method, path, durationMs, statusCode, clientType) {
|
|
42
|
-
const metric = {
|
|
43
|
-
timestamp: Date.now(),
|
|
44
|
-
method,
|
|
45
|
-
path,
|
|
46
|
-
durationMs,
|
|
47
|
-
statusCode,
|
|
48
|
-
clientType
|
|
49
|
-
};
|
|
50
|
-
this.apiCalls.push(metric);
|
|
51
|
-
if (this.apiCalls.length > this.maxMemoryMetrics) {
|
|
52
|
-
this.apiCalls = this.apiCalls.slice(-this.maxMemoryMetrics);
|
|
53
|
-
}
|
|
54
|
-
this.queueMetricsWrite();
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Record a server start metric
|
|
58
|
-
*/
|
|
59
|
-
recordServerStart(serverName, durationMs, success = true) {
|
|
60
|
-
const metric = {
|
|
61
|
-
timestamp: Date.now(),
|
|
62
|
-
serverName,
|
|
63
|
-
durationMs,
|
|
64
|
-
success
|
|
65
|
-
};
|
|
66
|
-
this.serverStarts.push(metric);
|
|
67
|
-
if (this.serverStarts.length > this.maxMemoryMetrics) {
|
|
68
|
-
this.serverStarts = this.serverStarts.slice(-this.maxMemoryMetrics);
|
|
69
|
-
}
|
|
70
|
-
this.queueMetricsWrite();
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Get instant metrics (current state)
|
|
74
|
-
*/
|
|
75
|
-
getInstantMetrics() {
|
|
76
|
-
const toolCallsByName = new Map();
|
|
77
|
-
const serversByName = new Map();
|
|
78
|
-
const clientsByType = new Map();
|
|
79
|
-
let totalErrors = 0;
|
|
80
|
-
let totalDuration = 0;
|
|
81
|
-
for (const call of this.toolCalls) {
|
|
82
|
-
const key = `${call.serverName}-${call.toolName}`;
|
|
83
|
-
toolCallsByName.set(key, (toolCallsByName.get(key) || 0) + 1);
|
|
84
|
-
serversByName.set(call.serverName, (serversByName.get(call.serverName) || 0) + 1);
|
|
85
|
-
if (call.clientType) {
|
|
86
|
-
clientsByType.set(call.clientType, (clientsByType.get(call.clientType) || 0) + 1);
|
|
87
|
-
}
|
|
88
|
-
if (call.isError)
|
|
89
|
-
totalErrors++;
|
|
90
|
-
totalDuration += call.durationMs;
|
|
91
|
-
}
|
|
92
|
-
const sortByCount = (map, limit = 5) => {
|
|
93
|
-
return Array.from(map.entries())
|
|
94
|
-
.sort((a, b) => b[1] - a[1])
|
|
95
|
-
.slice(0, limit)
|
|
96
|
-
.map(([name, count]) => ({ name, count }));
|
|
97
|
-
};
|
|
98
|
-
const topClientsArray = Array.from(clientsByType.entries())
|
|
99
|
-
.sort((a, b) => b[1] - a[1])
|
|
100
|
-
.slice(0, 5)
|
|
101
|
-
.map(([type, count]) => ({ type, count }));
|
|
102
|
-
return {
|
|
103
|
-
timestamp: Date.now(),
|
|
104
|
-
totalToolCalls: this.toolCalls.length,
|
|
105
|
-
totalApiCalls: this.apiCalls.length,
|
|
106
|
-
totalErrors,
|
|
107
|
-
avgToolDurationMs: this.toolCalls.length > 0 ? totalDuration / this.toolCalls.length : 0,
|
|
108
|
-
topTools: sortByCount(toolCallsByName),
|
|
109
|
-
topServers: sortByCount(serversByName),
|
|
110
|
-
topClients: topClientsArray
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Get hourly aggregated metrics
|
|
115
|
-
*/
|
|
116
|
-
getHourlyMetrics(hoursBack = 24) {
|
|
117
|
-
const now = Date.now();
|
|
118
|
-
const hourMs = 60 * 60 * 1000;
|
|
119
|
-
const hourly = new Map();
|
|
120
|
-
// Group calls by hour
|
|
121
|
-
for (const call of this.toolCalls) {
|
|
122
|
-
const age = now - call.timestamp;
|
|
123
|
-
if (age > hoursBack * hourMs)
|
|
124
|
-
continue;
|
|
125
|
-
const hourStart = Math.floor(call.timestamp / hourMs) * hourMs;
|
|
126
|
-
const hourKey = new Date(hourStart).toISOString();
|
|
127
|
-
if (!hourly.has(hourKey)) {
|
|
128
|
-
hourly.set(hourKey, { calls: [] });
|
|
129
|
-
}
|
|
130
|
-
hourly.get(hourKey).calls.push(call);
|
|
131
|
-
}
|
|
132
|
-
// Aggregate
|
|
133
|
-
return Array.from(hourly.entries())
|
|
134
|
-
.map(([hour, data]) => {
|
|
135
|
-
const toolsByName = new Map();
|
|
136
|
-
let totalErrors = 0;
|
|
137
|
-
let totalDuration = 0;
|
|
138
|
-
for (const call of data.calls) {
|
|
139
|
-
const key = `${call.serverName}-${call.toolName}`;
|
|
140
|
-
toolsByName.set(key, (toolsByName.get(key) || 0) + 1);
|
|
141
|
-
if (call.isError)
|
|
142
|
-
totalErrors++;
|
|
143
|
-
totalDuration += call.durationMs;
|
|
144
|
-
}
|
|
145
|
-
return {
|
|
146
|
-
hour,
|
|
147
|
-
toolCallCount: data.calls.length,
|
|
148
|
-
errorCount: totalErrors,
|
|
149
|
-
avgDurationMs: data.calls.length > 0 ? totalDuration / data.calls.length : 0,
|
|
150
|
-
topTools: Array.from(toolsByName.entries())
|
|
151
|
-
.sort((a, b) => b[1] - a[1])
|
|
152
|
-
.slice(0, 5)
|
|
153
|
-
.map(([name, count]) => ({ name, count }))
|
|
154
|
-
};
|
|
155
|
-
})
|
|
156
|
-
.sort((a, b) => a.hour.localeCompare(b.hour));
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Get daily aggregated metrics
|
|
160
|
-
*/
|
|
161
|
-
getDailyMetrics(daysBack = 7) {
|
|
162
|
-
const now = Date.now();
|
|
163
|
-
const dayMs = 24 * 60 * 60 * 1000;
|
|
164
|
-
const daily = new Map();
|
|
165
|
-
// Group calls by day
|
|
166
|
-
for (const call of this.toolCalls) {
|
|
167
|
-
const age = now - call.timestamp;
|
|
168
|
-
if (age > daysBack * dayMs)
|
|
169
|
-
continue;
|
|
170
|
-
const dayStart = Math.floor(call.timestamp / dayMs) * dayMs;
|
|
171
|
-
const dayKey = new Date(dayStart).toISOString().split('T')[0];
|
|
172
|
-
if (!daily.has(dayKey)) {
|
|
173
|
-
daily.set(dayKey, { calls: [] });
|
|
174
|
-
}
|
|
175
|
-
daily.get(dayKey).calls.push(call);
|
|
176
|
-
}
|
|
177
|
-
// Aggregate
|
|
178
|
-
return Array.from(daily.entries())
|
|
179
|
-
.map(([date, data]) => {
|
|
180
|
-
const toolsByName = new Map();
|
|
181
|
-
const serversByName = new Map();
|
|
182
|
-
let totalErrors = 0;
|
|
183
|
-
let totalDuration = 0;
|
|
184
|
-
for (const call of data.calls) {
|
|
185
|
-
const toolKey = `${call.serverName}-${call.toolName}`;
|
|
186
|
-
toolsByName.set(toolKey, (toolsByName.get(toolKey) || 0) + 1);
|
|
187
|
-
serversByName.set(call.serverName, (serversByName.get(call.serverName) || 0) + 1);
|
|
188
|
-
if (call.isError)
|
|
189
|
-
totalErrors++;
|
|
190
|
-
totalDuration += call.durationMs;
|
|
191
|
-
}
|
|
192
|
-
return {
|
|
193
|
-
date,
|
|
194
|
-
toolCallCount: data.calls.length,
|
|
195
|
-
errorCount: totalErrors,
|
|
196
|
-
avgDurationMs: data.calls.length > 0 ? totalDuration / data.calls.length : 0,
|
|
197
|
-
topTools: Array.from(toolsByName.entries())
|
|
198
|
-
.sort((a, b) => b[1] - a[1])
|
|
199
|
-
.slice(0, 5)
|
|
200
|
-
.map(([name, count]) => ({ name, count })),
|
|
201
|
-
topServers: Array.from(serversByName.entries())
|
|
202
|
-
.sort((a, b) => b[1] - a[1])
|
|
203
|
-
.slice(0, 5)
|
|
204
|
-
.map(([name, count]) => ({ name, count }))
|
|
205
|
-
};
|
|
206
|
-
})
|
|
207
|
-
.sort((a, b) => a.date.localeCompare(b.date));
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Export metrics in Prometheus format
|
|
211
|
-
*/
|
|
212
|
-
exportPrometheus() {
|
|
213
|
-
const instant = this.getInstantMetrics();
|
|
214
|
-
const lines = [];
|
|
215
|
-
lines.push('# HELP metalink_tool_calls_total Total number of tool calls');
|
|
216
|
-
lines.push('# TYPE metalink_tool_calls_total counter');
|
|
217
|
-
lines.push(`metalink_tool_calls_total ${instant.totalToolCalls}`);
|
|
218
|
-
lines.push('# HELP metalink_tool_errors_total Total number of tool errors');
|
|
219
|
-
lines.push('# TYPE metalink_tool_errors_total counter');
|
|
220
|
-
lines.push(`metalink_tool_errors_total ${instant.totalErrors}`);
|
|
221
|
-
lines.push('# HELP metalink_tool_duration_ms_avg Average tool execution duration');
|
|
222
|
-
lines.push('# TYPE metalink_tool_duration_ms_avg gauge');
|
|
223
|
-
lines.push(`metalink_tool_duration_ms_avg ${instant.avgToolDurationMs}`);
|
|
224
|
-
lines.push('# HELP metalink_api_calls_total Total number of API calls');
|
|
225
|
-
lines.push('# TYPE metalink_api_calls_total counter');
|
|
226
|
-
lines.push(`metalink_api_calls_total ${instant.totalApiCalls}`);
|
|
227
|
-
for (const { name, count } of instant.topTools) {
|
|
228
|
-
lines.push(`metalink_tool_calls{tool="${name}"} ${count}`);
|
|
229
|
-
}
|
|
230
|
-
return lines.join('\n');
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Get metrics statistics for debugging
|
|
234
|
-
*/
|
|
235
|
-
getStats() {
|
|
236
|
-
return {
|
|
237
|
-
toolCallsInMemory: this.toolCalls.length,
|
|
238
|
-
apiCallsInMemory: this.apiCalls.length,
|
|
239
|
-
serverStartsInMemory: this.serverStarts.length
|
|
240
|
-
};
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Queue an async write to disk (non-blocking)
|
|
244
|
-
*/
|
|
245
|
-
queueMetricsWrite() {
|
|
246
|
-
// In a real implementation, this would write to SQLite/disk
|
|
247
|
-
// For now, we keep metrics in memory with bounded size
|
|
248
|
-
// This is acceptable for v1.2.0 as persistence is optional
|
|
249
|
-
this.writeQueue = this.writeQueue.then(() => {
|
|
250
|
-
// Async write would happen here
|
|
251
|
-
// await metricsStore.saveBatch(this.toolCalls, this.apiCalls);
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Flush pending writes (call before shutdown)
|
|
256
|
-
*/
|
|
257
|
-
async flush() {
|
|
258
|
-
await this.writeQueue;
|
|
259
|
-
}
|
|
260
|
-
/**
|
|
261
|
-
* Clear all metrics
|
|
262
|
-
*/
|
|
263
|
-
clear() {
|
|
264
|
-
this.toolCalls = [];
|
|
265
|
-
this.apiCalls = [];
|
|
266
|
-
this.serverStarts = [];
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* Global metrics instance (singleton)
|
|
271
|
-
*/
|
|
272
|
-
export const globalMetrics = new GlobalMetrics();
|
|
273
|
-
//# sourceMappingURL=metrics.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/server/metrics.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAwDH;;;GAGG;AACH,MAAM,OAAO,aAAa;IAA1B;QACU,cAAS,GAAqB,EAAE,CAAC;QACjC,aAAQ,GAAoB,EAAE,CAAC;QAC/B,iBAAY,GAAwB,EAAE,CAAC;QACvC,qBAAgB,GAAW,IAAI,CAAC,CAAC,mCAAmC;QACpE,eAAU,GAAkB,OAAO,CAAC,OAAO,EAAE,CAAC;IAkTxD,CAAC;IAhTC;;OAEG;IACH,cAAc,CACZ,UAAkB,EAClB,QAAgB,EAChB,UAAkB,EAClB,UAAmB,KAAK,EACxB,UAAmB,EACnB,SAAkB;QAElB,MAAM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