@mojaloop/central-services-metrics
Advanced tools
Comparing version 12.2.1 to 12.3.0
@@ -217,2 +217,8 @@ /***** | ||
}); | ||
new client.Gauge({ | ||
registers: [_this.getDefaultRegister()], | ||
name: 'http_server_start', | ||
help: 'Start indicator for the server' | ||
}).inc(); | ||
var first = true; | ||
server.ext('onRequest', function (request, h) { | ||
@@ -270,9 +276,13 @@ var _a = _this.getOptions(), _b = _a.maxConnections, maxConnections = _b === void 0 ? 0 : _b, _c = _a.maxRequestsPending, maxRequestsPending = _c === void 0 ? 0 : _c; | ||
handler: function (request, h) { return __awaiter(_this, void 0, void 0, function () { | ||
var _a, _b; | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
case 0: | ||
_b = (_a = h).response; | ||
return [4 /*yield*/, this.getMetricsForPrometheus()]; | ||
case 1: return [2 /*return*/, _b.apply(_a, [_c.sent()]).code(200).type('text/plain; version=0.0.4')]; | ||
var metrics; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.getMetricsForPrometheus()]; | ||
case 1: | ||
metrics = _a.sent(); | ||
if (first) { | ||
this.getDefaultRegister().removeSingleMetric('http_server_start'); | ||
first = false; | ||
} | ||
return [2 /*return*/, h.response(metrics).code(200).type('text/plain; version=0.0.4')]; | ||
} | ||
@@ -279,0 +289,0 @@ }); |
{ | ||
"name": "@mojaloop/central-services-metrics", | ||
"version": "12.2.1", | ||
"version": "12.3.0", | ||
"description": "Shared code for metrics generation", | ||
@@ -65,4 +65,4 @@ "main": "./dist/index.js", | ||
"@hapi/hapi": "^21.3.12", | ||
"@types/node": "^22.9.3", | ||
"@types/tape": "^5.6.4", | ||
"@types/node": "^22.10.1", | ||
"@types/tape": "^5.6.5", | ||
"audit-ci": "^7.1.0", | ||
@@ -69,0 +69,0 @@ "debug": "4.3.7", |
Sorry, the diff of this file is not supported yet
31914
323