@platformatic/runtime 2.35.1 → 2.36.2

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 CHANGED
@@ -5,7 +5,7 @@
5
5
  * and run json-schema-to-typescript to regenerate this file.
6
6
  */
7
7
 
8
- export type HttpsSchemasPlatformaticDevPlatformaticRuntime2351Json = {
8
+ export type HttpsSchemasPlatformaticDevPlatformaticRuntime2362Json = {
9
9
  [k: string]: unknown;
10
10
  } & {
11
11
  $schema?: string;
@@ -31,6 +31,7 @@ export type HttpsSchemasPlatformaticDevPlatformaticRuntime2351Json = {
31
31
  maxHeapTotal?: number | string;
32
32
  };
33
33
  preload?: string | string[];
34
+ arguments?: string[];
34
35
  nodeOptions?: string;
35
36
  };
36
37
  };
package/lib/runtime.js CHANGED
@@ -975,6 +975,7 @@ class Runtime extends EventEmitter {
975
975
  if (config.telemetry) {
976
976
  serviceConfig.telemetry = {
977
977
  ...config.telemetry,
978
+ ...serviceConfig.telemetry,
978
979
  serviceName: `${config.telemetry.serviceName}-${serviceConfig.id}`
979
980
  }
980
981
  }
@@ -984,7 +985,10 @@ class Runtime extends EventEmitter {
984
985
 
985
986
  const execArgv = []
986
987
 
987
- if (!serviceConfig.isPLTService) {
988
+ if (!serviceConfig.isPLTService && config.telemetry) {
989
+ // We need the following because otherwise some open telemetry instrumentations won't work with ESM (like express)
990
+ // see: https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/esm-support.md#instrumentation-hook-required-for-esm
991
+ execArgv.push('--experimental-loader', '@opentelemetry/instrumentation/hook.mjs')
988
992
  execArgv.push('--require', openTelemetrySetupPath)
989
993
  }
990
994
 
@@ -1018,6 +1022,7 @@ class Runtime extends EventEmitter {
1018
1022
  runtimeLogsDir: this.#runtimeLogsDir,
1019
1023
  loggingPort
1020
1024
  },
1025
+ argv: serviceConfig.arguments,
1021
1026
  execArgv,
1022
1027
  env: workerEnv,
1023
1028
  transferList: [loggingPort],
package/lib/schema.js CHANGED
@@ -66,6 +66,12 @@ const services = {
66
66
  },
67
67
  workers,
68
68
  health: { ...health, default: undefined },
69
+ arguments: {
70
+ type: 'array',
71
+ items: {
72
+ type: 'string'
73
+ }
74
+ },
69
75
  env,
70
76
  envfile: {
71
77
  type: 'string'
@@ -81,6 +87,38 @@ const services = {
81
87
  preload,
82
88
  nodeOptions: {
83
89
  type: 'string'
90
+ },
91
+ telemetry: {
92
+ type: 'object',
93
+ properties: {
94
+ instrumentations: {
95
+ type: 'array',
96
+ description: 'An array of instrumentations loaded if telemetry is enabled',
97
+ items: {
98
+ oneOf: [
99
+ {
100
+ type: 'string'
101
+ },
102
+ {
103
+ type: 'object',
104
+ properties: {
105
+ package: {
106
+ type: 'string'
107
+ },
108
+ exportName: {
109
+ type: 'string'
110
+ },
111
+ options: {
112
+ type: 'object',
113
+ additionalProperties: true
114
+ }
115
+ },
116
+ required: ['package']
117
+ }
118
+ ]
119
+ }
120
+ }
121
+ }
84
122
  }
85
123
  }
86
124
  }
@@ -138,6 +176,12 @@ const platformaticRuntimeSchema = {
138
176
  workers,
139
177
  health: { ...health, default: undefined },
140
178
  preload,
179
+ arguments: {
180
+ type: 'array',
181
+ items: {
182
+ type: 'string'
183
+ }
184
+ },
141
185
  nodeOptions: {
142
186
  type: 'string'
143
187
  }
@@ -69,8 +69,8 @@ function createLogger () {
69
69
 
70
70
  const loggerInstance = pino(pinoOptions, destination)
71
71
 
72
- Reflect.defineProperty(process, 'stdout', { value: createPinoWritable(loggerInstance, 'info') })
73
- Reflect.defineProperty(process, 'stderr', { value: createPinoWritable(loggerInstance, 'error') })
72
+ Reflect.defineProperty(process, 'stdout', { value: createPinoWritable(loggerInstance, 'info', false, 'STDOUT') })
73
+ Reflect.defineProperty(process, 'stderr', { value: createPinoWritable(loggerInstance, 'error', false, 'STDERR') })
74
74
 
75
75
  return loggerInstance
76
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/runtime",
3
- "version": "2.35.1",
3
+ "version": "2.36.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -36,12 +36,12 @@
36
36
  "typescript": "^5.5.4",
37
37
  "undici-oidc-interceptor": "^0.5.0",
38
38
  "why-is-node-running": "^2.2.2",
39
- "@platformatic/composer": "2.35.1",
40
- "@platformatic/db": "2.35.1",
41
- "@platformatic/service": "2.35.1",
42
- "@platformatic/node": "2.35.1",
43
- "@platformatic/sql-graphql": "2.35.1",
44
- "@platformatic/sql-mapper": "2.35.1"
39
+ "@platformatic/composer": "2.36.2",
40
+ "@platformatic/db": "2.36.2",
41
+ "@platformatic/service": "2.36.2",
42
+ "@platformatic/sql-graphql": "2.36.2",
43
+ "@platformatic/sql-mapper": "2.36.2",
44
+ "@platformatic/node": "2.36.2"
45
45
  },
46
46
  "dependencies": {
47
47
  "@fastify/accepts": "^5.0.0",
@@ -75,13 +75,13 @@
75
75
  "undici": "^7.0.0",
76
76
  "undici-thread-interceptor": "^0.11.0",
77
77
  "ws": "^8.16.0",
78
- "@platformatic/basic": "2.35.1",
79
- "@platformatic/generators": "2.35.1",
80
- "@platformatic/config": "2.35.1",
81
- "@platformatic/itc": "2.35.1",
82
- "@platformatic/telemetry": "2.35.1",
83
- "@platformatic/ts-compiler": "2.35.1",
84
- "@platformatic/utils": "2.35.1"
78
+ "@platformatic/basic": "2.36.2",
79
+ "@platformatic/config": "2.36.2",
80
+ "@platformatic/generators": "2.36.2",
81
+ "@platformatic/telemetry": "2.36.2",
82
+ "@platformatic/itc": "2.36.2",
83
+ "@platformatic/ts-compiler": "2.36.2",
84
+ "@platformatic/utils": "2.36.2"
85
85
  },
86
86
  "scripts": {
87
87
  "test": "npm run lint && borp --concurrency=1 --timeout=300000 && tsd",
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/runtime/2.35.1.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/runtime/2.36.2.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "type": "object",
5
5
  "properties": {
@@ -180,6 +180,12 @@
180
180
  }
181
181
  ]
182
182
  },
183
+ "arguments": {
184
+ "type": "array",
185
+ "items": {
186
+ "type": "string"
187
+ }
188
+ },
183
189
  "nodeOptions": {
184
190
  "type": "string"
185
191
  }
@@ -330,6 +336,12 @@
330
336
  },
331
337
  "additionalProperties": false
332
338
  },
339
+ "arguments": {
340
+ "type": "array",
341
+ "items": {
342
+ "type": "string"
343
+ }
344
+ },
333
345
  "env": {
334
346
  "type": "object",
335
347
  "additionalProperties": {
@@ -368,6 +380,40 @@
368
380
  },
369
381
  "nodeOptions": {
370
382
  "type": "string"
383
+ },
384
+ "telemetry": {
385
+ "type": "object",
386
+ "properties": {
387
+ "instrumentations": {
388
+ "type": "array",
389
+ "description": "An array of instrumentations loaded if telemetry is enabled",
390
+ "items": {
391
+ "oneOf": [
392
+ {
393
+ "type": "string"
394
+ },
395
+ {
396
+ "type": "object",
397
+ "properties": {
398
+ "package": {
399
+ "type": "string"
400
+ },
401
+ "exportName": {
402
+ "type": "string"
403
+ },
404
+ "options": {
405
+ "type": "object",
406
+ "additionalProperties": true
407
+ }
408
+ },
409
+ "required": [
410
+ "package"
411
+ ]
412
+ }
413
+ ]
414
+ }
415
+ }
416
+ }
371
417
  }
372
418
  }
373
419
  }
