@platformatic/runtime 2.12.0 → 2.13.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 CHANGED
@@ -5,7 +5,7 @@
5
5
  * and run json-schema-to-typescript to regenerate this file.
6
6
  */
7
7
 
8
- export type HttpsSchemasPlatformaticDevPlatformaticRuntime2120Json = {
8
+ export type HttpsSchemasPlatformaticDevPlatformaticRuntime2130Json = {
9
9
  [k: string]: unknown;
10
10
  } & {
11
11
  $schema?: string;
@@ -199,7 +199,7 @@ export interface OpenTelemetry {
199
199
  }[];
200
200
  exporter?:
201
201
  | {
202
- type?: "console" | "otlp" | "zipkin" | "memory";
202
+ type?: "console" | "otlp" | "zipkin" | "memory" | "file";
203
203
  /**
204
204
  * Options for the exporter. These are passed directly to the exporter.
205
205
  */
@@ -214,13 +214,17 @@ export interface OpenTelemetry {
214
214
  headers?: {
215
215
  [k: string]: unknown;
216
216
  };
217
+ /**
218
+ * The path to write the traces to. Only for file exporter.
219
+ */
220
+ path?: string;
217
221
  [k: string]: unknown;
218
222
  };
219
223
  additionalProperties?: never;
220
224
  [k: string]: unknown;
221
225
  }[]
222
226
  | {
223
- type?: "console" | "otlp" | "zipkin" | "memory";
227
+ type?: "console" | "otlp" | "zipkin" | "memory" | "file";
224
228
  /**
225
229
  * Options for the exporter. These are passed directly to the exporter.
226
230
  */
@@ -235,6 +239,10 @@ export interface OpenTelemetry {
235
239
  headers?: {
236
240
  [k: string]: unknown;
237
241
  };
242
+ /**
243
+ * The path to write the traces to. Only for file exporter.
244
+ */
245
+ path?: string;
238
246
  [k: string]: unknown;
239
247
  };
240
248
  additionalProperties?: never;
@@ -16,6 +16,8 @@ const { wire } = require('undici-thread-interceptor')
16
16
  const { PlatformaticApp } = require('./app')
17
17
  const { setupITC } = require('./itc')
18
18
  const loadInterceptors = require('./interceptors')
19
+ const { createTelemetryThreadInterceptorHooks } = require('@platformatic/telemetry')
20
+
19
21
  const {
20
22
  MessagePortWritable,
21
23
  createPinoWritable,
@@ -97,8 +99,10 @@ async function main () {
97
99
 
98
100
  setGlobalDispatcher(globalDispatcher)
99
101
 
102
+ const { telemetry } = service
103
+ const hooks = telemetry ? createTelemetryThreadInterceptorHooks() : {}
100
104
  // Setup mesh networker
101
- const threadDispatcher = wire({ port: parentPort, useNetwork: service.useHttp, timeout: config.serviceTimeout })
105
+ const threadDispatcher = wire({ port: parentPort, useNetwork: service.useHttp, timeout: config.serviceTimeout, ...hooks })
102
106
 
103
107
  // If the service is an entrypoint and runtime server config is defined, use it.
104
108
  let serverConfig = null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/runtime",
3
- "version": "2.12.0",
3
+ "version": "2.13.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -35,12 +35,12 @@
35
35
  "typescript": "^5.5.4",
36
36
  "undici-oidc-interceptor": "^0.5.0",
37
37
  "why-is-node-running": "^2.2.2",
38
- "@platformatic/composer": "2.12.0",
39
- "@platformatic/db": "2.12.0",
40
- "@platformatic/service": "2.12.0",
41
- "@platformatic/node": "2.12.0",
42
- "@platformatic/sql-mapper": "2.12.0",
43
- "@platformatic/sql-graphql": "2.12.0"
38
+ "@platformatic/composer": "2.13.0",
39
+ "@platformatic/db": "2.13.0",
40
+ "@platformatic/node": "2.13.0",
41
+ "@platformatic/service": "2.13.0",
42
+ "@platformatic/sql-graphql": "2.13.0",
43
+ "@platformatic/sql-mapper": "2.13.0"
44
44
  },
45
45
  "dependencies": {
46
46
  "@fastify/error": "^4.0.0",
@@ -70,13 +70,13 @@
70
70
  "undici": "^6.9.0",
71
71
  "undici-thread-interceptor": "^0.9.0",
72
72
  "ws": "^8.16.0",
73
- "@platformatic/basic": "2.12.0",
74
- "@platformatic/config": "2.12.0",
75
- "@platformatic/generators": "2.12.0",
76
- "@platformatic/utils": "2.12.0",
77
- "@platformatic/itc": "2.12.0",
78
- "@platformatic/ts-compiler": "2.12.0",
79
- "@platformatic/telemetry": "2.12.0"
73
+ "@platformatic/basic": "2.13.0",
74
+ "@platformatic/generators": "2.13.0",
75
+ "@platformatic/itc": "2.13.0",
76
+ "@platformatic/config": "2.13.0",
77
+ "@platformatic/telemetry": "2.13.0",
78
+ "@platformatic/utils": "2.13.0",
79
+ "@platformatic/ts-compiler": "2.13.0"
80
80
  },
81
81
  "scripts": {
82
82
  "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.12.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/runtime/2.13.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "type": "object",
5
5
  "properties": {
@@ -980,7 +980,8 @@
980
980
  "console",
981
981
  "otlp",
982
982
  "zipkin",
983
- "memory"
983
+ "memory",
984
+ "file"
984
985
  ],
985
986
  "default": "console"
986
987
  },
@@ -995,6 +996,10 @@
995
996
  "headers": {
996
997
  "type": "object",
997
998
  "description": "Headers to send to the exporter. Not used for console or memory exporters."
999
+ },
1000
+ "path": {
1001
+ "type": "string",
1002
+ "description": "The path to write the traces to. Only for file exporter."
998
1003
  }
999
1004
  }
1000
1005
  },
@@ -1011,7 +1016,8 @@
1011
1016
  "console",
1012
1017
  "otlp",
1013
1018
  "zipkin",
1014
- "memory"
1019
+ "memory",
1020
+ "file"
1015
1021
  ],
1016
1022
  "default": "console"
1017
1023
  },
@@ -1026,6 +1032,10 @@
1026
1032
  "headers": {
1027
1033
  "type": "object",
1028
1034
  "description": "Headers to send to the exporter. Not used for console or memory exporters."
1035
+ },
1036
+ "path": {
1037
+ "type": "string",
1038
+ "description": "The path to write the traces to. Only for file exporter."
1029
1039
  }
1030
1040
  }
1031
1041
  },