@platformatic/runtime 1.31.1 → 1.33.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.
@@ -0,0 +1,4 @@
1
+ {
2
+ "name": "test-runtime-package",
3
+ "version": "1.0.42"
4
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://platformatic.dev/schemas/v1.22.0/runtime",
3
+ "entrypoint": "service-1",
4
+ "allowCycles": true,
5
+ "hotReload": false,
6
+ "autoload": {
7
+ "path": "./services"
8
+ },
9
+ "server": {
10
+ "hostname": "127.0.0.1",
11
+ "port": 0
12
+ },
13
+ "managementApi": true
14
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://platformatic.dev/schemas/v1.22.0/service",
3
+ "service": {
4
+ "openapi": true
5
+ },
6
+ "watch": true,
7
+ "metrics": false
8
+ }
@@ -22,5 +22,6 @@
22
22
  }
23
23
  }
24
24
  ]
25
- }
25
+ },
26
+ "metrics": false
26
27
  }
package/lib/api-client.js CHANGED
@@ -107,6 +107,8 @@ class RuntimeApiClient extends EventEmitter {
107
107
  async getFormattedMetrics () {
108
108
  const { metrics } = await this.getMetrics()
109
109
 
110
+ if (metrics === null) return null
111
+
110
112
  const entrypointDetails = await this.getEntrypointDetails()
111
113
  const entrypointConfig = await this.getServiceConfig(entrypointDetails.id)
112
114
  const entrypointMetricsPrefix = entrypointConfig.metrics?.prefix
package/lib/api.js CHANGED
@@ -299,7 +299,7 @@ class RuntimeApi {
299
299
 
300
300
  const promRegister = entrypoint.server.metrics?.client?.register
301
301
  if (!promRegister) {
302
- return null
302
+ return { metrics: null }
303
303
  }
304
304
 
305
305
  // All runtime services shares the same metrics registry.
package/lib/app.js CHANGED
@@ -246,7 +246,10 @@ class PlatformaticApp {
246
246
  })
247
247
  }
248
248
 
249
- if (this.#hasManagementApi || configManager.current.metrics) {
249
+ if (
250
+ (this.#hasManagementApi && configManager.current.metrics === undefined) ||
251
+ configManager.current.metrics
252
+ ) {
250
253
  configManager.update({
251
254
  ...configManager.current,
252
255
  metrics: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/runtime",
3
- "version": "1.31.1",
3
+ "version": "1.33.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -29,12 +29,12 @@
29
29
  "snazzy": "^9.0.0",
30
30
  "split2": "^4.2.0",
31
31
  "standard": "^17.1.0",
32
- "tsd": "^0.30.7",
32
+ "tsd": "^0.31.0",
33
33
  "typescript": "^5.4.2",
34
34
  "undici-oidc-interceptor": "^0.5.0",
35
35
  "why-is-node-running": "^2.2.2",
36
- "@platformatic/sql-graphql": "1.31.1",
37
- "@platformatic/sql-mapper": "1.31.1"
36
+ "@platformatic/sql-graphql": "1.33.0",
37
+ "@platformatic/sql-mapper": "1.33.0"
38
38
  },
39
39
  "dependencies": {
40
40
  "ws": "^8.16.0",
@@ -62,13 +62,13 @@
62
62
  "tail-file-stream": "^0.1.0",
63
63
  "undici": "^6.9.0",
64
64
  "why-is-node-running": "^2.2.2",
65
- "@platformatic/composer": "1.31.1",
66
- "@platformatic/config": "1.31.1",
67
- "@platformatic/db": "1.31.1",
68
- "@platformatic/generators": "1.31.1",
69
- "@platformatic/service": "1.31.1",
70
- "@platformatic/telemetry": "1.31.1",
71
- "@platformatic/utils": "1.31.1"
65
+ "@platformatic/composer": "1.33.0",
66
+ "@platformatic/config": "1.33.0",
67
+ "@platformatic/db": "1.33.0",
68
+ "@platformatic/telemetry": "1.33.0",
69
+ "@platformatic/service": "1.33.0",
70
+ "@platformatic/generators": "1.33.0",
71
+ "@platformatic/utils": "1.33.0"
72
72
  },
73
73
  "standard": {
74
74
  "ignore": [