@checkstack/healthcheck-tcp-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-tcp-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-tcp-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
  },
19
19
  "devDependencies": {
20
20
  "@types/bun": "^1.0.0",
@@ -8,14 +8,14 @@ describe("BannerCollector", () => {
8
8
  banner?: string;
9
9
  connected?: boolean;
10
10
  error?: string;
11
- } = {}
11
+ } = {},
12
12
  ): TcpTransportClient => ({
13
13
  exec: mock(() =>
14
14
  Promise.resolve({
15
15
  banner: response.banner,
16
16
  connected: response.connected ?? true,
17
17
  error: response.error,
18
- })
18
+ }),
19
19
  ),
20
20
  });
21
21
 
@@ -42,15 +42,22 @@ const bannerResultSchema = healthResultSchema({
42
42
  banner: healthResultString({
43
43
  "x-chart-type": "text",
44
44
  "x-chart-label": "Banner",
45
+ "x-anomaly-enabled": false,
45
46
  }).optional(),
46
47
  hasBanner: healthResultBoolean({
47
48
  "x-chart-type": "boolean",
48
49
  "x-chart-label": "Has Banner",
50
+ "x-anomaly-enabled": true,
51
+ "x-anomaly-direction": "dominance",
49
52
  }),
50
53
  readTimeMs: healthResultNumber({
51
54
  "x-chart-type": "line",
52
55
  "x-chart-label": "Read Time",
53
56
  "x-chart-unit": "ms",
57
+ "x-anomaly-enabled": true,
58
+ "x-anomaly-direction": "lower-is-better",
59
+ "x-anomaly-sensitivity": 2,
60
+ "x-anomaly-confirmation-window": 3,
54
61
  }),
55
62
  });
56
63
 
@@ -62,11 +69,15 @@ const bannerAggregatedFields = {
62
69
  "x-chart-type": "line",
63
70
  "x-chart-label": "Avg Read Time",
64
71
  "x-chart-unit": "ms",
72
+ "x-anomaly-enabled": true,
73
+ "x-anomaly-direction": "lower-is-better",
65
74
  }),
66
75
  bannerRate: aggregatedRate({
67
76
  "x-chart-type": "gauge",
68
77
  "x-chart-label": "Banner Rate",
69
78
  "x-chart-unit": "%",
79
+ "x-anomaly-enabled": true,
80
+ "x-anomaly-direction": "higher-is-better",
70
81
  }),
71
82
  };
72
83
 
@@ -7,18 +7,18 @@ describe("TcpHealthCheckStrategy", () => {
7
7
  config: {
8
8
  connectError?: Error;
9
9
  banner?: string;
10
- } = {}
10
+ } = {},
11
11
  ): SocketFactory => {
12
12
  return () =>
13
13
  ({
14
14
  connect: mock(() =>
15
15
  config.connectError
16
16
  ? Promise.reject(config.connectError)
17
- : Promise.resolve()
17
+ : Promise.resolve(),
18
18
  ),
19
19
  read: mock(() => Promise.resolve(config.banner ?? null)),
20
20
  close: mock(() => {}),
21
- } as TcpSocket);
21
+ }) as TcpSocket;
22
22
  };
23
23
 
24
24
  describe("createClient", () => {
@@ -40,7 +40,7 @@ describe("TcpHealthCheckStrategy", () => {
40
40
 
41
41
  it("should throw for connection error", async () => {
42
42
  const strategy = new TcpHealthCheckStrategy(
43
- createMockSocket({ connectError: new Error("Connection refused") })
43
+ createMockSocket({ connectError: new Error("Connection refused") }),
44
44
  );
45
45
 
46
46
  await expect(
@@ -48,7 +48,7 @@ describe("TcpHealthCheckStrategy", () => {
48
48
  host: "localhost",
49
49
  port: 12345,
50
50
  timeout: 5000,
51
- })
51
+ }),
52
52
  ).rejects.toThrow("Connection refused");
53
53
  });
54
54
  });
@@ -71,7 +71,7 @@ describe("TcpHealthCheckStrategy", () => {
71
71
 
72
72
  it("should read banner with read action", async () => {
73
73
  const strategy = new TcpHealthCheckStrategy(
74
- createMockSocket({ banner: "SSH-2.0-OpenSSH" })
74
+ createMockSocket({ banner: "SSH-2.0-OpenSSH" }),
75
75
  );
76
76
  const connectedClient = await strategy.createClient({
77
77
  host: "localhost",
package/src/strategy.ts CHANGED
@@ -57,19 +57,27 @@ const tcpResultSchema = healthResultSchema({
57
57
  connected: healthResultBoolean({
58
58
  "x-chart-type": "boolean",
59
59
  "x-chart-label": "Connected",
60
+ "x-anomaly-enabled": true,
61
+ "x-anomaly-direction": "dominance",
60
62
  }),
61
63
  connectionTimeMs: healthResultNumber({
62
64
  "x-chart-type": "line",
63
65
  "x-chart-label": "Connection Time",
64
66
  "x-chart-unit": "ms",
67
+ "x-anomaly-enabled": true,
68
+ "x-anomaly-direction": "lower-is-better",
69
+ "x-anomaly-sensitivity": 2,
70
+ "x-anomaly-confirmation-window": 3,
65
71
  }),
66
72
  banner: healthResultString({
67
73
  "x-chart-type": "text",
68
74
  "x-chart-label": "Banner",
75
+ "x-anomaly-enabled": false,
69
76
  }).optional(),
70
77
  error: healthResultString({
71
78
  "x-chart-type": "status",
72
79
  "x-chart-label": "Error",
80
+ "x-anomaly-enabled": false,
73
81
  }).optional(),
74
82
  });
75
83
 
@@ -81,15 +89,21 @@ const tcpAggregatedFields = {
81
89
  "x-chart-type": "line",
82
90
  "x-chart-label": "Avg Connection Time",
83
91
  "x-chart-unit": "ms",
92
+ "x-anomaly-enabled": true,
93
+ "x-anomaly-direction": "lower-is-better",
84
94
  }),
85
95
  successRate: aggregatedRate({
86
96
  "x-chart-type": "gauge",
87
97
  "x-chart-label": "Success Rate",
88
98
  "x-chart-unit": "%",
99
+ "x-anomaly-enabled": true,
100
+ "x-anomaly-direction": "higher-is-better",
89
101
  }),
90
102
  errorCount: aggregatedCounter({
91
103
  "x-chart-type": "counter",
92
104
  "x-chart-label": "Errors",
105
+ "x-anomaly-enabled": true,
106
+ "x-anomaly-direction": "lower-is-better",
93
107
  }),
94
108
  };
95
109