@platformatic/service 2.71.0-alpha.1 → 2.71.0
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/lib/stackable.js +61 -1
- package/package.json +11 -11
- package/schema.json +2 -2
package/lib/stackable.js
CHANGED
|
@@ -138,7 +138,7 @@ class ServiceStackable {
|
|
|
138
138
|
composer: {
|
|
139
139
|
prefix: config.basePath ?? this.basePath ?? this.context?.serviceId,
|
|
140
140
|
wantsAbsoluteUrls: false,
|
|
141
|
-
|
|
141
|
+
needsRootTrailingSlash: false,
|
|
142
142
|
tcp: !!this.app?.url,
|
|
143
143
|
url: this.app?.url
|
|
144
144
|
},
|
|
@@ -296,6 +296,66 @@ class ServiceStackable {
|
|
|
296
296
|
globalThis.platformatic.onHttpCacheMiss = () => {
|
|
297
297
|
cacheMissMetric.inc()
|
|
298
298
|
}
|
|
299
|
+
|
|
300
|
+
const httpStatsFreeMetric = new client.Gauge({
|
|
301
|
+
name: 'http_client_stats_free',
|
|
302
|
+
help: 'Number of free (idle) http clients (sockets)',
|
|
303
|
+
labelNames: ['dispatcher_stats_url'],
|
|
304
|
+
registers: [registry]
|
|
305
|
+
})
|
|
306
|
+
globalThis.platformatic.onHttpStatsFree = (url, val) => {
|
|
307
|
+
httpStatsFreeMetric.set({ dispatcher_stats_url: url }, val)
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
const httpStatsConnectedMetric = new client.Gauge({
|
|
311
|
+
name: 'http_client_stats_connected',
|
|
312
|
+
help: 'Number of open socket connections',
|
|
313
|
+
labelNames: ['dispatcher_stats_url'],
|
|
314
|
+
registers: [registry]
|
|
315
|
+
})
|
|
316
|
+
globalThis.platformatic.onHttpStatsConnected = (url, val) => {
|
|
317
|
+
httpStatsConnectedMetric.set({ dispatcher_stats_url: url }, val)
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
const httpStatsPendingMetric = new client.Gauge({
|
|
321
|
+
name: 'http_client_stats_pending',
|
|
322
|
+
help: 'Number of pending requests across all clients',
|
|
323
|
+
labelNames: ['dispatcher_stats_url'],
|
|
324
|
+
registers: [registry]
|
|
325
|
+
})
|
|
326
|
+
globalThis.platformatic.onHttpStatsPending = (url, val) => {
|
|
327
|
+
httpStatsPendingMetric.set({ dispatcher_stats_url: url }, val)
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
const httpStatsQueuedMetric = new client.Gauge({
|
|
331
|
+
name: 'http_client_stats_queued',
|
|
332
|
+
help: 'Number of queued requests across all clients',
|
|
333
|
+
labelNames: ['dispatcher_stats_url'],
|
|
334
|
+
registers: [registry]
|
|
335
|
+
})
|
|
336
|
+
globalThis.platformatic.onHttpStatsQueued = (url, val) => {
|
|
337
|
+
httpStatsQueuedMetric.set({ dispatcher_stats_url: url }, val)
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
const httpStatsRunningMetric = new client.Gauge({
|
|
341
|
+
name: 'http_client_stats_running',
|
|
342
|
+
help: 'Number of currently active requests across all clients',
|
|
343
|
+
labelNames: ['dispatcher_stats_url'],
|
|
344
|
+
registers: [registry]
|
|
345
|
+
})
|
|
346
|
+
globalThis.platformatic.onHttpStatsRunning = (url, val) => {
|
|
347
|
+
httpStatsRunningMetric.set({ dispatcher_stats_url: url }, val)
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
const httpStatsSizeMetric = new client.Gauge({
|
|
351
|
+
name: 'http_client_stats_size',
|
|
352
|
+
help: 'Number of active, pending, or queued requests across all clients',
|
|
353
|
+
labelNames: ['dispatcher_stats_url'],
|
|
354
|
+
registers: [registry]
|
|
355
|
+
})
|
|
356
|
+
globalThis.platformatic.onHttpStatsSize = (url, val) => {
|
|
357
|
+
httpStatsSizeMetric.set({ dispatcher_stats_url: url }, val)
|
|
358
|
+
}
|
|
299
359
|
}
|
|
300
360
|
|
|
301
361
|
#updateConfig () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/service",
|
|
3
|
-
"version": "2.71.0
|
|
3
|
+
"version": "2.71.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"strip-ansi": "^7.1.0",
|
|
32
32
|
"tsd": "^0.32.0",
|
|
33
33
|
"typescript": "^5.5.4",
|
|
34
|
-
"undici": "7.
|
|
34
|
+
"undici": "7.11.0",
|
|
35
35
|
"vscode-json-languageservice": "^5.3.9",
|
|
36
36
|
"why-is-node-running": "^2.2.2",
|
|
37
37
|
"yaml": "^2.4.1"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@fastify/static": "^8.0.0",
|
|
47
47
|
"@fastify/swagger": "^9.0.0",
|
|
48
48
|
"@fastify/under-pressure": "^9.0.0",
|
|
49
|
-
"@scalar/fastify-api-reference": "1.31.
|
|
49
|
+
"@scalar/fastify-api-reference": "1.31.14",
|
|
50
50
|
"@types/ws": "^8.5.10",
|
|
51
51
|
"ajv": "^8.12.0",
|
|
52
52
|
"cli-progress": "^3.12.0",
|
|
@@ -75,14 +75,14 @@
|
|
|
75
75
|
"rfdc": "^1.3.1",
|
|
76
76
|
"semgrator": "^0.3.0",
|
|
77
77
|
"undici": "^7.0.0",
|
|
78
|
-
"@platformatic/client": "2.71.0
|
|
79
|
-
"@platformatic/
|
|
80
|
-
"@platformatic/metrics": "2.71.0
|
|
81
|
-
"@platformatic/
|
|
82
|
-
"@platformatic/
|
|
83
|
-
"@platformatic/telemetry": "2.71.0
|
|
84
|
-
"@platformatic/ts-compiler": "2.71.0
|
|
85
|
-
"@platformatic/utils": "2.71.0
|
|
78
|
+
"@platformatic/client": "2.71.0",
|
|
79
|
+
"@platformatic/generators": "2.71.0",
|
|
80
|
+
"@platformatic/metrics": "2.71.0",
|
|
81
|
+
"@platformatic/scalar-theme": "2.71.0",
|
|
82
|
+
"@platformatic/config": "2.71.0",
|
|
83
|
+
"@platformatic/telemetry": "2.71.0",
|
|
84
|
+
"@platformatic/ts-compiler": "2.71.0",
|
|
85
|
+
"@platformatic/utils": "2.71.0"
|
|
86
86
|
},
|
|
87
87
|
"scripts": {
|
|
88
88
|
"test": "pnpm run lint && borp -T --concurrency=1 --timeout=1200000 && tsd",
|
package/schema.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://schemas.platformatic.dev/@platformatic/service/2.71.0
|
|
3
|
-
"version": "2.71.0
|
|
2
|
+
"$id": "https://schemas.platformatic.dev/@platformatic/service/2.71.0.json",
|
|
3
|
+
"version": "2.71.0",
|
|
4
4
|
"title": "Platformatic Service",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"properties": {
|