@platformatic/service 3.38.0 → 3.39.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 +8 -0
- package/lib/capability.js +5 -1
- package/package.json +7 -7
- package/schema.json +42 -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?: {
|
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.39.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/
|
|
73
|
-
"@platformatic/
|
|
74
|
-
"@platformatic/
|
|
75
|
-
"@platformatic/
|
|
70
|
+
"@platformatic/basic": "3.39.0",
|
|
71
|
+
"@platformatic/generators": "3.39.0",
|
|
72
|
+
"@platformatic/metrics": "3.39.0",
|
|
73
|
+
"@platformatic/foundation": "3.39.0",
|
|
74
|
+
"@platformatic/scalar-theme": "3.39.0",
|
|
75
|
+
"@platformatic/telemetry": "3.39.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.39.0.json",
|
|
3
|
+
"version": "3.39.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": {},
|
|
@@ -1559,6 +1579,26 @@
|
|
|
1559
1579
|
"customLevels": {
|
|
1560
1580
|
"type": "object",
|
|
1561
1581
|
"additionalProperties": true
|
|
1582
|
+
},
|
|
1583
|
+
"openTelemetryExporter": {
|
|
1584
|
+
"type": "object",
|
|
1585
|
+
"properties": {
|
|
1586
|
+
"protocol": {
|
|
1587
|
+
"type": "string",
|
|
1588
|
+
"enum": [
|
|
1589
|
+
"grpc",
|
|
1590
|
+
"http"
|
|
1591
|
+
]
|
|
1592
|
+
},
|
|
1593
|
+
"url": {
|
|
1594
|
+
"type": "string"
|
|
1595
|
+
}
|
|
1596
|
+
},
|
|
1597
|
+
"required": [
|
|
1598
|
+
"protocol",
|
|
1599
|
+
"url"
|
|
1600
|
+
],
|
|
1601
|
+
"additionalProperties": false
|
|
1562
1602
|
}
|
|
1563
1603
|
},
|
|
1564
1604
|
"default": {},
|