@tramvai/module-metrics 2.39.3 → 2.44.2
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Gauge, Histogram, Summary } from '@tinkoff/metrics-noop';
|
|
2
|
-
|
|
2
|
+
type Labels<T extends string> = Record<T, string | number>;
|
|
3
3
|
export declare function startMeasurePerformance<T extends string>(name: string, startLabels?: Labels<T>): (endLabels?: Labels<T>) => void;
|
|
4
4
|
interface PerfMetricConfigurator {
|
|
5
5
|
name: string;
|
|
@@ -2,7 +2,7 @@ interface IndexObject<T> {
|
|
|
2
2
|
[key: string]: IndexObject<T> | T;
|
|
3
3
|
value?: T;
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
type UpdateFn<T> = (oldValue: T | void) => T;
|
|
6
6
|
export declare class PrefixTree<T> {
|
|
7
7
|
index: IndexObject<T>;
|
|
8
8
|
delimiter: string;
|
package/lib/request/types.d.ts
CHANGED
|
@@ -5,11 +5,11 @@ import type httpType from 'http';
|
|
|
5
5
|
import type httpsType from 'https';
|
|
6
6
|
import type { Counter, Histogram } from 'prom-client';
|
|
7
7
|
import type { METRICS_MODULE_TOKEN, METRICS_SERVICES_REGISTRY_TOKEN, ModuleConfig } from '@tramvai/tokens-metrics';
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
8
|
+
export type MetricsModule = typeof METRICS_MODULE_TOKEN;
|
|
9
|
+
export type HttpModule = typeof httpType;
|
|
10
|
+
export type HttpsModule = typeof httpsType;
|
|
11
|
+
export type OriginalRequest = HttpModule['request'];
|
|
12
|
+
export type MetricsInstances = {
|
|
13
13
|
requestsTotal: Counter<'status' | 'method' | 'service'>;
|
|
14
14
|
requestsErrors: Counter<'status' | 'method' | 'service'>;
|
|
15
15
|
requestsDuration: Histogram<'status' | 'method' | 'service'>;
|
|
@@ -17,9 +17,9 @@ export declare type MetricsInstances = {
|
|
|
17
17
|
tcpConnectDuration: Histogram<'service'>;
|
|
18
18
|
tlsHandshakeDuration: Histogram<'service'>;
|
|
19
19
|
};
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
20
|
+
export type GetServiceName = typeof METRICS_SERVICES_REGISTRY_TOKEN['getServiceName'];
|
|
21
|
+
export type Args = [RequestOptions | string | URL, (res: IncomingMessage) => void] | [string | URL, RequestOptions, (res: IncomingMessage) => void];
|
|
22
|
+
export type CreateRequestWithMetrics = (args: {
|
|
23
23
|
metricsInstances: MetricsInstances;
|
|
24
24
|
getServiceName: GetServiceName;
|
|
25
25
|
config: ModuleConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/module-metrics",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.44.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"browser": "lib/browser.js",
|
|
6
6
|
"main": "lib/server.js",
|
|
@@ -19,15 +19,15 @@
|
|
|
19
19
|
"build-for-publish": "true"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@tramvai/core": "2.
|
|
23
|
-
"@tramvai/tokens-server": "2.
|
|
24
|
-
"@tramvai/tokens-server-private": "2.
|
|
25
|
-
"@tramvai/tokens-metrics": "2.
|
|
26
|
-
"@tramvai/tokens-router": "2.
|
|
27
|
-
"@tramvai/module-common": "2.
|
|
28
|
-
"@tramvai/tokens-http-client": "2.
|
|
29
|
-
"@tramvai/state": "2.
|
|
30
|
-
"@tramvai/papi": "2.
|
|
22
|
+
"@tramvai/core": "2.44.2",
|
|
23
|
+
"@tramvai/tokens-server": "2.44.2",
|
|
24
|
+
"@tramvai/tokens-server-private": "2.44.2",
|
|
25
|
+
"@tramvai/tokens-metrics": "2.44.2",
|
|
26
|
+
"@tramvai/tokens-router": "2.44.2",
|
|
27
|
+
"@tramvai/module-common": "2.44.2",
|
|
28
|
+
"@tramvai/tokens-http-client": "2.44.2",
|
|
29
|
+
"@tramvai/state": "2.44.2",
|
|
30
|
+
"@tramvai/papi": "2.44.2",
|
|
31
31
|
"@tinkoff/measure-fastify-requests": "0.1.6",
|
|
32
32
|
"@tinkoff/monkeypatch": "2.0.3",
|
|
33
33
|
"@tinkoff/url": "0.8.4",
|