@checkstack/common 0.6.5 → 0.7.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/CHANGELOG.md +10 -0
- package/package.json +1 -1
- package/src/chart-types.ts +63 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @checkstack/common
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 8d1ef12: Phase 2 of anomaly detection: trend drift detection.
|
|
8
|
+
|
|
9
|
+
The background baseline analyzer now computes a linear regression slope across each field's chronologically-ordered history and runs a `detectDrift` evaluator that catches gradual "creeping degradation" never reaching the 3σ spike threshold. Drifts share the same `anomalies` table as spike anomalies via a new `kind` column (`spike` | `drift`, default `spike`); the existing suspicious → anomaly → recovered lifecycle is reused, ticking at the analyzer's hourly cadence with a default 2-run confirmation window.
|
|
10
|
+
|
|
11
|
+
User-facing additions: a Trend Drift toggle and threshold slider on both the template and assignment anomaly settings panels (with per-field overrides), drift rows in the System Anomaly widget, dashed regression-line overlays on the auto-generated line charts, and a new `ANOMALY_TREND_DETECTED` signal for live UI updates. Plugin authors can disable drift per chartable field via `x-anomaly-drift-enabled: false` or tighten/loosen it via `x-anomaly-drift-threshold`.
|
|
12
|
+
|
|
3
13
|
## 0.6.5
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/package.json
CHANGED
package/src/chart-types.ts
CHANGED
|
@@ -23,12 +23,9 @@ export type ChartType =
|
|
|
23
23
|
| "status";
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
27
|
-
* Provides autocompletion for chart-related metadata on result fields.
|
|
26
|
+
* Base metadata for all health check result schema fields.
|
|
28
27
|
*/
|
|
29
|
-
export interface
|
|
30
|
-
/** The type of chart to render for this field */
|
|
31
|
-
"x-chart-type"?: ChartType;
|
|
28
|
+
export interface BaseHealthResultMeta {
|
|
32
29
|
/** Human-readable label for the chart (defaults to field name) */
|
|
33
30
|
"x-chart-label"?: string;
|
|
34
31
|
/** Unit suffix for values (e.g., 'ms', '%', 'req/s') */
|
|
@@ -40,4 +37,65 @@ export interface HealthResultMeta {
|
|
|
40
37
|
* Ephemeral fields are stripped before storing results in the database.
|
|
41
38
|
*/
|
|
42
39
|
"x-ephemeral"?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Sensitivity multiplier for this field (default: 1.0).
|
|
42
|
+
* Higher values = fewer alerts (wider threshold).
|
|
43
|
+
* Lower values = more alerts (tighter threshold).
|
|
44
|
+
* Applied as: threshold = μ ± (3σ × sensitivity)
|
|
45
|
+
*/
|
|
46
|
+
"x-anomaly-sensitivity"?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Override the default confirmation window for this field.
|
|
49
|
+
* Number of consecutive anomalous data points required before an alert is raised.
|
|
50
|
+
*/
|
|
51
|
+
"x-anomaly-confirmation-window"?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Enable trend drift detection for this field. Default true (when anomaly
|
|
54
|
+
* detection is enabled). Set false to suppress drift alerts but keep spike
|
|
55
|
+
* detection active.
|
|
56
|
+
*/
|
|
57
|
+
"x-anomaly-drift-enabled"?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Sigma multiplier on the drift trigger band (default 2). Drift fires when
|
|
60
|
+
* |slope × sampleCount| > threshold × σ × sensitivity.
|
|
61
|
+
*/
|
|
62
|
+
"x-anomaly-drift-threshold"?: number;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Metadata for a field that exposes a chart AND has anomaly detection enabled.
|
|
67
|
+
*/
|
|
68
|
+
export interface ChartMetaAnomalyEnabled extends BaseHealthResultMeta {
|
|
69
|
+
"x-chart-type": ChartType;
|
|
70
|
+
"x-anomaly-enabled": true;
|
|
71
|
+
"x-anomaly-direction": "higher-is-better" | "lower-is-better" | "deviation" | "dominance";
|
|
43
72
|
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Metadata for a field that exposes a chart but explicitly disables anomaly detection.
|
|
76
|
+
*/
|
|
77
|
+
export interface ChartMetaAnomalyDisabled extends BaseHealthResultMeta {
|
|
78
|
+
"x-chart-type": ChartType;
|
|
79
|
+
"x-anomaly-enabled": false;
|
|
80
|
+
"x-anomaly-direction"?: never;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Metadata for a field that does NOT expose a chart.
|
|
85
|
+
*/
|
|
86
|
+
export interface NonChartMeta extends BaseHealthResultMeta {
|
|
87
|
+
"x-chart-type"?: never;
|
|
88
|
+
"x-anomaly-enabled"?: never;
|
|
89
|
+
"x-anomaly-direction"?: never;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Metadata type for health check result schemas.
|
|
94
|
+
* Provides autocompletion and enforces that ANY field exposing a chart
|
|
95
|
+
* MUST explicitly define its anomaly behavior.
|
|
96
|
+
*/
|
|
97
|
+
export type HealthResultMeta =
|
|
98
|
+
| ChartMetaAnomalyEnabled
|
|
99
|
+
| ChartMetaAnomalyDisabled
|
|
100
|
+
| NonChartMeta;
|
|
101
|
+
|