@platformatic/runtime 3.13.0 → 3.14.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 +71 -4
- package/index.d.ts +6 -1
- package/index.js +1 -1
- package/lib/config.js +118 -72
- package/lib/dynamic-workers-scaler.js +218 -0
- package/lib/errors.js +21 -0
- package/lib/logger.js +4 -2
- package/lib/prom-server.js +2 -4
- package/lib/runtime.js +448 -476
- package/lib/scaling-algorithm.js +26 -31
- package/lib/worker/controller.js +15 -8
- package/lib/worker/health-signals.js +80 -0
- package/lib/worker/main.js +8 -5
- package/lib/worker/messaging.js +0 -6
- package/lib/worker/round-robin-map.js +39 -41
- package/lib/worker/symbols.js +4 -1
- package/package.json +15 -15
- package/schema.json +180 -22
package/schema.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://schemas.platformatic.dev/@platformatic/runtime/3.
|
|
2
|
+
"$id": "https://schemas.platformatic.dev/@platformatic/runtime/3.14.0.json",
|
|
3
3
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
4
|
"title": "Platformatic Runtime Config",
|
|
5
5
|
"type": "object",
|
|
@@ -67,11 +67,27 @@
|
|
|
67
67
|
"workers": {
|
|
68
68
|
"anyOf": [
|
|
69
69
|
{
|
|
70
|
-
"type": "number"
|
|
71
|
-
"minimum": 1
|
|
70
|
+
"type": "number"
|
|
72
71
|
},
|
|
73
72
|
{
|
|
74
73
|
"type": "string"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"type": "object",
|
|
77
|
+
"properties": {
|
|
78
|
+
"static": {
|
|
79
|
+
"type": "number",
|
|
80
|
+
"minimum": 1
|
|
81
|
+
},
|
|
82
|
+
"minimum": {
|
|
83
|
+
"type": "number",
|
|
84
|
+
"minimum": 1
|
|
85
|
+
},
|
|
86
|
+
"maximum": {
|
|
87
|
+
"type": "number",
|
|
88
|
+
"minimum": 0
|
|
89
|
+
}
|
|
90
|
+
}
|
|
75
91
|
}
|
|
76
92
|
]
|
|
77
93
|
},
|
|
@@ -329,11 +345,27 @@
|
|
|
329
345
|
"workers": {
|
|
330
346
|
"anyOf": [
|
|
331
347
|
{
|
|
332
|
-
"type": "number"
|
|
333
|
-
"minimum": 1
|
|
348
|
+
"type": "number"
|
|
334
349
|
},
|
|
335
350
|
{
|
|
336
351
|
"type": "string"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"type": "object",
|
|
355
|
+
"properties": {
|
|
356
|
+
"static": {
|
|
357
|
+
"type": "number",
|
|
358
|
+
"minimum": 1
|
|
359
|
+
},
|
|
360
|
+
"minimum": {
|
|
361
|
+
"type": "number",
|
|
362
|
+
"minimum": 1
|
|
363
|
+
},
|
|
364
|
+
"maximum": {
|
|
365
|
+
"type": "number",
|
|
366
|
+
"minimum": 0
|
|
367
|
+
}
|
|
368
|
+
}
|
|
337
369
|
}
|
|
338
370
|
]
|
|
339
371
|
},
|
|
@@ -589,11 +621,27 @@
|
|
|
589
621
|
"workers": {
|
|
590
622
|
"anyOf": [
|
|
591
623
|
{
|
|
592
|
-
"type": "number"
|
|
593
|
-
"minimum": 1
|
|
624
|
+
"type": "number"
|
|
594
625
|
},
|
|
595
626
|
{
|
|
596
627
|
"type": "string"
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
"type": "object",
|
|
631
|
+
"properties": {
|
|
632
|
+
"static": {
|
|
633
|
+
"type": "number",
|
|
634
|
+
"minimum": 1
|
|
635
|
+
},
|
|
636
|
+
"minimum": {
|
|
637
|
+
"type": "number",
|
|
638
|
+
"minimum": 1
|
|
639
|
+
},
|
|
640
|
+
"maximum": {
|
|
641
|
+
"type": "number",
|
|
642
|
+
"minimum": 0
|
|
643
|
+
}
|
|
644
|
+
}
|
|
597
645
|
}
|
|
598
646
|
]
|
|
599
647
|
},
|
|
@@ -849,11 +897,27 @@
|
|
|
849
897
|
"workers": {
|
|
850
898
|
"anyOf": [
|
|
851
899
|
{
|
|
852
|
-
"type": "number"
|
|
853
|
-
"minimum": 1
|
|
900
|
+
"type": "number"
|
|
854
901
|
},
|
|
855
902
|
{
|
|
856
903
|
"type": "string"
|
|
904
|
+
},
|
|
905
|
+
{
|
|
906
|
+
"type": "object",
|
|
907
|
+
"properties": {
|
|
908
|
+
"static": {
|
|
909
|
+
"type": "number",
|
|
910
|
+
"minimum": 1
|
|
911
|
+
},
|
|
912
|
+
"minimum": {
|
|
913
|
+
"type": "number",
|
|
914
|
+
"minimum": 1
|
|
915
|
+
},
|
|
916
|
+
"maximum": {
|
|
917
|
+
"type": "number",
|
|
918
|
+
"minimum": 0
|
|
919
|
+
}
|
|
920
|
+
}
|
|
857
921
|
}
|
|
858
922
|
]
|
|
859
923
|
},
|
|
@@ -1074,6 +1138,43 @@
|
|
|
1074
1138
|
},
|
|
1075
1139
|
{
|
|
1076
1140
|
"type": "string"
|
|
1141
|
+
},
|
|
1142
|
+
{
|
|
1143
|
+
"type": "object",
|
|
1144
|
+
"properties": {
|
|
1145
|
+
"static": {
|
|
1146
|
+
"type": "number",
|
|
1147
|
+
"minimum": 1
|
|
1148
|
+
},
|
|
1149
|
+
"dynamic": {
|
|
1150
|
+
"type": "boolean",
|
|
1151
|
+
"default": false
|
|
1152
|
+
},
|
|
1153
|
+
"minimum": {
|
|
1154
|
+
"type": "number",
|
|
1155
|
+
"minimum": 1
|
|
1156
|
+
},
|
|
1157
|
+
"maximum": {
|
|
1158
|
+
"type": "number",
|
|
1159
|
+
"minimum": 0
|
|
1160
|
+
},
|
|
1161
|
+
"total": {
|
|
1162
|
+
"type": "number",
|
|
1163
|
+
"minimum": 1
|
|
1164
|
+
},
|
|
1165
|
+
"maxMemory": {
|
|
1166
|
+
"type": "number",
|
|
1167
|
+
"minimum": 0
|
|
1168
|
+
},
|
|
1169
|
+
"cooldown": {
|
|
1170
|
+
"type": "number",
|
|
1171
|
+
"minimum": 0
|
|
1172
|
+
},
|
|
1173
|
+
"gracePeriod": {
|
|
1174
|
+
"type": "number",
|
|
1175
|
+
"minimum": 0
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1077
1178
|
}
|
|
1078
1179
|
]
|
|
1079
1180
|
},
|
|
@@ -1854,6 +1955,58 @@
|
|
|
1854
1955
|
}
|
|
1855
1956
|
],
|
|
1856
1957
|
"default": 10000
|
|
1958
|
+
},
|
|
1959
|
+
"otlpExporter": {
|
|
1960
|
+
"type": "object",
|
|
1961
|
+
"description": "Configuration for exporting metrics to an OTLP endpoint",
|
|
1962
|
+
"properties": {
|
|
1963
|
+
"enabled": {
|
|
1964
|
+
"anyOf": [
|
|
1965
|
+
{
|
|
1966
|
+
"type": "boolean"
|
|
1967
|
+
},
|
|
1968
|
+
{
|
|
1969
|
+
"type": "string"
|
|
1970
|
+
}
|
|
1971
|
+
],
|
|
1972
|
+
"description": "Enable or disable OTLP metrics export"
|
|
1973
|
+
},
|
|
1974
|
+
"endpoint": {
|
|
1975
|
+
"type": "string",
|
|
1976
|
+
"description": "OTLP endpoint URL (e.g., http://collector:4318/v1/metrics)"
|
|
1977
|
+
},
|
|
1978
|
+
"interval": {
|
|
1979
|
+
"anyOf": [
|
|
1980
|
+
{
|
|
1981
|
+
"type": "integer"
|
|
1982
|
+
},
|
|
1983
|
+
{
|
|
1984
|
+
"type": "string"
|
|
1985
|
+
}
|
|
1986
|
+
],
|
|
1987
|
+
"default": 60000,
|
|
1988
|
+
"description": "Interval in milliseconds between metric pushes"
|
|
1989
|
+
},
|
|
1990
|
+
"headers": {
|
|
1991
|
+
"type": "object",
|
|
1992
|
+
"additionalProperties": {
|
|
1993
|
+
"type": "string"
|
|
1994
|
+
},
|
|
1995
|
+
"description": "Additional HTTP headers for authentication"
|
|
1996
|
+
},
|
|
1997
|
+
"serviceName": {
|
|
1998
|
+
"type": "string",
|
|
1999
|
+
"description": "Service name for OTLP resource attributes"
|
|
2000
|
+
},
|
|
2001
|
+
"serviceVersion": {
|
|
2002
|
+
"type": "string",
|
|
2003
|
+
"description": "Service version for OTLP resource attributes"
|
|
2004
|
+
}
|
|
2005
|
+
},
|
|
2006
|
+
"required": [
|
|
2007
|
+
"endpoint"
|
|
2008
|
+
],
|
|
2009
|
+
"additionalProperties": false
|
|
1857
2010
|
}
|
|
1858
2011
|
},
|
|
1859
2012
|
"additionalProperties": false
|
|
@@ -2013,35 +2166,40 @@
|
|
|
2013
2166
|
"type": "number",
|
|
2014
2167
|
"minimum": 1
|
|
2015
2168
|
},
|
|
2169
|
+
"cooldownSec": {
|
|
2170
|
+
"type": "number",
|
|
2171
|
+
"minimum": 0
|
|
2172
|
+
},
|
|
2173
|
+
"gracePeriod": {
|
|
2174
|
+
"type": "number",
|
|
2175
|
+
"minimum": 0
|
|
2176
|
+
},
|
|
2016
2177
|
"scaleUpELU": {
|
|
2017
2178
|
"type": "number",
|
|
2018
2179
|
"minimum": 0,
|
|
2019
|
-
"maximum": 1
|
|
2180
|
+
"maximum": 1,
|
|
2181
|
+
"deprecated": true
|
|
2020
2182
|
},
|
|
2021
2183
|
"scaleDownELU": {
|
|
2022
2184
|
"type": "number",
|
|
2023
2185
|
"minimum": 0,
|
|
2024
|
-
"maximum": 1
|
|
2186
|
+
"maximum": 1,
|
|
2187
|
+
"deprecated": true
|
|
2025
2188
|
},
|
|
2026
2189
|
"timeWindowSec": {
|
|
2027
2190
|
"type": "number",
|
|
2028
|
-
"minimum": 0
|
|
2191
|
+
"minimum": 0,
|
|
2192
|
+
"deprecated": true
|
|
2029
2193
|
},
|
|
2030
2194
|
"scaleDownTimeWindowSec": {
|
|
2031
2195
|
"type": "number",
|
|
2032
|
-
"minimum": 0
|
|
2033
|
-
|
|
2034
|
-
"cooldownSec": {
|
|
2035
|
-
"type": "number",
|
|
2036
|
-
"minimum": 0
|
|
2196
|
+
"minimum": 0,
|
|
2197
|
+
"deprecated": true
|
|
2037
2198
|
},
|
|
2038
2199
|
"scaleIntervalSec": {
|
|
2039
2200
|
"type": "number",
|
|
2040
|
-
"minimum": 0
|
|
2041
|
-
|
|
2042
|
-
"gracePeriod": {
|
|
2043
|
-
"type": "number",
|
|
2044
|
-
"minimum": 0
|
|
2201
|
+
"minimum": 0,
|
|
2202
|
+
"deprecated": true
|
|
2045
2203
|
},
|
|
2046
2204
|
"applications": {
|
|
2047
2205
|
"type": "object",
|