@platformatic/service 3.38.1 → 3.40.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/config.d.ts +14 -0
- package/lib/capability.js +5 -1
- package/package.json +7 -7
- package/schema.json +88 -2
package/config.d.ts
CHANGED
|
@@ -79,6 +79,10 @@ export interface PlatformaticServiceConfig {
|
|
|
79
79
|
customLevels?: {
|
|
80
80
|
[k: string]: unknown;
|
|
81
81
|
};
|
|
82
|
+
openTelemetryExporter?: {
|
|
83
|
+
protocol: "grpc" | "http";
|
|
84
|
+
url: string;
|
|
85
|
+
};
|
|
82
86
|
[k: string]: unknown;
|
|
83
87
|
};
|
|
84
88
|
loggerInstance?: {
|
|
@@ -378,6 +382,10 @@ export interface PlatformaticServiceConfig {
|
|
|
378
382
|
customLevels?: {
|
|
379
383
|
[k: string]: unknown;
|
|
380
384
|
};
|
|
385
|
+
openTelemetryExporter?: {
|
|
386
|
+
protocol: "grpc" | "http";
|
|
387
|
+
url: string;
|
|
388
|
+
};
|
|
381
389
|
[k: string]: unknown;
|
|
382
390
|
};
|
|
383
391
|
server?: {
|
|
@@ -516,6 +524,12 @@ export interface PlatformaticServiceConfig {
|
|
|
516
524
|
*/
|
|
517
525
|
socket?: string;
|
|
518
526
|
};
|
|
527
|
+
management?:
|
|
528
|
+
| boolean
|
|
529
|
+
| {
|
|
530
|
+
enabled?: boolean;
|
|
531
|
+
operations?: string[];
|
|
532
|
+
};
|
|
519
533
|
metrics?:
|
|
520
534
|
| boolean
|
|
521
535
|
| {
|
package/lib/capability.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseCapability, cleanBasePath, ensureTrailingSlash, getServerUrl } from '@platformatic/basic'
|
|
2
2
|
import { buildPinoFormatters, buildPinoTimestamp, deepmerge, isKeyEnabled } from '@platformatic/foundation'
|
|
3
|
-
import { telemetry } from '@platformatic/telemetry'
|
|
3
|
+
import { addPinoInstrumentation, telemetry } from '@platformatic/telemetry'
|
|
4
4
|
import fastify from 'fastify'
|
|
5
5
|
import { printSchema } from 'graphql'
|
|
6
6
|
import { randomUUID } from 'node:crypto'
|
|
@@ -282,6 +282,10 @@ export class ServiceCapability extends BaseCapability {
|
|
|
282
282
|
pinoOptions.timestamp = buildPinoTimestamp(this.loggerConfig?.timestamp)
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
+
if (this.loggerConfig.openTelemetryExporter && this.telemetryConfig?.enabled !== false) {
|
|
286
|
+
addPinoInstrumentation(pinoOptions)
|
|
287
|
+
}
|
|
288
|
+
|
|
285
289
|
const logger = pino(pinoOptions)
|
|
286
290
|
|
|
287
291
|
// Only one of logger and loggerInstance should be set
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/service",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.40.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -67,12 +67,12 @@
|
|
|
67
67
|
"rfdc": "^1.3.1",
|
|
68
68
|
"semgrator": "^0.3.0",
|
|
69
69
|
"undici": "^7.0.0",
|
|
70
|
-
"@platformatic/basic": "3.
|
|
71
|
-
"@platformatic/
|
|
72
|
-
"@platformatic/generators": "3.
|
|
73
|
-
"@platformatic/metrics": "3.
|
|
74
|
-
"@platformatic/
|
|
75
|
-
"@platformatic/
|
|
70
|
+
"@platformatic/basic": "3.40.0",
|
|
71
|
+
"@platformatic/scalar-theme": "3.40.0",
|
|
72
|
+
"@platformatic/generators": "3.40.0",
|
|
73
|
+
"@platformatic/metrics": "3.40.0",
|
|
74
|
+
"@platformatic/telemetry": "3.40.0",
|
|
75
|
+
"@platformatic/foundation": "3.40.0"
|
|
76
76
|
},
|
|
77
77
|
"engines": {
|
|
78
78
|
"node": ">=22.19.0"
|
package/schema.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://schemas.platformatic.dev/@platformatic/service/3.
|
|
3
|
-
"version": "3.
|
|
2
|
+
"$id": "https://schemas.platformatic.dev/@platformatic/service/3.40.0.json",
|
|
3
|
+
"version": "3.40.0",
|
|
4
4
|
"title": "Platformatic Service Config",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"properties": {
|
|
@@ -237,6 +237,26 @@
|
|
|
237
237
|
"customLevels": {
|
|
238
238
|
"type": "object",
|
|
239
239
|
"additionalProperties": true
|
|
240
|
+
},
|
|
241
|
+
"openTelemetryExporter": {
|
|
242
|
+
"type": "object",
|
|
243
|
+
"properties": {
|
|
244
|
+
"protocol": {
|
|
245
|
+
"type": "string",
|
|
246
|
+
"enum": [
|
|
247
|
+
"grpc",
|
|
248
|
+
"http"
|
|
249
|
+
]
|
|
250
|
+
},
|
|
251
|
+
"url": {
|
|
252
|
+
"type": "string"
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
"required": [
|
|
256
|
+
"protocol",
|
|
257
|
+
"url"
|
|
258
|
+
],
|
|
259
|
+
"additionalProperties": false
|
|
240
260
|
}
|
|
241
261
|
},
|
|
242
262
|
"default": {},
|
|
@@ -1340,6 +1360,29 @@
|
|
|
1340
1360
|
"additionalProperties": false
|
|
1341
1361
|
}
|
|
1342
1362
|
]
|
|
1363
|
+
},
|
|
1364
|
+
"management": {
|
|
1365
|
+
"anyOf": [
|
|
1366
|
+
{
|
|
1367
|
+
"type": "boolean"
|
|
1368
|
+
},
|
|
1369
|
+
{
|
|
1370
|
+
"type": "object",
|
|
1371
|
+
"properties": {
|
|
1372
|
+
"enabled": {
|
|
1373
|
+
"type": "boolean",
|
|
1374
|
+
"default": true
|
|
1375
|
+
},
|
|
1376
|
+
"operations": {
|
|
1377
|
+
"type": "array",
|
|
1378
|
+
"items": {
|
|
1379
|
+
"type": "string"
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
},
|
|
1383
|
+
"additionalProperties": false
|
|
1384
|
+
}
|
|
1385
|
+
]
|
|
1343
1386
|
}
|
|
1344
1387
|
}
|
|
1345
1388
|
}
|
|
@@ -1559,6 +1602,26 @@
|
|
|
1559
1602
|
"customLevels": {
|
|
1560
1603
|
"type": "object",
|
|
1561
1604
|
"additionalProperties": true
|
|
1605
|
+
},
|
|
1606
|
+
"openTelemetryExporter": {
|
|
1607
|
+
"type": "object",
|
|
1608
|
+
"properties": {
|
|
1609
|
+
"protocol": {
|
|
1610
|
+
"type": "string",
|
|
1611
|
+
"enum": [
|
|
1612
|
+
"grpc",
|
|
1613
|
+
"http"
|
|
1614
|
+
]
|
|
1615
|
+
},
|
|
1616
|
+
"url": {
|
|
1617
|
+
"type": "string"
|
|
1618
|
+
}
|
|
1619
|
+
},
|
|
1620
|
+
"required": [
|
|
1621
|
+
"protocol",
|
|
1622
|
+
"url"
|
|
1623
|
+
],
|
|
1624
|
+
"additionalProperties": false
|
|
1562
1625
|
}
|
|
1563
1626
|
},
|
|
1564
1627
|
"default": {},
|
|
@@ -2059,6 +2122,29 @@
|
|
|
2059
2122
|
],
|
|
2060
2123
|
"default": true
|
|
2061
2124
|
},
|
|
2125
|
+
"management": {
|
|
2126
|
+
"anyOf": [
|
|
2127
|
+
{
|
|
2128
|
+
"type": "boolean"
|
|
2129
|
+
},
|
|
2130
|
+
{
|
|
2131
|
+
"type": "object",
|
|
2132
|
+
"properties": {
|
|
2133
|
+
"enabled": {
|
|
2134
|
+
"type": "boolean",
|
|
2135
|
+
"default": true
|
|
2136
|
+
},
|
|
2137
|
+
"operations": {
|
|
2138
|
+
"type": "array",
|
|
2139
|
+
"items": {
|
|
2140
|
+
"type": "string"
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
},
|
|
2144
|
+
"additionalProperties": false
|
|
2145
|
+
}
|
|
2146
|
+
]
|
|
2147
|
+
},
|
|
2062
2148
|
"metrics": {
|
|
2063
2149
|
"anyOf": [
|
|
2064
2150
|
{
|