@tramvai/module-metrics 1.92.2 → 1.94.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/lib/server.es.js +2 -5
- package/lib/server.js +2 -5
- package/package.json +12 -12
package/lib/server.es.js
CHANGED
|
@@ -4,7 +4,7 @@ import { SERVER_MODULE_PAPI_PUBLIC_ROUTE, SERVER_TOKEN, SPECIAL_SERVER_PATHS } f
|
|
|
4
4
|
import { SERVER_FACTORY_TOKEN, WEB_FASTIFY_APP_TOKEN, WEB_FASTIFY_APP_FACTORY_TOKEN, WEB_FASTIFY_APP_BEFORE_INIT_TOKEN } from '@tramvai/tokens-server-private';
|
|
5
5
|
import { METRICS_MODULE_TOKEN, METRICS_SERVICES_REGISTRY_TOKEN, METRICS_MODULE_CONFIG_TOKEN, REGISTER_INSTANT_METRIC_TOKEN } from '@tramvai/tokens-metrics';
|
|
6
6
|
export * from '@tramvai/tokens-metrics';
|
|
7
|
-
import {
|
|
7
|
+
import { fastifyMeasureRequests } from '@tinkoff/measure-fastify-requests';
|
|
8
8
|
import { Registry, collectDefaultMetrics, Counter, Gauge, Histogram, Summary } from 'prom-client';
|
|
9
9
|
import flatten from '@tinkoff/utils/array/flatten';
|
|
10
10
|
import { ENV_MANAGER_TOKEN as ENV_MANAGER_TOKEN$1, LOGGER_TOKEN as LOGGER_TOKEN$1 } from '@tramvai/tokens-common';
|
|
@@ -567,7 +567,7 @@ MetricsModule = __decorate([
|
|
|
567
567
|
res.type(registry.contentType);
|
|
568
568
|
return registry.metrics();
|
|
569
569
|
});
|
|
570
|
-
|
|
570
|
+
await app.register(fastifyMeasureRequests, {
|
|
571
571
|
metrics,
|
|
572
572
|
metricsExcludePaths,
|
|
573
573
|
additionalLabelNames: flatten(additionalLabelNamesList || []),
|
|
@@ -582,9 +582,6 @@ MetricsModule = __decorate([
|
|
|
582
582
|
},
|
|
583
583
|
httpRequestsDurationBuckets,
|
|
584
584
|
});
|
|
585
|
-
app.addHook('onRequest', (request, reply, next) => {
|
|
586
|
-
measured({ ...request.raw, path: request.url }, reply, next);
|
|
587
|
-
});
|
|
588
585
|
};
|
|
589
586
|
},
|
|
590
587
|
deps: {
|
package/lib/server.js
CHANGED
|
@@ -7,7 +7,7 @@ var core = require('@tramvai/core');
|
|
|
7
7
|
var tokensServer = require('@tramvai/tokens-server');
|
|
8
8
|
var tokensServerPrivate = require('@tramvai/tokens-server-private');
|
|
9
9
|
var tokensMetrics = require('@tramvai/tokens-metrics');
|
|
10
|
-
var
|
|
10
|
+
var measureFastifyRequests = require('@tinkoff/measure-fastify-requests');
|
|
11
11
|
var promClient = require('prom-client');
|
|
12
12
|
var flatten = require('@tinkoff/utils/array/flatten');
|
|
13
13
|
var tokensCommon = require('@tramvai/tokens-common');
|
|
@@ -580,7 +580,7 @@ exports.MetricsModule = tslib.__decorate([
|
|
|
580
580
|
res.type(registry.contentType);
|
|
581
581
|
return registry.metrics();
|
|
582
582
|
});
|
|
583
|
-
|
|
583
|
+
await app.register(measureFastifyRequests.fastifyMeasureRequests, {
|
|
584
584
|
metrics,
|
|
585
585
|
metricsExcludePaths,
|
|
586
586
|
additionalLabelNames: flatten__default["default"](additionalLabelNamesList || []),
|
|
@@ -595,9 +595,6 @@ exports.MetricsModule = tslib.__decorate([
|
|
|
595
595
|
},
|
|
596
596
|
httpRequestsDurationBuckets,
|
|
597
597
|
});
|
|
598
|
-
app.addHook('onRequest', (request, reply, next) => {
|
|
599
|
-
measured({ ...request.raw, path: request.url }, reply, next);
|
|
600
|
-
});
|
|
601
598
|
};
|
|
602
599
|
},
|
|
603
600
|
deps: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/module-metrics",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.94.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"browser": "lib/browser.js",
|
|
6
6
|
"main": "lib/server.js",
|
|
@@ -19,21 +19,21 @@
|
|
|
19
19
|
"build-for-publish": "true"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@tramvai/core": "1.
|
|
23
|
-
"@tramvai/tokens-common": "1.
|
|
24
|
-
"@tramvai/tokens-server": "1.
|
|
25
|
-
"@tramvai/tokens-server-private": "1.
|
|
26
|
-
"@tramvai/tokens-metrics": "1.
|
|
27
|
-
"@tramvai/module-common": "1.
|
|
28
|
-
"@tramvai/tokens-http-client": "1.
|
|
29
|
-
"@tramvai/state": "1.
|
|
30
|
-
"@tramvai/papi": "1.
|
|
31
|
-
"@tinkoff/measure-
|
|
22
|
+
"@tramvai/core": "1.94.0",
|
|
23
|
+
"@tramvai/tokens-common": "1.94.0",
|
|
24
|
+
"@tramvai/tokens-server": "1.94.0",
|
|
25
|
+
"@tramvai/tokens-server-private": "1.94.0",
|
|
26
|
+
"@tramvai/tokens-metrics": "1.94.0",
|
|
27
|
+
"@tramvai/module-common": "1.94.0",
|
|
28
|
+
"@tramvai/tokens-http-client": "1.94.0",
|
|
29
|
+
"@tramvai/state": "1.94.0",
|
|
30
|
+
"@tramvai/papi": "1.94.0",
|
|
31
|
+
"@tinkoff/measure-fastify-requests": "0.0.1",
|
|
32
32
|
"@tinkoff/monkeypatch": "1.3.3",
|
|
33
33
|
"@tinkoff/url": "0.7.37",
|
|
34
34
|
"@tinkoff/utils": "^2.1.2",
|
|
35
35
|
"prom-client": "^12.0.0",
|
|
36
|
-
"@tinkoff/logger": "0.10.
|
|
36
|
+
"@tinkoff/logger": "0.10.15",
|
|
37
37
|
"@tinkoff/metrics-noop": "1.0.2",
|
|
38
38
|
"@tinkoff/browser-timings": "0.9.4"
|
|
39
39
|
},
|