@nexload-sdk/healthcheck-prometheus 2.0.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/README.md +9 -0
- package/dist/index.cjs +225 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +200 -0
- package/dist/index.mjs.map +7 -0
- package/package.json +50 -0
package/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# @nexload-sdk/healthcheck-prometheus
|
|
2
|
+
|
|
3
|
+
Prometheus/OpenMetrics text serializers for `@nexload-sdk/healthcheck`.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { toPrometheusText } from "@nexload-sdk/healthcheck-prometheus";
|
|
7
|
+
|
|
8
|
+
const text = toPrometheusText(report, { prefix: "nexload" });
|
|
9
|
+
```
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
// @nexload-sdk/healthcheck-prometheus v1.0.0 (build 2026-06-21T16:03:28.604Z)
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/index.ts
|
|
22
|
+
var index_exports = {};
|
|
23
|
+
__export(index_exports, {
|
|
24
|
+
toOpenMetricsText: () => toOpenMetricsText,
|
|
25
|
+
toPrometheusText: () => toPrometheusText
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(index_exports);
|
|
28
|
+
var STATUSES = [
|
|
29
|
+
"ok",
|
|
30
|
+
"degraded",
|
|
31
|
+
"unhealthy"
|
|
32
|
+
];
|
|
33
|
+
var ALLOWED_LABELS = /* @__PURE__ */ new Set([
|
|
34
|
+
"service",
|
|
35
|
+
"scope",
|
|
36
|
+
"check",
|
|
37
|
+
"component",
|
|
38
|
+
"dependency",
|
|
39
|
+
"runtime",
|
|
40
|
+
"status",
|
|
41
|
+
"error_code",
|
|
42
|
+
"collector",
|
|
43
|
+
"version"
|
|
44
|
+
]);
|
|
45
|
+
function metricName(name, prefix) {
|
|
46
|
+
const normalized = name.replace(
|
|
47
|
+
/[^a-zA-Z0-9_:]/g,
|
|
48
|
+
"_"
|
|
49
|
+
).replace(
|
|
50
|
+
/_+/g,
|
|
51
|
+
"_"
|
|
52
|
+
).replace(
|
|
53
|
+
/^_+|_+$/g,
|
|
54
|
+
""
|
|
55
|
+
).toLowerCase();
|
|
56
|
+
return `${prefix}_${normalized}`;
|
|
57
|
+
}
|
|
58
|
+
function metricValue(value) {
|
|
59
|
+
if (typeof value === "number") return Number.isFinite(value) ? value : null;
|
|
60
|
+
if (typeof value === "boolean") return value ? 1 : 0;
|
|
61
|
+
if (typeof value === "string") return 1;
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
function escapeLabel(value) {
|
|
65
|
+
return value.replace(
|
|
66
|
+
/\\/g,
|
|
67
|
+
"\\\\"
|
|
68
|
+
).replace(
|
|
69
|
+
/\n/g,
|
|
70
|
+
"\\n"
|
|
71
|
+
).replace(
|
|
72
|
+
/"/g,
|
|
73
|
+
'\\"'
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
function labels(input) {
|
|
77
|
+
const entries = Object.entries(input).filter((entry) => Boolean(entry[1]) && ALLOWED_LABELS.has(entry[0])).sort(([a], [b]) => a.localeCompare(b));
|
|
78
|
+
if (entries.length === 0) return "";
|
|
79
|
+
return `{${entries.map(([
|
|
80
|
+
key,
|
|
81
|
+
value
|
|
82
|
+
]) => `${key}="${escapeLabel(value)}"`).join(",")}}`;
|
|
83
|
+
}
|
|
84
|
+
function appendMetric(lines, name, labelsInput, value) {
|
|
85
|
+
const numeric = metricValue(value);
|
|
86
|
+
if (numeric === null) return;
|
|
87
|
+
lines.push(`${name}${labels(labelsInput)} ${numeric}`);
|
|
88
|
+
}
|
|
89
|
+
function appendHealthStatus(lines, report, prefix, defaults) {
|
|
90
|
+
const name = metricName(
|
|
91
|
+
"health.status",
|
|
92
|
+
prefix
|
|
93
|
+
);
|
|
94
|
+
for (const status of STATUSES) {
|
|
95
|
+
appendMetric(
|
|
96
|
+
lines,
|
|
97
|
+
name,
|
|
98
|
+
{
|
|
99
|
+
...defaults,
|
|
100
|
+
service: report.service.name,
|
|
101
|
+
scope: report.scope,
|
|
102
|
+
status
|
|
103
|
+
},
|
|
104
|
+
report.status === status ? 1 : 0
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function appendCheckMetrics(lines, report, prefix, defaults) {
|
|
109
|
+
const statusName = metricName(
|
|
110
|
+
"health.check.status",
|
|
111
|
+
prefix
|
|
112
|
+
);
|
|
113
|
+
const durationName = metricName(
|
|
114
|
+
"health.check.duration_milliseconds",
|
|
115
|
+
prefix
|
|
116
|
+
);
|
|
117
|
+
for (const check of report.checks) {
|
|
118
|
+
for (const status of STATUSES) {
|
|
119
|
+
appendMetric(
|
|
120
|
+
lines,
|
|
121
|
+
statusName,
|
|
122
|
+
{
|
|
123
|
+
...defaults,
|
|
124
|
+
service: report.service.name,
|
|
125
|
+
scope: String(check.scope),
|
|
126
|
+
check: check.name,
|
|
127
|
+
component: check.component,
|
|
128
|
+
status
|
|
129
|
+
},
|
|
130
|
+
check.status === status ? 1 : 0
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
appendMetric(
|
|
134
|
+
lines,
|
|
135
|
+
durationName,
|
|
136
|
+
{
|
|
137
|
+
...defaults,
|
|
138
|
+
service: report.service.name,
|
|
139
|
+
scope: String(check.scope),
|
|
140
|
+
check: check.name,
|
|
141
|
+
component: check.component
|
|
142
|
+
},
|
|
143
|
+
check.durationMs
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
function appendReportMetrics(lines, report, prefix, defaults) {
|
|
148
|
+
const runDurationName = metricName(
|
|
149
|
+
"health.run.duration_milliseconds",
|
|
150
|
+
prefix
|
|
151
|
+
);
|
|
152
|
+
appendMetric(
|
|
153
|
+
lines,
|
|
154
|
+
runDurationName,
|
|
155
|
+
{
|
|
156
|
+
...defaults,
|
|
157
|
+
service: report.service.name,
|
|
158
|
+
scope: report.scope
|
|
159
|
+
},
|
|
160
|
+
report.durationMs
|
|
161
|
+
);
|
|
162
|
+
for (const metric of report.metrics) {
|
|
163
|
+
appendHealthMetric(
|
|
164
|
+
lines,
|
|
165
|
+
metric,
|
|
166
|
+
report,
|
|
167
|
+
prefix,
|
|
168
|
+
defaults
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
function appendHealthMetric(lines, metric, report, prefix, defaults) {
|
|
173
|
+
appendMetric(
|
|
174
|
+
lines,
|
|
175
|
+
metricName(
|
|
176
|
+
metric.name,
|
|
177
|
+
prefix
|
|
178
|
+
),
|
|
179
|
+
{
|
|
180
|
+
...defaults,
|
|
181
|
+
service: report.service.name,
|
|
182
|
+
scope: report.scope,
|
|
183
|
+
...metric.labels
|
|
184
|
+
},
|
|
185
|
+
metric.value
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
function toPrometheusText(report, options = {}) {
|
|
189
|
+
const prefix = options.prefix ?? "nexload";
|
|
190
|
+
const defaults = options.defaultLabels ?? {};
|
|
191
|
+
const lines = [];
|
|
192
|
+
appendHealthStatus(
|
|
193
|
+
lines,
|
|
194
|
+
report,
|
|
195
|
+
prefix,
|
|
196
|
+
defaults
|
|
197
|
+
);
|
|
198
|
+
appendCheckMetrics(
|
|
199
|
+
lines,
|
|
200
|
+
report,
|
|
201
|
+
prefix,
|
|
202
|
+
defaults
|
|
203
|
+
);
|
|
204
|
+
appendReportMetrics(
|
|
205
|
+
lines,
|
|
206
|
+
report,
|
|
207
|
+
prefix,
|
|
208
|
+
defaults
|
|
209
|
+
);
|
|
210
|
+
return `${lines.join("\n")}
|
|
211
|
+
`;
|
|
212
|
+
}
|
|
213
|
+
function toOpenMetricsText(report, options = {}) {
|
|
214
|
+
return `${toPrometheusText(
|
|
215
|
+
report,
|
|
216
|
+
options
|
|
217
|
+
)}# EOF
|
|
218
|
+
`;
|
|
219
|
+
}
|
|
220
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
221
|
+
0 && (module.exports = {
|
|
222
|
+
toOpenMetricsText,
|
|
223
|
+
toPrometheusText
|
|
224
|
+
});
|
|
225
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["import type {\n HealthMetric,\n HealthMetricValue,\n HealthReport,\n HealthStatus\n} from \"@nexload-sdk/healthcheck\";\n\nexport interface PrometheusExportOptions {\n prefix?: string\n defaultLabels?: Record<string, string>\n includeDescriptions?: boolean\n}\n\nexport type OpenMetricsExportOptions = PrometheusExportOptions;\n\nconst STATUSES: readonly HealthStatus[] = [\n \"ok\",\n \"degraded\",\n \"unhealthy\"\n];\nconst ALLOWED_LABELS = new Set([\n \"service\",\n \"scope\",\n \"check\",\n \"component\",\n \"dependency\",\n \"runtime\",\n \"status\",\n \"error_code\",\n \"collector\",\n \"version\"\n]);\n\nfunction metricName (\n name: string, prefix: string\n): string {\n const normalized = name.replace(\n /[^a-zA-Z0-9_:]/g, \"_\"\n ).replace(\n /_+/g, \"_\"\n )\n .replace(\n /^_+|_+$/g, \"\"\n )\n .toLowerCase();\n return `${prefix}_${normalized}`;\n}\n\nfunction metricValue (value: HealthMetricValue): number | null {\n if (typeof value === \"number\") return Number.isFinite(value) ? value : null;\n if (typeof value === \"boolean\") return value ? 1 : 0;\n if (typeof value === \"string\") return 1;\n return null;\n}\n\nfunction escapeLabel (value: string): string {\n return value.replace(\n /\\\\/g, \"\\\\\\\\\"\n ).replace(\n /\\n/g, \"\\\\n\"\n )\n .replace(\n /\"/g, \"\\\\\\\"\"\n );\n}\n\nfunction labels (input: Record<string, string | undefined>): string {\n const entries = Object.entries(input)\n .filter((entry): entry is [string, string] => Boolean(entry[1]) && ALLOWED_LABELS.has(entry[0]))\n .sort((\n [a], [b]\n ) => a.localeCompare(b));\n\n if (entries.length === 0) return \"\";\n\n return `{${entries.map(([\n key,\n value\n ]) => `${key}=\"${escapeLabel(value)}\"`).join(\",\")}}`;\n}\n\nfunction appendMetric (\n lines: string[], name: string, labelsInput: Record<string, string | undefined>, value: HealthMetricValue\n): void {\n const numeric = metricValue(value);\n if (numeric === null) return;\n\n lines.push(`${name}${labels(labelsInput)} ${numeric}`);\n}\n\nfunction appendHealthStatus (\n lines: string[], report: HealthReport, prefix: string, defaults: Record<string, string>\n): void {\n const name = metricName(\n \"health.status\", prefix\n );\n\n for (const status of STATUSES) {\n appendMetric(\n lines, name, {\n ...defaults,\n service: report.service.name,\n scope: report.scope,\n status,\n }, report.status === status ? 1 : 0\n );\n }\n}\n\nfunction appendCheckMetrics (\n lines: string[], report: HealthReport, prefix: string, defaults: Record<string, string>\n): void {\n const statusName = metricName(\n \"health.check.status\", prefix\n );\n const durationName = metricName(\n \"health.check.duration_milliseconds\", prefix\n );\n\n for (const check of report.checks) {\n for (const status of STATUSES) {\n appendMetric(\n lines, statusName, {\n ...defaults,\n service: report.service.name,\n scope: String(check.scope),\n check: check.name,\n component: check.component,\n status,\n }, check.status === status ? 1 : 0\n );\n }\n\n appendMetric(\n lines, durationName, {\n ...defaults,\n service: report.service.name,\n scope: String(check.scope),\n check: check.name,\n component: check.component,\n }, check.durationMs\n );\n }\n}\n\nfunction appendReportMetrics (\n lines: string[], report: HealthReport, prefix: string, defaults: Record<string, string>\n): void {\n const runDurationName = metricName(\n \"health.run.duration_milliseconds\", prefix\n );\n appendMetric(\n lines, runDurationName, {\n ...defaults,\n service: report.service.name,\n scope: report.scope,\n }, report.durationMs\n );\n\n for (const metric of report.metrics) {\n appendHealthMetric(\n lines, metric, report, prefix, defaults\n );\n }\n}\n\nfunction appendHealthMetric (\n lines: string[], metric: HealthMetric, report: HealthReport, prefix: string, defaults: Record<string, string>\n): void {\n appendMetric(\n lines, metricName(\n metric.name, prefix\n ), {\n ...defaults,\n service: report.service.name,\n scope: report.scope,\n ...metric.labels,\n }, metric.value\n );\n}\n\nexport function toPrometheusText (\n report: HealthReport, options: PrometheusExportOptions = {}\n): string {\n const prefix = options.prefix ?? \"nexload\";\n const defaults = options.defaultLabels ?? {};\n const lines: string[] = [];\n\n appendHealthStatus(\n lines, report, prefix, defaults\n );\n appendCheckMetrics(\n lines, report, prefix, defaults\n );\n appendReportMetrics(\n lines, report, prefix, defaults\n );\n\n return `${lines.join(\"\\n\")}\\n`;\n}\n\nexport function toOpenMetricsText (\n report: HealthReport, options: OpenMetricsExportOptions = {}\n): string {\n return `${toPrometheusText(\n report, options\n )}# EOF\\n`;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA,IAAM,WAAoC;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AACF;AACA,IAAM,iBAAiB,oBAAI,IAAI;AAAA,EAC7B;AAAA,EACA;AAA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AAO,QAAQ;AAAA,MACxB,OAAO,OAAO;AAAA,IAChB;AAAA,IAAG,OAAO;AAAA,EACZ;AAEA,aAAW,UAAU,OAAO,SAAS;AACnC;AAAA,MACE;AAAA,MAAO;AAAA,MAAQ;AAAA,MAAQ;AAAA,MAAQ;AAAA,IACjC;AAAA,EACF;AACF;AAEA,SAAS,mBACP,OAAiB,QAAsB,QAAsB,QAAgB,UACvE;AACN;AAAA,IACE;AAAA,IAAO;AAAA,MACL,OAAO;AAAA,MAAM;AAAA,IACf;AAAA,IAAG;AAAA,MACD,GAAG;AAAA,MACH,SAAS,OAAO,QAAQ;AAAA,MACxB,OAAO,OAAO;AAAA,MACd,GAAG,OAAO;AAAA,IACZ;AAAA,IAAG,OAAO;AAAA,EACZ;AACF;AAEO,SAAS,iBACd,QAAsB,UAAmC,CAAC,GAClD;AACR,QAAM,SAAS,QAAQ,UAAU;AACjC,QAAM,WAAW,QAAQ,iBAAiB,CAAC;AAC3C,QAAM,QAAkB,CAAC;AAEzB;AAAA,IACE;AAAA,IAAO;AAAA,IAAQ;AAAA,IAAQ;AAAA,EACzB;AACA;AAAA,IACE;AAAA,IAAO;AAAA,IAAQ;AAAA,IAAQ;AAAA,EACzB;AACA;AAAA,IACE;AAAA,IAAO;AAAA,IAAQ;AAAA,IAAQ;AAAA,EACzB;AAEA,SAAO,GAAG,MAAM,KAAK,IAAI,CAAC;AAAA;AAC5B;AAEO,SAAS,kBACd,QAAsB,UAAoC,CAAC,GACnD;AACR,SAAO,GAAG;AAAA,IACR;AAAA,IAAQ;AAAA,EACV,CAAC;AAAA;AACH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HealthReport } from "@nexload-sdk/healthcheck";
|
|
2
|
+
export interface PrometheusExportOptions {
|
|
3
|
+
prefix?: string;
|
|
4
|
+
defaultLabels?: Record<string, string>;
|
|
5
|
+
includeDescriptions?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export type OpenMetricsExportOptions = PrometheusExportOptions;
|
|
8
|
+
export declare function toPrometheusText(report: HealthReport, options?: PrometheusExportOptions): string;
|
|
9
|
+
export declare function toOpenMetricsText(report: HealthReport, options?: OpenMetricsExportOptions): string;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,YAAY,EAEb,MAAM,0BAA0B,CAAC;AAElC,MAAM,WAAW,uBAAuB;IACtC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACtC,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B;AAED,MAAM,MAAM,wBAAwB,GAAG,uBAAuB,CAAC;AAwK/D,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,YAAY,EAAE,OAAO,GAAE,uBAA4B,GAC1D,MAAM,CAgBR;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EAAE,OAAO,GAAE,wBAA6B,GAC3D,MAAM,CAIR"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
// @nexload-sdk/healthcheck-prometheus v1.0.0 (build 2026-06-21T16:03:28.449Z)
|
|
2
|
+
|
|
3
|
+
// src/index.ts
|
|
4
|
+
var STATUSES = [
|
|
5
|
+
"ok",
|
|
6
|
+
"degraded",
|
|
7
|
+
"unhealthy"
|
|
8
|
+
];
|
|
9
|
+
var ALLOWED_LABELS = /* @__PURE__ */ new Set([
|
|
10
|
+
"service",
|
|
11
|
+
"scope",
|
|
12
|
+
"check",
|
|
13
|
+
"component",
|
|
14
|
+
"dependency",
|
|
15
|
+
"runtime",
|
|
16
|
+
"status",
|
|
17
|
+
"error_code",
|
|
18
|
+
"collector",
|
|
19
|
+
"version"
|
|
20
|
+
]);
|
|
21
|
+
function metricName(name, prefix) {
|
|
22
|
+
const normalized = name.replace(
|
|
23
|
+
/[^a-zA-Z0-9_:]/g,
|
|
24
|
+
"_"
|
|
25
|
+
).replace(
|
|
26
|
+
/_+/g,
|
|
27
|
+
"_"
|
|
28
|
+
).replace(
|
|
29
|
+
/^_+|_+$/g,
|
|
30
|
+
""
|
|
31
|
+
).toLowerCase();
|
|
32
|
+
return `${prefix}_${normalized}`;
|
|
33
|
+
}
|
|
34
|
+
function metricValue(value) {
|
|
35
|
+
if (typeof value === "number") return Number.isFinite(value) ? value : null;
|
|
36
|
+
if (typeof value === "boolean") return value ? 1 : 0;
|
|
37
|
+
if (typeof value === "string") return 1;
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
function escapeLabel(value) {
|
|
41
|
+
return value.replace(
|
|
42
|
+
/\\/g,
|
|
43
|
+
"\\\\"
|
|
44
|
+
).replace(
|
|
45
|
+
/\n/g,
|
|
46
|
+
"\\n"
|
|
47
|
+
).replace(
|
|
48
|
+
/"/g,
|
|
49
|
+
'\\"'
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
function labels(input) {
|
|
53
|
+
const entries = Object.entries(input).filter((entry) => Boolean(entry[1]) && ALLOWED_LABELS.has(entry[0])).sort(([a], [b]) => a.localeCompare(b));
|
|
54
|
+
if (entries.length === 0) return "";
|
|
55
|
+
return `{${entries.map(([
|
|
56
|
+
key,
|
|
57
|
+
value
|
|
58
|
+
]) => `${key}="${escapeLabel(value)}"`).join(",")}}`;
|
|
59
|
+
}
|
|
60
|
+
function appendMetric(lines, name, labelsInput, value) {
|
|
61
|
+
const numeric = metricValue(value);
|
|
62
|
+
if (numeric === null) return;
|
|
63
|
+
lines.push(`${name}${labels(labelsInput)} ${numeric}`);
|
|
64
|
+
}
|
|
65
|
+
function appendHealthStatus(lines, report, prefix, defaults) {
|
|
66
|
+
const name = metricName(
|
|
67
|
+
"health.status",
|
|
68
|
+
prefix
|
|
69
|
+
);
|
|
70
|
+
for (const status of STATUSES) {
|
|
71
|
+
appendMetric(
|
|
72
|
+
lines,
|
|
73
|
+
name,
|
|
74
|
+
{
|
|
75
|
+
...defaults,
|
|
76
|
+
service: report.service.name,
|
|
77
|
+
scope: report.scope,
|
|
78
|
+
status
|
|
79
|
+
},
|
|
80
|
+
report.status === status ? 1 : 0
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function appendCheckMetrics(lines, report, prefix, defaults) {
|
|
85
|
+
const statusName = metricName(
|
|
86
|
+
"health.check.status",
|
|
87
|
+
prefix
|
|
88
|
+
);
|
|
89
|
+
const durationName = metricName(
|
|
90
|
+
"health.check.duration_milliseconds",
|
|
91
|
+
prefix
|
|
92
|
+
);
|
|
93
|
+
for (const check of report.checks) {
|
|
94
|
+
for (const status of STATUSES) {
|
|
95
|
+
appendMetric(
|
|
96
|
+
lines,
|
|
97
|
+
statusName,
|
|
98
|
+
{
|
|
99
|
+
...defaults,
|
|
100
|
+
service: report.service.name,
|
|
101
|
+
scope: String(check.scope),
|
|
102
|
+
check: check.name,
|
|
103
|
+
component: check.component,
|
|
104
|
+
status
|
|
105
|
+
},
|
|
106
|
+
check.status === status ? 1 : 0
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
appendMetric(
|
|
110
|
+
lines,
|
|
111
|
+
durationName,
|
|
112
|
+
{
|
|
113
|
+
...defaults,
|
|
114
|
+
service: report.service.name,
|
|
115
|
+
scope: String(check.scope),
|
|
116
|
+
check: check.name,
|
|
117
|
+
component: check.component
|
|
118
|
+
},
|
|
119
|
+
check.durationMs
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function appendReportMetrics(lines, report, prefix, defaults) {
|
|
124
|
+
const runDurationName = metricName(
|
|
125
|
+
"health.run.duration_milliseconds",
|
|
126
|
+
prefix
|
|
127
|
+
);
|
|
128
|
+
appendMetric(
|
|
129
|
+
lines,
|
|
130
|
+
runDurationName,
|
|
131
|
+
{
|
|
132
|
+
...defaults,
|
|
133
|
+
service: report.service.name,
|
|
134
|
+
scope: report.scope
|
|
135
|
+
},
|
|
136
|
+
report.durationMs
|
|
137
|
+
);
|
|
138
|
+
for (const metric of report.metrics) {
|
|
139
|
+
appendHealthMetric(
|
|
140
|
+
lines,
|
|
141
|
+
metric,
|
|
142
|
+
report,
|
|
143
|
+
prefix,
|
|
144
|
+
defaults
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function appendHealthMetric(lines, metric, report, prefix, defaults) {
|
|
149
|
+
appendMetric(
|
|
150
|
+
lines,
|
|
151
|
+
metricName(
|
|
152
|
+
metric.name,
|
|
153
|
+
prefix
|
|
154
|
+
),
|
|
155
|
+
{
|
|
156
|
+
...defaults,
|
|
157
|
+
service: report.service.name,
|
|
158
|
+
scope: report.scope,
|
|
159
|
+
...metric.labels
|
|
160
|
+
},
|
|
161
|
+
metric.value
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
function toPrometheusText(report, options = {}) {
|
|
165
|
+
const prefix = options.prefix ?? "nexload";
|
|
166
|
+
const defaults = options.defaultLabels ?? {};
|
|
167
|
+
const lines = [];
|
|
168
|
+
appendHealthStatus(
|
|
169
|
+
lines,
|
|
170
|
+
report,
|
|
171
|
+
prefix,
|
|
172
|
+
defaults
|
|
173
|
+
);
|
|
174
|
+
appendCheckMetrics(
|
|
175
|
+
lines,
|
|
176
|
+
report,
|
|
177
|
+
prefix,
|
|
178
|
+
defaults
|
|
179
|
+
);
|
|
180
|
+
appendReportMetrics(
|
|
181
|
+
lines,
|
|
182
|
+
report,
|
|
183
|
+
prefix,
|
|
184
|
+
defaults
|
|
185
|
+
);
|
|
186
|
+
return `${lines.join("\n")}
|
|
187
|
+
`;
|
|
188
|
+
}
|
|
189
|
+
function toOpenMetricsText(report, options = {}) {
|
|
190
|
+
return `${toPrometheusText(
|
|
191
|
+
report,
|
|
192
|
+
options
|
|
193
|
+
)}# EOF
|
|
194
|
+
`;
|
|
195
|
+
}
|
|
196
|
+
export {
|
|
197
|
+
toOpenMetricsText,
|
|
198
|
+
toPrometheusText
|
|
199
|
+
};
|
|
200
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["import type {\n HealthMetric,\n HealthMetricValue,\n HealthReport,\n HealthStatus\n} from \"@nexload-sdk/healthcheck\";\n\nexport interface PrometheusExportOptions {\n prefix?: string\n defaultLabels?: Record<string, string>\n includeDescriptions?: boolean\n}\n\nexport type OpenMetricsExportOptions = PrometheusExportOptions;\n\nconst STATUSES: readonly HealthStatus[] = [\n \"ok\",\n \"degraded\",\n \"unhealthy\"\n];\nconst ALLOWED_LABELS = new Set([\n \"service\",\n \"scope\",\n \"check\",\n \"component\",\n \"dependency\",\n \"runtime\",\n \"status\",\n \"error_code\",\n \"collector\",\n \"version\"\n]);\n\nfunction metricName (\n name: string, prefix: string\n): string {\n const normalized = name.replace(\n /[^a-zA-Z0-9_:]/g, \"_\"\n ).replace(\n /_+/g, \"_\"\n )\n .replace(\n /^_+|_+$/g, \"\"\n )\n .toLowerCase();\n return `${prefix}_${normalized}`;\n}\n\nfunction metricValue (value: HealthMetricValue): number | null {\n if (typeof value === \"number\") return Number.isFinite(value) ? value : null;\n if (typeof value === \"boolean\") return value ? 1 : 0;\n if (typeof value === \"string\") return 1;\n return null;\n}\n\nfunction escapeLabel (value: string): string {\n return value.replace(\n /\\\\/g, \"\\\\\\\\\"\n ).replace(\n /\\n/g, \"\\\\n\"\n )\n .replace(\n /\"/g, \"\\\\\\\"\"\n );\n}\n\nfunction labels (input: Record<string, string | undefined>): string {\n const entries = Object.entries(input)\n .filter((entry): entry is [string, string] => Boolean(entry[1]) && ALLOWED_LABELS.has(entry[0]))\n .sort((\n [a], [b]\n ) => a.localeCompare(b));\n\n if (entries.length === 0) return \"\";\n\n return `{${entries.map(([\n key,\n value\n ]) => `${key}=\"${escapeLabel(value)}\"`).join(\",\")}}`;\n}\n\nfunction appendMetric (\n lines: string[], name: string, labelsInput: Record<string, string | undefined>, value: HealthMetricValue\n): void {\n const numeric = metricValue(value);\n if (numeric === null) return;\n\n lines.push(`${name}${labels(labelsInput)} ${numeric}`);\n}\n\nfunction appendHealthStatus (\n lines: string[], report: HealthReport, prefix: string, defaults: Record<string, string>\n): void {\n const name = metricName(\n \"health.status\", prefix\n );\n\n for (const status of STATUSES) {\n appendMetric(\n lines, name, {\n ...defaults,\n service: report.service.name,\n scope: report.scope,\n status,\n }, report.status === status ? 1 : 0\n );\n }\n}\n\nfunction appendCheckMetrics (\n lines: string[], report: HealthReport, prefix: string, defaults: Record<string, string>\n): void {\n const statusName = metricName(\n \"health.check.status\", prefix\n );\n const durationName = metricName(\n \"health.check.duration_milliseconds\", prefix\n );\n\n for (const check of report.checks) {\n for (const status of STATUSES) {\n appendMetric(\n lines, statusName, {\n ...defaults,\n service: report.service.name,\n scope: String(check.scope),\n check: check.name,\n component: check.component,\n status,\n }, check.status === status ? 1 : 0\n );\n }\n\n appendMetric(\n lines, durationName, {\n ...defaults,\n service: report.service.name,\n scope: String(check.scope),\n check: check.name,\n component: check.component,\n }, check.durationMs\n );\n }\n}\n\nfunction appendReportMetrics (\n lines: string[], report: HealthReport, prefix: string, defaults: Record<string, string>\n): void {\n const runDurationName = metricName(\n \"health.run.duration_milliseconds\", prefix\n );\n appendMetric(\n lines, runDurationName, {\n ...defaults,\n service: report.service.name,\n scope: report.scope,\n }, report.durationMs\n );\n\n for (const metric of report.metrics) {\n appendHealthMetric(\n lines, metric, report, prefix, defaults\n );\n }\n}\n\nfunction appendHealthMetric (\n lines: string[], metric: HealthMetric, report: HealthReport, prefix: string, defaults: Record<string, string>\n): void {\n appendMetric(\n lines, metricName(\n metric.name, prefix\n ), {\n ...defaults,\n service: report.service.name,\n scope: report.scope,\n ...metric.labels,\n }, metric.value\n );\n}\n\nexport function toPrometheusText (\n report: HealthReport, options: PrometheusExportOptions = {}\n): string {\n const prefix = options.prefix ?? \"nexload\";\n const defaults = options.defaultLabels ?? {};\n const lines: string[] = [];\n\n appendHealthStatus(\n lines, report, prefix, defaults\n );\n appendCheckMetrics(\n lines, report, prefix, defaults\n );\n appendReportMetrics(\n lines, report, prefix, defaults\n );\n\n return `${lines.join(\"\\n\")}\\n`;\n}\n\nexport function toOpenMetricsText (\n report: HealthReport, options: OpenMetricsExportOptions = {}\n): string {\n return `${toPrometheusText(\n report, options\n )}# EOF\\n`;\n}\n"],
|
|
5
|
+
"mappings": ";;;AAeA,IAAM,WAAoC;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AACF;AACA,IAAM,iBAAiB,oBAAI,IAAI;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,SAAS,WACP,MAAc,QACN;AACR,QAAM,aAAa,KAAK;AAAA,IACtB;AAAA,IAAmB;AAAA,EACrB,EAAE;AAAA,IACA;AAAA,IAAO;AAAA,EACT,EACG;AAAA,IACC;AAAA,IAAY;AAAA,EACd,EACC,YAAY;AACf,SAAO,GAAG,MAAM,IAAI,UAAU;AAChC;AAEA,SAAS,YAAa,OAAyC;AAC7D,MAAI,OAAO,UAAU,SAAU,QAAO,OAAO,SAAS,KAAK,IAAI,QAAQ;AACvE,MAAI,OAAO,UAAU,UAAW,QAAO,QAAQ,IAAI;AACnD,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,SAAO;AACT;AAEA,SAAS,YAAa,OAAuB;AAC3C,SAAO,MAAM;AAAA,IACX;AAAA,IAAO;AAAA,EACT,EAAE;AAAA,IACA;AAAA,IAAO;AAAA,EACT,EACG;AAAA,IACC;AAAA,IAAM;AAAA,EACR;AACJ;AAEA,SAAS,OAAQ,OAAmD;AA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IACE;AAAA,IAAO;AAAA,IAAQ;AAAA,IAAQ;AAAA,EACzB;AACA;AAAA,IACE;AAAA,IAAO;AAAA,IAAQ;AAAA,IAAQ;AAAA,EACzB;AAEA,SAAO,GAAG,MAAM,KAAK,IAAI,CAAC;AAAA;AAC5B;AAEO,SAAS,kBACd,QAAsB,UAAoC,CAAC,GACnD;AACR,SAAO,GAAG;AAAA,IACR;AAAA,IAAQ;AAAA,EACV,CAAC;AAAA;AACH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nexload-sdk/healthcheck-prometheus",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Prometheus and OpenMetrics text serializers for @nexload-sdk/healthcheck reports.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"healthcheck",
|
|
7
|
+
"prometheus",
|
|
8
|
+
"openmetrics",
|
|
9
|
+
"monitoring"
|
|
10
|
+
],
|
|
11
|
+
"author": "GecutWeb",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "./dist/index.cjs",
|
|
15
|
+
"module": "./dist/index.mjs",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.mjs",
|
|
21
|
+
"require": "./dist/index.cjs",
|
|
22
|
+
"default": "./dist/index.mjs"
|
|
23
|
+
},
|
|
24
|
+
"./package.json": "./package.json"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist",
|
|
28
|
+
"README.md",
|
|
29
|
+
"package.json"
|
|
30
|
+
],
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@nexload-sdk/healthcheck": "4.0.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/node": "^25.0.3",
|
|
39
|
+
"eslint": "^9.39.2",
|
|
40
|
+
"typescript": "5.9.3",
|
|
41
|
+
"@nexload-sdk/bundler": "4.0.1",
|
|
42
|
+
"@nexload-sdk/typescript-config": "4.0.1",
|
|
43
|
+
"@nexload-sdk/eslint-config": "4.0.1"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "node esbuild.config.mjs",
|
|
47
|
+
"lint": "eslint src",
|
|
48
|
+
"test": "node --test test/*.test.mjs"
|
|
49
|
+
}
|
|
50
|
+
}
|