@platformatic/db 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.
Files changed (3) hide show
  1. package/config.d.ts +62 -3
  2. package/package.json +12 -12
  3. package/schema.json +126 -16
package/config.d.ts CHANGED
@@ -483,7 +483,20 @@ export interface PlatformaticDatabaseConfig {
483
483
  services?: {
484
484
  [k: string]: unknown;
485
485
  }[];
486
- workers?: number | string;
486
+ workers?:
487
+ | number
488
+ | string
489
+ | {
490
+ static?: number;
491
+ dynamic?: boolean;
492
+ minimum?: number;
493
+ maximum?: number;
494
+ total?: number;
495
+ maxMemory?: number;
496
+ cooldown?: number;
497
+ gracePeriod?: number;
498
+ [k: string]: unknown;
499
+ };
487
500
  workersRestartDelay?: number | string;
488
501
  logger?: {
489
502
  level: (
@@ -691,6 +704,37 @@ export interface PlatformaticDatabaseConfig {
691
704
  };
692
705
  plugins?: string[];
693
706
  timeout?: number | string;
707
+ /**
708
+ * Configuration for exporting metrics to an OTLP endpoint
709
+ */
710
+ otlpExporter?: {
711
+ /**
712
+ * Enable or disable OTLP metrics export
713
+ */
714
+ enabled?: boolean | string;
715
+ /**
716
+ * OTLP endpoint URL (e.g., http://collector:4318/v1/metrics)
717
+ */
718
+ endpoint: string;
719
+ /**
720
+ * Interval in milliseconds between metric pushes
721
+ */
722
+ interval?: number | string;
723
+ /**
724
+ * Additional HTTP headers for authentication
725
+ */
726
+ headers?: {
727
+ [k: string]: string;
728
+ };
729
+ /**
730
+ * Service name for OTLP resource attributes
731
+ */
732
+ serviceName?: string;
733
+ /**
734
+ * Service version for OTLP resource attributes
735
+ */
736
+ serviceVersion?: string;
737
+ };
694
738
  };
695
739
  telemetry?: {
696
740
  enabled?: boolean | string;
@@ -774,13 +818,28 @@ export interface PlatformaticDatabaseConfig {
774
818
  maxTotalMemory?: number;
775
819
  minWorkers?: number;
776
820
  maxWorkers?: number;
821
+ cooldownSec?: number;
822
+ gracePeriod?: number;
823
+ /**
824
+ * @deprecated
825
+ */
777
826
  scaleUpELU?: number;
827
+ /**
828
+ * @deprecated
829
+ */
778
830
  scaleDownELU?: number;
831
+ /**
832
+ * @deprecated
833
+ */
779
834
  timeWindowSec?: number;
835
+ /**
836
+ * @deprecated
837
+ */
780
838
  scaleDownTimeWindowSec?: number;
781
- cooldownSec?: number;
839
+ /**
840
+ * @deprecated
841
+ */
782
842
  scaleIntervalSec?: number;
783
- gracePeriod?: number;
784
843
  };
785
844
  inspectorOptions?: {
786
845
  host?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/db",
3
- "version": "3.13.0",
3
+ "version": "3.14.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -66,17 +66,17 @@
66
66
  "rfdc": "^1.3.1",
67
67
  "rimraf": "^4.4.1",
68
68
  "semgrator": "^0.3.0",
69
- "@platformatic/basic": "3.13.0",
70
- "@platformatic/db-authorization": "3.13.0",
71
- "@platformatic/db-core": "3.13.0",
72
- "@platformatic/foundation": "3.13.0",
73
- "@platformatic/service": "3.13.0",
74
- "@platformatic/sql-events": "3.13.0",
75
- "@platformatic/sql-graphql": "3.13.0",
76
- "@platformatic/sql-json-schema-mapper": "3.13.0",
77
- "@platformatic/sql-mapper": "3.13.0",
78
- "@platformatic/telemetry": "3.13.0",
79
- "@platformatic/sql-openapi": "3.13.0"
69
+ "@platformatic/basic": "3.14.0",
70
+ "@platformatic/foundation": "3.14.0",
71
+ "@platformatic/db-authorization": "3.14.0",
72
+ "@platformatic/sql-events": "3.14.0",
73
+ "@platformatic/db-core": "3.14.0",
74
+ "@platformatic/service": "3.14.0",
75
+ "@platformatic/sql-graphql": "3.14.0",
76
+ "@platformatic/sql-json-schema-mapper": "3.14.0",
77
+ "@platformatic/sql-mapper": "3.14.0",
78
+ "@platformatic/sql-openapi": "3.14.0",
79
+ "@platformatic/telemetry": "3.14.0"
80
80
  },
81
81
  "engines": {
82
82
  "node": ">=22.19.0"
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/db/3.13.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/db/3.14.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Database Config",
5
5
  "type": "object",
@@ -1368,11 +1368,27 @@
1368
1368
  "workers": {
1369
1369
  "anyOf": [
1370
1370
  {
1371
- "type": "number",
1372
- "minimum": 1
1371
+ "type": "number"
1373
1372
  },
1374
1373
  {
1375
1374
  "type": "string"
1375
+ },
1376
+ {
1377
+ "type": "object",
1378
+ "properties": {
1379
+ "static": {
1380
+ "type": "number",
1381
+ "minimum": 1
1382
+ },
1383
+ "minimum": {
1384
+ "type": "number",
1385
+ "minimum": 1
1386
+ },
1387
+ "maximum": {
1388
+ "type": "number",
1389
+ "minimum": 0
1390
+ }
1391
+ }
1376
1392
  }
1377
1393
  ]
1378
1394
  },
@@ -1593,6 +1609,43 @@
1593
1609
  },
1594
1610
  {
1595
1611
  "type": "string"
1612
+ },
1613
+ {
1614
+ "type": "object",
1615
+ "properties": {
1616
+ "static": {
1617
+ "type": "number",
1618
+ "minimum": 1
1619
+ },
1620
+ "dynamic": {
1621
+ "type": "boolean",
1622
+ "default": false
1623
+ },
1624
+ "minimum": {
1625
+ "type": "number",
1626
+ "minimum": 1
1627
+ },
1628
+ "maximum": {
1629
+ "type": "number",
1630
+ "minimum": 0
1631
+ },
1632
+ "total": {
1633
+ "type": "number",
1634
+ "minimum": 1
1635
+ },
1636
+ "maxMemory": {
1637
+ "type": "number",
1638
+ "minimum": 0
1639
+ },
1640
+ "cooldown": {
1641
+ "type": "number",
1642
+ "minimum": 0
1643
+ },
1644
+ "gracePeriod": {
1645
+ "type": "number",
1646
+ "minimum": 0
1647
+ }
1648
+ }
1596
1649
  }
1597
1650
  ]
1598
1651
  },
@@ -2369,6 +2422,58 @@
2369
2422
  }
