@checkstack/healthcheck-postgres-backend 0.2.9 → 0.2.10

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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @checkstack/healthcheck-postgres-backend
2
2
 
3
+ ## 0.2.10
4
+
5
+ ### Patch Changes
6
+
7
+ - 8d1ef12: ## Downstream consumer bumps for the anomaly detection + cache system rollout
8
+
9
+ Packages on this branch were updated as part of the anomaly detection feature (schema annotations on result fields, plugin metadata for the modular cache system) but were not listed in the upstream changesets.
10
+
11
+ - **`@checkstack/healthcheck-common`** (minor) — new RPC contract additions and schema changes supporting per-field anomaly metadata.
12
+ - **`@checkstack/cache-memory-common`** (minor) — new package providing access rules + plugin metadata for the in-memory cache backend.
13
+ - **healthcheck plugins** (patch) — adopt the new `x-anomaly-*` schema annotations on their result fields so anomaly detection works automatically against their checks. No public API changes.
14
+ - **integration / notification / auth / queue / collector plugins** (patch) — minor internal updates as consumers of upstream API changes (cache plugin registry, schema additions). No public API changes.
15
+
16
+ - Updated dependencies [8d1ef12]
17
+ - Updated dependencies [8d1ef12]
18
+ - Updated dependencies [8d1ef12]
19
+ - @checkstack/healthcheck-common@0.12.0
20
+ - @checkstack/common@0.7.0
21
+ - @checkstack/backend-api@0.13.0
22
+
3
23
  ## 0.2.9
4
24
 
5
25
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/healthcheck-postgres-backend",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "checkstack": {
@@ -12,9 +12,9 @@
12
12
  "lint:code": "eslint . --max-warnings 0"
13
13
  },
14
14
  "dependencies": {
15
- "@checkstack/backend-api": "0.11.1",
15
+ "@checkstack/backend-api": "0.12.0",
16
16
  "@checkstack/common": "0.6.5",
17
- "@checkstack/healthcheck-common": "0.10.1",
17
+ "@checkstack/healthcheck-common": "0.11.0",
18
18
  "pg": "^8.11.0"
19
19
  },
20
20
  "devDependencies": {
@@ -7,13 +7,13 @@ describe("QueryCollector", () => {
7
7
  response: {
8
8
  rowCount?: number;
9
9
  error?: string;
10
- } = {}
10
+ } = {},
11
11
  ): PostgresTransportClient => ({
12
12
  exec: mock(() =>
13
13
  Promise.resolve({
14
14
  rowCount: response.rowCount ?? 1,
15
15
  error: response.error,
16
- })
16
+ }),
17
17
  ),
18
18
  });
19
19
 
@@ -37,15 +37,23 @@ const queryResultSchema = healthResultSchema({
37
37
  rowCount: healthResultNumber({
38
38
  "x-chart-type": "counter",
39
39
  "x-chart-label": "Row Count",
40
+ "x-anomaly-enabled": true,
41
+ "x-anomaly-direction": "deviation",
40
42
  }),
41
43
  executionTimeMs: healthResultNumber({
42
44
  "x-chart-type": "line",
43
45
  "x-chart-label": "Execution Time",
44
46
  "x-chart-unit": "ms",
47
+ "x-anomaly-enabled": true,
48
+ "x-anomaly-direction": "lower-is-better",
49
+ "x-anomaly-sensitivity": 2,
50
+ "x-anomaly-confirmation-window": 3,
45
51
  }),
46
52
  success: healthResultBoolean({
47
53
  "x-chart-type": "boolean",
48
54
  "x-chart-label": "Success",
55
+ "x-anomaly-enabled": true,
56
+ "x-anomaly-direction": "dominance",
49
57
  }),
50
58
  });
51
59
 
@@ -57,11 +65,15 @@ const queryAggregatedFields = {
57
65
  "x-chart-type": "line",
58
66
  "x-chart-label": "Avg Execution Time",
59
67
  "x-chart-unit": "ms",
68
+ "x-anomaly-enabled": true,
69
+ "x-anomaly-direction": "lower-is-better",
60
70
  }),
61
71
  successRate: aggregatedRate({
62
72
  "x-chart-type": "gauge",
63
73
  "x-chart-label": "Success Rate",
64
74
  "x-chart-unit": "%",
75
+ "x-anomaly-enabled": true,
76
+ "x-anomaly-direction": "higher-is-better",
65
77
  }),
66
78
  };
67
79
 
package/src/strategy.ts CHANGED
@@ -65,15 +65,22 @@ const postgresResultSchema = healthResultSchema({
65
65
  connected: healthResultBoolean({
66
66
  "x-chart-type": "boolean",
67
67
  "x-chart-label": "Connected",
68
+ "x-anomaly-enabled": true,
69
+ "x-anomaly-direction": "dominance",
68
70
  }),
69
71
  connectionTimeMs: healthResultNumber({
70
72
  "x-chart-type": "line",
71
73
  "x-chart-label": "Connection Time",
72
74
  "x-chart-unit": "ms",
75
+ "x-anomaly-enabled": true,
76
+ "x-anomaly-direction": "lower-is-better",
77
+ "x-anomaly-sensitivity": 2,
78
+ "x-anomaly-confirmation-window": 3,
73
79
  }),
74
80
  error: healthResultString({
75
81
  "x-chart-type": "status",
76
82
  "x-chart-label": "Error",
83
+ "x-anomaly-enabled": false,
77
84
  }).optional(),
78
85
  });
79
86
 
@@ -85,20 +92,28 @@ const postgresAggregatedFields = {
85
92
  "x-chart-type": "line",
86
93
  "x-chart-label": "Avg Connection Time",
87
94
  "x-chart-unit": "ms",
95
+ "x-anomaly-enabled": true,
96
+ "x-anomaly-direction": "lower-is-better",
88
97
  }),
89
98
  maxConnectionTime: aggregatedMinMax({
90
99
  "x-chart-type": "line",
91
100
  "x-chart-label": "Max Connection Time",
92
101
  "x-chart-unit": "ms",
102
+ "x-anomaly-enabled": true,
103
+ "x-anomaly-direction": "lower-is-better",
93
104
  }),
94
105
  successRate: aggregatedRate({
95
106
  "x-chart-type": "gauge",
96
107
  "x-chart-label": "Success Rate",
97
108
  "x-chart-unit": "%",
109
+ "x-anomaly-enabled": true,
110
+ "x-anomaly-direction": "higher-is-better",
98
111
  }),
99
112
  errorCount: aggregatedCounter({
100
113
  "x-chart-type": "counter",
101
114
  "x-chart-label": "Errors",
115
+ "x-anomaly-enabled": true,
116
+ "x-anomaly-direction": "lower-is-better",
102
117
  }),
103
118
  };
104
119