@promster/types 3.1.3 → 3.2.1
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/dist/declarations/src/index.d.ts +24 -12
- package/package.json +6 -6
|
@@ -1,33 +1,45 @@
|
|
|
1
1
|
import type { DeepRequired } from 'ts-essentials';
|
|
2
2
|
import { Gauge, Counter, Summary, Histogram } from 'prom-client';
|
|
3
3
|
export declare type TLabelValues = Record<string, string | number>;
|
|
4
|
+
declare type TContext<Q, S> = {
|
|
5
|
+
req: Q;
|
|
6
|
+
res: S;
|
|
7
|
+
};
|
|
4
8
|
export declare type TPromsterOptions = {
|
|
5
9
|
labels?: string[];
|
|
6
|
-
accuracies?: Array<'ms' | 's'>;
|
|
7
10
|
metricPrefix?: string;
|
|
8
11
|
metricTypes?: string[];
|
|
9
12
|
metricNames?: Record<string, string | string[]>;
|
|
10
|
-
normalizePath?: (path: string) => string;
|
|
11
|
-
normalizeStatusCode?: (code: number) => number;
|
|
12
|
-
normalizeMethod?: (method: string) => string;
|
|
13
|
+
normalizePath?: <Q, S>(path: string, context: TContext<Q, S>) => string;
|
|
14
|
+
normalizeStatusCode?: <Q, S>(code: number, context: TContext<Q, S>) => number;
|
|
15
|
+
normalizeMethod?: <Q, S>(method: string, context: TContext<Q, S>) => string;
|
|
13
16
|
getLabelValues?: <Q, S>(request: Q, response: S) => TLabelValues;
|
|
14
17
|
detectKubernetes?: boolean;
|
|
15
18
|
buckets?: [number];
|
|
16
19
|
percentiles?: [number];
|
|
17
20
|
skip?: <Q, S>(request: Q, response: S, labels: TLabelValues) => boolean;
|
|
21
|
+
disableGcMetrics?: boolean;
|
|
18
22
|
};
|
|
19
23
|
export declare type TDefaultedPromsterOptions = DeepRequired<TPromsterOptions>;
|
|
20
|
-
export declare type
|
|
24
|
+
export declare type THttpMetrics = {
|
|
25
|
+
httpRequestDurationPerPercentileInSeconds?: Array<Summary<string>>;
|
|
26
|
+
httpRequestDurationInSeconds?: Array<Histogram<string>>;
|
|
27
|
+
httpRequestsTotal?: Array<Counter<string>>;
|
|
28
|
+
httpRequestContentLengthInBytes?: Array<Histogram<string>>;
|
|
29
|
+
httpResponseContentLengthInBytes?: Array<Histogram<string>>;
|
|
30
|
+
};
|
|
31
|
+
export declare type TGcMetrics = {
|
|
21
32
|
up: Array<Gauge<string>>;
|
|
22
33
|
countOfGcs: Array<Counter<string>>;
|
|
23
34
|
durationOfGc: Array<Counter<string>>;
|
|
24
35
|
reclaimedInGc: Array<Counter<string>>;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
};
|
|
37
|
+
export declare type TGraphQlMetrics = {
|
|
38
|
+
graphQlParseDuration?: Array<Histogram<string>>;
|
|
39
|
+
graphQlValidationDuration?: Array<Histogram<string>>;
|
|
40
|
+
graphQlResolveFieldDuration?: Array<Histogram<string>>;
|
|
41
|
+
graphQlRequestDuration?: Array<Histogram<string>>;
|
|
42
|
+
graphQlErrorsTotal?: Array<Counter<string>>;
|
|
32
43
|
};
|
|
33
44
|
export declare type TValueOf<T> = T[keyof T];
|
|
45
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promster/types",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "Shared types of promster",
|
|
5
5
|
"main": "dist/promster-types.cjs.js",
|
|
6
6
|
"typings": "dist/promster-types.cjs.d.ts",
|
|
7
7
|
"types": "dist/promster-types.cjs.d.ts",
|
|
8
|
-
"scripts": {},
|
|
9
8
|
"files": [
|
|
10
9
|
"readme.md",
|
|
11
10
|
"package.json",
|
|
@@ -16,12 +15,13 @@
|
|
|
16
15
|
"access": "public"
|
|
17
16
|
},
|
|
18
17
|
"engines": {
|
|
19
|
-
"node": ">=
|
|
20
|
-
"npm": ">=
|
|
18
|
+
"node": ">=14",
|
|
19
|
+
"npm": ">=6"
|
|
21
20
|
},
|
|
22
21
|
"repository": {
|
|
23
22
|
"type": "git",
|
|
24
|
-
"url": "
|
|
23
|
+
"url": "https://github.com/tdeekens/flopflip.git",
|
|
24
|
+
"directory": "packages/types"
|
|
25
25
|
},
|
|
26
26
|
"author": "Tobias Deekens <nerd@tdeekens.name>",
|
|
27
27
|
"license": "MIT",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"prometheus"
|
|
36
36
|
],
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"prom-client": "14.0.
|
|
38
|
+
"prom-client": "14.0.1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"prom-client": "13.x.x || 14.x"
|