2370
2423
  ],
2371
2424
  "default": 10000
2425
+ },
2426
+ "otlpExporter": {
2427
+ "type": "object",
2428
+ "description": "Configuration for exporting metrics to an OTLP endpoint",
2429
+ "properties": {
2430
+ "enabled": {
2431
+ "anyOf": [
2432
+ {
2433
+ "type": "boolean"
2434
+ },
2435
+ {
2436
+ "type": "string"
2437
+ }
2438
+ ],
2439
+ "description": "Enable or disable OTLP metrics export"
2440
+ },
2441
+ "endpoint": {
2442
+ "type": "string",
2443
+ "description": "OTLP endpoint URL (e.g., http://collector:4318/v1/metrics)"
2444
+ },
2445
+ "interval": {
2446
+ "anyOf": [
2447
+ {
2448
+ "type": "integer"
2449
+ },
2450
+ {
2451
+ "type": "string"
2452
+ }
2453
+ ],
2454
+ "default": 60000,
2455
+ "description": "Interval in milliseconds between metric pushes"
2456
+ },
2457
+ "headers": {
2458
+ "type": "object",
2459
+ "additionalProperties": {
2460
+ "type": "string"
2461
+ },
2462
+ "description": "Additional HTTP headers for authentication"
2463
+ },
2464
+ "serviceName": {
2465
+ "type": "string",
2466
+ "description": "Service name for OTLP resource attributes"
2467
+ },
2468
+ "serviceVersion": {
2469
+ "type": "string",
2470
+ "description": "Service version for OTLP resource attributes"
2471
+ }
2472
+ },
2473
+ "required": [
2474
+ "endpoint"
2475
+ ],
2476
+ "additionalProperties": false
2372
2477
  }
2373
2478
  },
2374
2479
  "additionalProperties": false
@@ -2528,35 +2633,40 @@
2528
2633
  "type": "number",
2529
2634
  "minimum": 1
2530
2635
  },
2636
+ "cooldownSec": {
2637
+ "type": "number",
2638
+ "minimum": 0
2639
+ },
2640
+ "gracePeriod": {
2641
+ "type": "number",
2642
+ "minimum": 0
2643
+ },
2531
2644
  "scaleUpELU": {
2532
2645
  "type": "number",
2533
2646
  "minimum": 0,
2534
- "maximum": 1
2647
+ "maximum": 1,
2648
+ "deprecated": true
2535
2649
  },
2536
2650
  "scaleDownELU": {
2537
2651
  "type": "number",
2538
2652
  "minimum": 0,
2539
- "maximum": 1
2653
+ "maximum": 1,
2654
+ "deprecated": true
2540
2655
  },
2541
2656
  "timeWindowSec": {
2542
2657
  "type": "number",
2543
- "minimum": 0
2658
+ "minimum": 0,
2659
+ "deprecated": true
2544
2660
  },
2545
2661
  "scaleDownTimeWindowSec": {
2546
2662
  "type": "number",
2547
- "minimum": 0
2548
- },
2549
- "cooldownSec": {
2550
- "type": "number",
2551
- "minimum": 0
2663
+ "minimum": 0,
2664
+ "deprecated": true
2552
2665
  },
2553
2666
  "scaleIntervalSec": {
2554
2667
  "type": "number",
2555
- "minimum": 0
2556
- },
2557
- "gracePeriod": {
2558
- "type": "number",
2559
- "minimum": 0
2668
+ "minimum": 0,
2669
+ "deprecated": true
2560
2670
  }
2561
2671
  },
2562
2672
  "additionalProperties": false