@promster/fastify 14.0.0 → 15.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/LICENSE +1 -1
- package/dist/declarations/src/index.d.ts +2 -2
- package/dist/declarations/src/plugin/index.d.ts +1 -1
- package/dist/declarations/src/plugin/plugin.d.ts +3 -3
- package/dist/promster-fastify.cjs.d.ts +1 -1
- package/dist/promster-fastify.cjs.dev.js +11 -13
- package/dist/promster-fastify.cjs.prod.js +11 -13
- package/package.json +5 -5
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Prometheus, defaultNormalizers, defaultRegister, getContentType, getSummary, timing } from '@promster/metrics';
|
|
2
|
+
import { type TPromsterOptions, getRequestRecorder, plugin, signalIsNotUp, signalIsUp } from "./plugin/index.js";
|
|
3
3
|
export { type TPromsterOptions, plugin, getRequestRecorder, signalIsUp, signalIsNotUp, getSummary, getContentType, Prometheus, defaultRegister, defaultNormalizers, timing, };
|
|
4
4
|
export * from '@promster/types';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type TPromsterOptions, plugin,
|
|
1
|
+
import { type TPromsterOptions, getRequestRecorder, plugin, signalIsNotUp, signalIsUp } from "./plugin.js";
|
|
2
2
|
export { type TPromsterOptions, plugin, signalIsUp, signalIsNotUp, getRequestRecorder, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { TRequestRecorder } from '@promster/metrics';
|
|
2
|
+
import type { TLabelValues, TOptionalPromsterOptions } from '@promster/types';
|
|
3
|
+
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
4
4
|
declare const extractPath: (req: FastifyRequest) => string;
|
|
5
5
|
declare const getRequestRecorder: () => TRequestRecorder;
|
|
6
6
|
declare const signalIsUp: () => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./declarations/src/index";
|
|
1
|
+
export * from "./declarations/src/index.js";
|
|
2
2
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvbXN0ZXItZmFzdGlmeS5janMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4vZGVjbGFyYXRpb25zL3NyYy9pbmRleC5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIn0=
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var metrics = require('@promster/metrics');
|
|
5
6
|
var fastifyPlugin = require('fastify-plugin');
|
|
6
7
|
var merge = require('merge-options');
|
|
7
|
-
var metrics = require('@promster/metrics');
|
|
8
8
|
var types = require('@promster/types');
|
|
9
9
|
|
|
10
10
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -14,7 +14,7 @@ var merge__default = /*#__PURE__*/_interopDefault(merge);
|
|
|
14
14
|
|
|
15
15
|
var pkg = {
|
|
16
16
|
name: "@promster/fastify",
|
|
17
|
-
version: "
|
|
17
|
+
version: "15.0.0",
|
|
18
18
|
description: "Fastify server integrations of promster",
|
|
19
19
|
main: "dist/promster-fastify.cjs.js",
|
|
20
20
|
typings: "dist/promster-fastify.cjs.d.ts",
|
|
@@ -50,15 +50,15 @@ var pkg = {
|
|
|
50
50
|
"prometheus"
|
|
51
51
|
],
|
|
52
52
|
dependencies: {
|
|
53
|
-
"@promster/metrics": "
|
|
54
|
-
"@promster/
|
|
53
|
+
"@promster/metrics": "workspace:*",
|
|
54
|
+
"@promster/server": "workspace:*",
|
|
55
|
+
"@promster/types": "workspace:*",
|
|
55
56
|
"fastify-plugin": "^4.5.1",
|
|
56
57
|
"merge-options": "3.0.4",
|
|
57
|
-
"parse-prometheus-text-format": "1.1.1"
|
|
58
|
-
"@promster/server": "workspace:*"
|
|
58
|
+
"parse-prometheus-text-format": "1.1.1"
|
|
59
59
|
},
|
|
60
60
|
devDependencies: {
|
|
61
|
-
fastify: "4.
|
|
61
|
+
fastify: "4.29.0"
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
|
|
@@ -72,17 +72,17 @@ const signalIsUp = () => {
|
|
|
72
72
|
if (!upMetric) {
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
|
-
|
|
75
|
+
for (const upMetricType of upMetric) {
|
|
76
76
|
upMetricType.set(1);
|
|
77
|
-
}
|
|
77
|
+
}
|
|
78
78
|
};
|
|
79
79
|
const signalIsNotUp = () => {
|
|
80
80
|
if (!upMetric) {
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
for (const upMetricType of upMetric) {
|
|
84
84
|
upMetricType.set(0);
|
|
85
|
-
}
|
|
85
|
+
}
|
|
86
86
|
};
|
|
87
87
|
const createPlugin = async (fastify, options) => {
|
|
88
88
|
const allDefaultedOptions = merge__default["default"](metrics.createHttpMetrics.defaultOptions, metrics.createGcMetrics.defaultOptions, metrics.createRequestRecorder.defaultOptions,
|
|
@@ -99,7 +99,6 @@ const createPlugin = async (fastify, options) => {
|
|
|
99
99
|
}
|
|
100
100
|
fastify.decorate('Prometheus', metrics.Prometheus);
|
|
101
101
|
fastify.decorate('recordRequest', recordRequest);
|
|
102
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
103
102
|
fastify.decorateRequest('__promsterTiming__', null);
|
|
104
103
|
fastify.addHook('onRequest', async (request, _) => {
|
|
105
104
|
// @ts-expect-error
|
|
@@ -112,7 +111,6 @@ const createPlugin = async (fastify, options) => {
|
|
|
112
111
|
req: request,
|
|
113
112
|
res: reply
|
|
114
113
|
}),
|
|
115
|
-
// eslint-disable-next-line camelcase
|
|
116
114
|
status_code: allDefaultedOptions.normalizeStatusCode(reply.statusCode, {
|
|
117
115
|
req: request,
|
|
118
116
|
res: reply
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var metrics = require('@promster/metrics');
|
|
5
6
|
var fastifyPlugin = require('fastify-plugin');
|
|
6
7
|
var merge = require('merge-options');
|
|
7
|
-
var metrics = require('@promster/metrics');
|
|
8
8
|
var types = require('@promster/types');
|
|
9
9
|
|
|
10
10
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -14,7 +14,7 @@ var merge__default = /*#__PURE__*/_interopDefault(merge);
|
|
|
14
14
|
|
|
15
15
|
var pkg = {
|
|
16
16
|
name: "@promster/fastify",
|
|
17
|
-
version: "
|
|
17
|
+
version: "15.0.0",
|
|
18
18
|
description: "Fastify server integrations of promster",
|
|
19
19
|
main: "dist/promster-fastify.cjs.js",
|
|
20
20
|
typings: "dist/promster-fastify.cjs.d.ts",
|
|
@@ -50,15 +50,15 @@ var pkg = {
|
|
|
50
50
|
"prometheus"
|
|
51
51
|
],
|
|
52
52
|
dependencies: {
|
|
53
|
-
"@promster/metrics": "
|
|
54
|
-
"@promster/
|
|
53
|
+
"@promster/metrics": "workspace:*",
|
|
54
|
+
"@promster/server": "workspace:*",
|
|
55
|
+
"@promster/types": "workspace:*",
|
|
55
56
|
"fastify-plugin": "^4.5.1",
|
|
56
57
|
"merge-options": "3.0.4",
|
|
57
|
-
"parse-prometheus-text-format": "1.1.1"
|
|
58
|
-
"@promster/server": "workspace:*"
|
|
58
|
+
"parse-prometheus-text-format": "1.1.1"
|
|
59
59
|
},
|
|
60
60
|
devDependencies: {
|
|
61
|
-
fastify: "4.
|
|
61
|
+
fastify: "4.29.0"
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
|
|
@@ -72,17 +72,17 @@ const signalIsUp = () => {
|
|
|
72
72
|
if (!upMetric) {
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
|
-
|
|
75
|
+
for (const upMetricType of upMetric) {
|
|
76
76
|
upMetricType.set(1);
|
|
77
|
-
}
|
|
77
|
+
}
|
|
78
78
|
};
|
|
79
79
|
const signalIsNotUp = () => {
|
|
80
80
|
if (!upMetric) {
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
for (const upMetricType of upMetric) {
|
|
84
84
|
upMetricType.set(0);
|
|
85
|
-
}
|
|
85
|
+
}
|
|
86
86
|
};
|
|
87
87
|
const createPlugin = async (fastify, options) => {
|
|
88
88
|
const allDefaultedOptions = merge__default["default"](metrics.createHttpMetrics.defaultOptions, metrics.createGcMetrics.defaultOptions, metrics.createRequestRecorder.defaultOptions,
|
|
@@ -99,7 +99,6 @@ const createPlugin = async (fastify, options) => {
|
|
|
99
99
|
}
|
|
100
100
|
fastify.decorate('Prometheus', metrics.Prometheus);
|
|
101
101
|
fastify.decorate('recordRequest', recordRequest);
|
|
102
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
103
102
|
fastify.decorateRequest('__promsterTiming__', null);
|
|
104
103
|
fastify.addHook('onRequest', async (request, _) => {
|
|
105
104
|
// @ts-expect-error
|
|
@@ -112,7 +111,6 @@ const createPlugin = async (fastify, options) => {
|
|
|
112
111
|
req: request,
|
|
113
112
|
res: reply
|
|
114
113
|
}),
|
|
115
|
-
// eslint-disable-next-line camelcase
|
|
116
114
|
status_code: allDefaultedOptions.normalizeStatusCode(reply.statusCode, {
|
|
117
115
|
req: request,
|
|
118
116
|
res: reply
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promster/fastify",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0",
|
|
4
4
|
"description": "Fastify server integrations of promster",
|
|
5
5
|
"main": "dist/promster-fastify.cjs.js",
|
|
6
6
|
"typings": "dist/promster-fastify.cjs.d.ts",
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
"prometheus"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@promster/metrics": "^14.0.0",
|
|
40
|
-
"@promster/types": "^14.0.0",
|
|
41
39
|
"fastify-plugin": "^4.5.1",
|
|
42
40
|
"merge-options": "3.0.4",
|
|
43
41
|
"parse-prometheus-text-format": "1.1.1",
|
|
44
|
-
"@promster/
|
|
42
|
+
"@promster/metrics": "15.0.0",
|
|
43
|
+
"@promster/server": "15.0.0",
|
|
44
|
+
"@promster/types": "15.0.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"fastify": "4.
|
|
47
|
+
"fastify": "4.29.0"
|
|
48
48
|
}
|
|
49
49
|
}
|