@tramvai/module-metrics 1.8.8 → 1.9.3
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.js +7 -7
- package/package.json +8 -8
package/lib/server.js
CHANGED
|
@@ -117,12 +117,12 @@ const initRequestsMetrics = ({ metrics, getServiceName, http, https, createReque
|
|
|
117
117
|
labelNames: ['status', 'method', 'service'],
|
|
118
118
|
}),
|
|
119
119
|
};
|
|
120
|
-
monkeypatch__default[
|
|
120
|
+
monkeypatch__default["default"]({
|
|
121
121
|
obj: https,
|
|
122
122
|
method: 'request',
|
|
123
123
|
handler: createRequestWithMetrics({ metricsInstances, getServiceName }),
|
|
124
124
|
});
|
|
125
|
-
monkeypatch__default[
|
|
125
|
+
monkeypatch__default["default"]({
|
|
126
126
|
obj: http,
|
|
127
127
|
method: 'request',
|
|
128
128
|
handler: createRequestWithMetrics({ metricsInstances, getServiceName }),
|
|
@@ -195,7 +195,7 @@ class MetricsServicesRegistry {
|
|
|
195
195
|
registerEnv(env) {
|
|
196
196
|
Object.keys(env).forEach((name) => {
|
|
197
197
|
// В env могут быть undefined, и number, т.к. это явно не урлы, просто пропускаем
|
|
198
|
-
if (isString__default[
|
|
198
|
+
if (isString__default["default"](env[name])) {
|
|
199
199
|
this.register(env[name], name);
|
|
200
200
|
}
|
|
201
201
|
});
|
|
@@ -238,13 +238,13 @@ RequestModule = tslib.__decorate([
|
|
|
238
238
|
multi: true,
|
|
239
239
|
useFactory: ({ metrics, envManager, metricsServicesRegistry }) => {
|
|
240
240
|
if (!metrics) {
|
|
241
|
-
return noop__default[
|
|
241
|
+
return noop__default["default"];
|
|
242
242
|
}
|
|
243
243
|
return () => {
|
|
244
244
|
const env = envManager.getAll();
|
|
245
245
|
metricsServicesRegistry.registerEnv(env);
|
|
246
246
|
const getServiceName = metricsServicesRegistry.getServiceName.bind(metricsServicesRegistry);
|
|
247
|
-
initRequestsMetrics({ metrics, getServiceName, http: http__default[
|
|
247
|
+
initRequestsMetrics({ metrics, getServiceName, http: http__default["default"], https: https__default["default"], createRequestWithMetrics });
|
|
248
248
|
};
|
|
249
249
|
},
|
|
250
250
|
deps: {
|
|
@@ -289,7 +289,7 @@ InstantMetricsModule = tslib.__decorate([
|
|
|
289
289
|
multi: true,
|
|
290
290
|
useFactory({ metrics, logger, instantMetrics, }) {
|
|
291
291
|
const log = logger('instantmetrics:papi');
|
|
292
|
-
const instantMetricsMap = fromPairs__default[
|
|
292
|
+
const instantMetricsMap = fromPairs__default["default"](instantMetrics || []);
|
|
293
293
|
return papi.createPapiMethod({
|
|
294
294
|
method: 'post',
|
|
295
295
|
path: '/metrics/:metric',
|
|
@@ -423,7 +423,7 @@ exports.MetricsModule = tslib.__decorate([
|
|
|
423
423
|
app.use(measureExpressRequests.measure({
|
|
424
424
|
metrics,
|
|
425
425
|
metricsExcludePaths,
|
|
426
|
-
additionalLabelNames: flatten__default[
|
|
426
|
+
additionalLabelNames: flatten__default["default"](additionalLabelNamesList || []),
|
|
427
427
|
getAdditionalLabelValues(req, res) {
|
|
428
428
|
if (!getAdditionalLabelValuesList) {
|
|
429
429
|
return {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/module-metrics",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"browser": "lib/browser.js",
|
|
6
6
|
"main": "lib/server.js",
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"build-for-publish": "true"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@tramvai/core": "1.
|
|
23
|
-
"@tramvai/tokens-server": "1.
|
|
24
|
-
"@tramvai/tokens-metrics": "1.
|
|
25
|
-
"@tramvai/module-common": "1.
|
|
26
|
-
"@tramvai/tokens-http-client": "1.
|
|
27
|
-
"@tramvai/state": "1.
|
|
28
|
-
"@tramvai/papi": "1.
|
|
22
|
+
"@tramvai/core": "1.9.3",
|
|
23
|
+
"@tramvai/tokens-server": "1.9.3",
|
|
24
|
+
"@tramvai/tokens-metrics": "1.9.3",
|
|
25
|
+
"@tramvai/module-common": "1.9.3",
|
|
26
|
+
"@tramvai/tokens-http-client": "1.9.3",
|
|
27
|
+
"@tramvai/state": "1.9.3",
|
|
28
|
+
"@tramvai/papi": "1.9.3",
|
|
29
29
|
"@tinkoff/measure-express-requests": "1.4.2",
|
|
30
30
|
"@tinkoff/monkeypatch": "1.3.3",
|
|
31
31
|
"@tinkoff/url": "0.7.36",
|