@@ -526,6 +572,12 @@
526
572
  },
527
573
  "additionalProperties": false
528
574
  },
575
+ "arguments": {
576
+ "type": "array",
577
+ "items": {
578
+ "type": "string"
579
+ }
580
+ },
529
581
  "env": {
530
582
  "type": "object",
531
583
  "additionalProperties": {
@@ -564,6 +616,40 @@
564
616
  },
565
617
  "nodeOptions": {
566
618
  "type": "string"
619
+ },
620
+ "telemetry": {
621
+ "type": "object",
622
+ "properties": {
623
+ "instrumentations": {
624
+ "type": "array",
625
+ "description": "An array of instrumentations loaded if telemetry is enabled",
626
+ "items": {
627
+ "oneOf": [
628
+ {
629
+ "type": "string"
630
+ },
631
+ {
632
+ "type": "object",
633
+ "properties": {
634
+ "package": {
635
+ "type": "string"
636
+ },
637
+ "exportName": {
638
+ "type": "string"
639
+ },
640
+ "options": {
641
+ "type": "object",
642
+ "additionalProperties": true
643
+ }
644
+ },
645
+ "required": [
646
+ "package"
647
+ ]
648
+ }
649
+ ]
650
+ }
651
+ }
652
+ }
567
653
  }
568
654
  }
569
655
  }